Skip to main content
Node scripts can be used to render shapes, images, text, artboards, and more. A scripted node can be attached to any Node and is rendered in the local transform space of the hosting Node. For more information, see Node Scripts.

Methods

init

Called once when the node is created. Returns true if initialization succeeds. For a more complete example using init, see Instantiating Components.

advance

Optional per-frame update. Returns true if the node should continue receiving advance calls. For a more complete example using advance, see Fixed-step Advanced.

update

Called when an input value changes.

draw

Called to render the node using the provided Renderer. For a more complete example using draw, see Instantiating Components.

drawCanvas

Called during the drawCanvases pass (before draw). All canvas:beginFrame / canvas:beginRenderPass calls must happen here.

pointerDown

Pointer event down handler.

pointerMove

Pointer event move handler.

pointerUp

Pointer event up handler.

pointerExit

Pointer event exit handler.

gamepadConnected

gamepadEvent

gamepadDisconnected