Skip to content

$fillRect

Draws a new rect.

Usage

$fillRect[canvas;style;x?;y?;width?;height?;radius?]

Parameters

FieldDescriptionTypeRequired
canvasThe canvas name.stringtrue
styleThe rect style.color | gradient | patterntrue
xThe rect X position.numberfalse
yThe rect Y position.numberfalse
widthThe rect width.numberfalse
heightThe rect height.numberfalse
radiusThe rect corners radius.number | number[]false

Example(s)

This will draw a 250x250 red square

$attachCanvas[redsquare;ball.png]
$fillRect[redsquare;#FF0000;0;0;250;250]
$createCanvas[redsquare;250;250]

Preview

This will draw a 250x250 red circle

$attachCanvas[redball;ball.png]
$fillRect[redball;#FF0000;0;0;250;250;125]
$createCanvas[redball;250;250]

Preview