ReadonlyheightThe height of the canvas, in pixels
ReadonlywidthThe width of the canvas, in pixels
Completely clears the canvas.
The zero-indexed layer to clear, if unset, will clear all layers
Draw an object onto the canvas.
Any drawable object
The zero-indexed layer to draw to
Get the current cursor position.
Cursor position as [x, y]
Determine whether a key is currently pressed.
The key to check
True if key is down
Determine whether a mouse button is currently pressed.
The button ID
True if button is down
Determines whether audio is muted
True if currently muted
Determines whether the media recorder is active
True if currently recording
Mute all audio
Play an audio file
The path of the audio file
Whether to play the audio on loop
The normalized [0-1] volume
The track number to play on
Take a screenshot of the canvas contents and save to a .png file.
The file name of the screenshot
Start recording all layers on the canvas
Stop all audio tracks from playing
Stop recording and download screen capture
Unmute all audio
Represents a canvas for drawing and animating