SUPPORTED COMMANDS & COLORS

DRAWING

setColor(color) — set pen color (red, #FF00FF, etc.)
drawCircle(x, y, r) — filled circle at (x,y) radius r
drawRect(x, y, w, h) — filled rectangle at (x,y) size w×h
drawLine(x1, y1, x2, y2) — line from (x1,y1) to (x2,y2)
drawEllipse(x, y, radiusx, radiusy) — draws an ellipse at (x, y) 
drawTri(x1, y1, x2, y2, x3, y3) — draws a triangle
strokeCircle(x, y, r) — outlines a circle
drawQuad(x1, y1, x2, y2, x3, y3, x4, y4) — draw a quad
strokeTri(x1, y1, x2, y2, x3, y3) — outlines a triangle
strokeRect(x, y, w, h) — outlines a rectangle
strokeEllipse(x, y, rx, ry) — outlines an ellipse
drawText("Text", x, y) — draws text
setFont("#px 'font name'") — example: setFont("16px 'Arial'")
setLineWidth(width) — sets stroke width
clear() — clear canvas
    

OUTPUT

print("text") — print text to console

CONTROL FLOW

for var = start to end { ... } — loop inclusive
while condition { ... } — loop while condition
loop { ... } — loop forever
wait(ms) — waits milliseconds
    

VARIABLES & ARRAYS

VarName = expression — assign variable
myArray = [1,2,3] — create array
print(myArray[0]) — access index
myArray[1] = 42 — assign value
    

FUNCTIONS

function myFunc(a, b) { ... }
myFunc(5, 10) — call function
Supports arrays, variables, math expressions
    

UTILITY FUNCTIONS

random(min, max), randInt(min,max), clamp(val,min,max), lerp(a,b,t)
    

INPUT FUNCTIONS

mouseX(), mouseY(), mouseIsDown(), mouseWasPressed()
    

SUPPORTED MATH FUNCTIONS

Math.sin, Math.cos, Math.tan, Math.asin, Math.acos,
Math.atan, Math.atan2, Math.sqrt, Math.abs, Math.floor,
Math.ceil, Math.round, Math.PI, Math.E, Math.pow,
Math.exp, Math.log, Math.max, Math.min
    

SUPPORTED FONTS

Arial Verdana Helvetica Georgia Times New Roman Lucida Console Trebuchet MS Impact Comic Sans MS Monospace Sans-serif Serif Cursive Fantasy

SUPPORTED COLORS

red orange yellow green blue cyan black white brown maroon olive lime teal navy silver gray purple magenta pink coral gold salmon beige chocolate crimson darkblue darkcyan darkgreen darkmagenta darkorange darkred darkviolet deeppink weezerblue dodgerblue firebrick forestgreen gainsboro ghostwhite goldenrod greenyellow honeydew hotpink indianred indigo khaki lavender lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightpink lightsalmon lightseagreen lightskyblue lightslategray lightsteelblue lightyellow limegreen linen mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite oldlace olivedrab orange_red orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru plum powderblue rosybrown royalblue saddlebrown sandybrown seagreen seashell sienna skyblue slateblue slategray snow springgreen steelblue tan thistle tomato turquoise violet wheat whitesmoke yellowgreen