Skip to main content
Represents a Rive artboard instance, providing drawing, advancing, interaction handling, and access to named nodes and data.

Fields

frameOrigin

If true, the artboard’s origin is treated as the frame origin.

data

The typed data associated with the artboard.

width

The width of the artboard.

height

The height of the artboard.

Methods

draw

Draws the artboard using the provided renderer.
With a visitor, each drawable that has custom properties is handed to it instead of being drawn: the visitor decides whether to call drawable:draw(renderer) and under what renderer state. Whatever it sets on the renderer ends with that visit. Every other drawable draws as usual, and clipping still applies. context is passed through to the visitor untouched.
Drawing a tagged nested artboard visits the tagged drawables inside it from within that drawable:draw call, so a value carries down in a local:

drawModulated

Draws the artboard with the color modulation set, per drawable, from its custom property of this key: a number as a gray level clamped to 0..1, a color as is. Drawables without it draw under the renderer’s current state. Levels multiply down through tagged drawables that hold others: inside a nested artboard tagged 0.5, a shape tagged 0.2 draws at 0.1 and an untagged one at 0.5. Nothing calls back into the script, so this is the cheapest way to draw a pass like emission.

propertyKey

The key custom properties called name are read by. When no property in the file carries that name the key matches nothing, so every read by it comes back nil. Custom properties are added to a drawable in the editor’s inspector.

advance

Advances the artboard by the given time in seconds. Returns true if the artboard should continue receiving advance calls.

instance

Creates a new instance of the artboard with independent state.

animation

Creates an animation instance linked to the artboard instance

bounds

Returns the bounding box of the artboard as two Vector values: the minimum point and the maximum point.

node

Returns the node with the given name, or nil if no such node exists.

pointerDown

Pointer event down handler. Returns a hit-test result (0 = no hit). Only returns a non-zero value if a hit-testable object inside the nested artboard is hit.

pointerUp

Pointer event up handler. Returns a hit-test result (0 = no hit). Only returns a non-zero value if a hit-testable object inside the nested artboard is hit.

pointerMove

Pointer event move handler. Returns a hit-test result (0 = no hit). Only returns a non-zero value if a hit-testable object inside the nested artboard is hit.

pointerExit

Pointer event exit handler. Returns a hit-test result (0 = no hit). Only returns a non-zero value if a hit-testable object inside the nested artboard is hit.

addToPath

Adds the artboard’s geometry to the given path, optionally transformed by the provided matrix. For a complete working example, see the Add to Path demo.

gamepadConnected

gamepadEvent

gamepadDisconnected