Gear Works
gearWorks
Used for handling system occurances and insctructions.
gearWorks.log(str)
Logs a string in the console.
gearWorks.warn(str)
Logs a warning string in the console.
gearWorks.error(str)
Logs a error in the console.
gearWorks.url(name)
Returns a conversion of a project file to a data url.
gearWorks.playSound(name)
Plays a sound found in the project files.
input
Used to determine what the user is doing at any moment.
mouse.x
Returns mouse x.
mouse.y
Returns mouse y.
keyboard
Returns an array of all keys being pressed at any given moment.
keyboard[keyboard.length1]
Returns the last key pressed.
keyboard.includes(key)
Checks if a key is being pressed.
draw
Used for drawing things on the canvas.
draw.background(cssColor)
Clears the screen and displays a solid color. Example:
draw.background("skyblue");
draw.fillRect(x, y, width, height)
Draws a "filled" rectange.
draw.strokeRect(x, y, width, height)
Draws a rectangle (with no fill).
draw.clearRect(x, y, width, height)
Clears specified pixels within a rectangle.
draw.image(url, x, y, width, height)
Draws an image from the cabinet on the canvas.
draw.beginPath()
Begins a new path or resets the current path.
draw.closePath()
Adds a line to the path from the current point to the start.
draw.moveTo(x, y)
Moves the path to a point in the canvas (without drawing).
draw.lineTo(x, y)
Adds a line to the path.
draw.fill()
Fills the current path.
draw.stroke()
Draws the current path.
draw.arc(x, y, r, startAngle, endAngle)
Adds an arc/curve (circle, or parts of a circle) to the path.
draw.fillText(text, x, y)
Draws "filled" text on the canvas.
draw.strokeText(text, x, y)
Draws text (with no fill).
draw.font = cssFont
Sets or returns the font properties for text content. Example:
draw.font = "50px Arial";
draw.textAlign = cssAlign
Sets or returns the alignment for text content. Example:
draw.textAlign = "center";
draw.fillStyle = cssColor
Sets or returns the color, gradient, or pattern used to fill the drawing.
draw.strokeStyle = cssColor
Sets or returns the color, gradient, or pattern used for strokes.
JavaScript
Operators
Used in everyday programming, these are very important to know.
+
Addition symbol.

Subtraction symbol.
*
Multiplication symbol.
/
Division symbol.
%
Modulus symbol.

Or symbol.
&&
And symbol.
!
Not symbol.
==
Equal to symbol (Not to be confused with a single =, that is variable setting).
Math
Used for representing irrational numbers, and running other mathematical functions.
Math.E
Returns Euler's number.
Math.PI
Returns PI.
Math.sin(int)
Sine function.
Math.cos(int)
Cosine function.
Math.tan(int)
Tangent function.
Math.sqrt(int)
Square root function.
Math.pow(x, y)
Returns x to the power of y.
Math.abs(int)
Absolute value function.
Math.round(int)
Rounding to nearest intager function.
Math.ceil(int)
Rounding up function.
Math.floor(int)
Rounding down function.
Math.random()
Returns random value between 0 and 1.
Extensions