Back to documentation

Canvas

A programmable canvas that can be used to create interactive experiences, tools or games.

Information

Plan: Pro
Added at: 2026-05-25

Properties

PropertyTypeDefault
Background color
string
"var(--ophixor-semantic-surface-base)"
Border color
string
"var(--ophixor-semantic-border-default)"
Border radius
string
"6px"
Border width
string
"1px"
Border style
string
"solid"
Box shadow
string
"var(--ophixor-semantic-shadow-medium)"
Width
string
"100%"
Height
string
"500px"
On mouse down
object
null
On mouse move
object
null
On mouse up
object
null
On render
object
null
On update
object
null
Is visible
boolean
true
Selectors
array
[]

Related actions

ActionDescriptionPlan
Canvas circleDraws or fills a circle in the current canvas.Pro
Canvas clearClears the current canvas.Pro
Canvas imageDraws an image in the current canvas.Pro
Canvas lineDraws a line in the current canvas.Pro
Canvas polygonDraws or fills a polygon in the current canvas.Pro
Canvas rectangleDraws or fills a rectangle in the current canvas.Pro
Canvas restoreRestores the current canvas.Pro
Canvas rotateRotates the current canvas.Pro
Canvas saveSaves the current canvas.Pro
Canvas scaleScales the current canvas.Pro
Canvas textFills text in the current canvas.Pro
Canvas translateTranslates the current canvas.Pro

Related expressions

ExpressionDescriptionPlan
Canvas delta timeReturns the delta time since the last update.Pro
Canvas frames per secondReturns the most recently calculated frames per second (FPS).Pro
Canvas frameReturns the current frame number of the canvas.Pro
Canvas heightReturns the height of the canvas.Pro
Canvas key downReturns true if the provided key is being pressed and false otherwise.Pro
Canvas mouse buttonReturns a string with the last mouse button number or an empty string if not specified.Pro
Canvas mouse downReturns true if a mouse button is being pressed down and false otherwise.Pro
Canvas mouse movedReturns true if the mouse cursor has moved and false otherwise.Pro
Canvas mouse pressedReturns true if a mouse button was just pressed and false otherwise.Pro
Canvas mouse releasedReturns true if a mouse button was just released and false otherwise.Pro
Canvas mouse wheelReturns a number with the current mouse wheel delta since last render.Pro
Canvas mouse XReturns the X-coordinate of the mouse cursor in the canvas.Pro
Canvas mouse YReturns the Y-coordinate of the mouse cursor in the canvas.Pro
Canvas timeReturns a number with the end time of the previous frame's rendering.Pro
Canvas widthReturns the width of the canvas.Pro