clear
clears the screen
undo
undo the last thing drawn
color <hex color>
specify the color to draw with - color should be given as hexadecimal
linewidth <size>
specify the width of the pen
stroke
only draw the outline of shapes
fill
fill shapes with color
line <fromX> <fromY> <toX> <toY>
draw a line from (fromX, fromY) to (toX, toY)
rect <x> <y> <width> <height>
draw a rectangle starting at (x, y) with the specified width and height
square <x> <y> <size>
draw a square starting at (x, y) with the width and height of the size specified
csquare <x> <y> <size>
same as square
, but x and y specify the centerpoint of the square
circle <x> <y> <radius>
draw a circle at (x, y) with the specified radius
When drawing lines and shapes, instead of passing a number for positions and sizes, you can specify ranges. This allows you to draw multiple shapes with a single command. Ranges have the following syntax:
<start>:<stop>:<increment>
See the Examples section for sample code.
Draws 5 circles with the following x positions: 100, 200, 300. Each circle has y position 100 and radius 50.
circle 100:300:100 100 50
Run the below examples in script mode to see what they do.
Note: On mobile, the x and y positions may need to be adjusted to fit on screen
example 1
example 2
example 3
example 4