Script Capability Matrix
Use this page when you need exact boundaries such as:
- "Can this script type access
PathData?" - "Which script gets
PointerEvent?" - "Can this script draw to the renderer?"
- "Where do script inputs actually come from?"
Runtime baseline
Matrix details are aligned to the June 4, 2026 compatibility baseline: public npm runtime line 2.37.8 plus source-level API snapshot runtime-v0.1.106. GPU callback guidance remains Rive Early Access editor workflow material. For versioned API-surface tracking, see Runtime Compatibility Baseline.
1) Callback Parameter Matrix (What Each Script Receives)
This is the quickest way to see all runtime callback parameters by script type.
| Script Type | Required Callbacks | Callback Parameters You Get |
|---|---|---|
| Node | init, draw | context: Context (init), renderer: Renderer (draw), no-argument canvas phase (drawCanvas), seconds: number (advance), event: PointerEvent (pointerDown/Move/Up/Exit), keyboard/text invocations (keyboardEvent, textEvent) |
| Layout | init, resize | context: Context (init), size: Vector (resize), renderer: Renderer (draw), no-argument canvas phase (drawCanvas), seconds: number (advance) |
| Converter | convert, reverseConvert | input: DataInputs (convert), input: DataOutput (reverseConvert), optional context: Context (init), optional seconds: number (advance) |
| Path Effect | update | inPath: PathData + node: NodeReadData (update), seconds: number (advance), optional context: Context (init) |
| ListenerAction | performAction | listenerContext: ListenerContext (performAction), optional context: Context (init) |
| TransitionCondition | evaluate | no parameters (evaluate), optional context: Context (init) |
| Util | none | no lifecycle callback params (module table only) |
| Test | setup(test: Tester) | test: Tester, and expect inside each test.case(...) |
2) Capability / Limitation Matrix
Legend: ✅ supported, ⚠️ conditional/indirect, ❌ not supported.
2A) Core Runtime Scripts
| Capability | Node | Layout | Converter | Path Effect |
|---|---|---|---|---|
| Place or bind to scene target | ✅ | ✅ | ✅ | ✅ |
Read editor Input<T> fields | ✅ | ✅ | ⚠️ 1 | ✅ |
Access Context in init | ✅ | ✅ | ✅ | ✅ |
Custom render with Renderer | ✅ | ✅ | ❌ | ❌ |
Offscreen Canvas / GPUCanvas render phase | ⚠️ 5 | ⚠️ 5 | ❌ | ❌ |
Receive PointerEvent directly | ✅ | ❌ | ❌ | ❌ |
Transform host PathData geometry | ❌ | ❌ | ❌ | ✅ |
| Has per-frame callback | ✅ | ✅ | ⚠️ 4 | ✅ |
Importable via require() | ❌ | ❌ | ❌ | ❌ |
| Primary unit-test target | ⚠️ | ⚠️ | ⚠️ | ⚠️ |
2B) State + Utility Scripts
| Capability | ListenerAction | TransitionCondition | Util | Test |
|---|---|---|---|---|
| Place or bind to scene target | ✅ | ✅ | ❌ | ❌ |
Read editor Input<T> fields | ⚠️ 2 | ✅ 3 | ❌ | ❌ |
Access Context in init | ✅ | ✅ | ❌ | ❌ |
Custom render with Renderer | ❌ | ❌ | ❌ | ❌ |
Receive PointerEvent directly | ⚠️ 2 | ❌ | ❌ | ❌ |
Transform host PathData geometry | ❌ | ❌ | ❌ | ❌ |
| Has per-frame callback | ❌ | ✅ | ❌ | ❌ |
Importable via require() | ❌ | ❌ | ✅ | ❌ |
| Primary unit-test target | ⚠️ | ⚠️ | ✅ | ✅ |
Notes:
- Converter scripts consume binding values through
convert(input)/reverseConvert(input)callback parameters. - ListenerAction scripts are event-driven (
performAction(listenerContext)). Pointer data is accessed through listener context when the listener event carries it. - TransitionCondition scripts often use threshold-style inputs plus ViewModel/context state to decide
evaluate(). - Converter scripts can optionally define
advance(self, seconds)for time-based conversion logic, but many converters are purely data-driven. - Node and Layout scripts can use
drawCanvas(self)for offscreenCanvasand early-accessGPUCanvasrender passes, then composite the resulting image fromdraw(self, renderer).
2C) Script-by-Script Boundaries
| Script Type | Strong At | Cannot Do |
|---|---|---|
| Node | Rendering, interaction, per-frame animation, input-driven visuals | Cannot receive host PathData from existing stroke/fill |
| Layout | Child sizing/positioning and optional custom draw | Not a data-binding transformer protocol |
| Converter | Data transformation between binding endpoints | No rendering, no pointer handlers, no host path geometry |
| Path Effect | Direct path-geometry transformation of attached stroke/fill | No Renderer drawing callback for arbitrary scene rendering |
| ListenerAction | State-machine listener reactions with typed ListenerContext branching (is... / as...) | No per-frame lifecycle, no rendering |
| TransitionCondition | Custom boolean gating for state transitions | No rendering, no pointer event callback parameter |
| Util | Shared reusable code via require() | No lifecycle callbacks, cannot attach directly |
| Test | Unit-test harness for util logic | Not an attached runtime behavior script |
Important Boundaries
- Only Path Effect scripts receive
PathDataof an existing host shape. - Node scripts can draw custom
Pathobjects, but do not receiveinPath: PathDatafrom an existing stroke/fill. - Nesting a Node script under a shape or group affects hierarchy behavior, not callback shape. It changes local transform, inherited opacity, and draw order, but it does not pass an implicit host
NodeDataor parentPathDatainto Node callbacks. Listener<T>is not a script type; it is a function signature used byaddListener()/removeListener()APIs.- Util/Test scripts are non-attached scripts: Util is imported code; Test is manual test execution.
- ListenerContext payload detail is not uniform across kinds at this baseline (
ReportedEventandViewModelChangeare currently limited payloads).
2D) Runtime-Backed Advanced Protocol
| Protocol | Callback Surface | Current Guidance |
|---|---|---|
| ScriptedInterpolator | transform(factor), transformValue(from, to, factor) | Runtime-backed in current baseline; use for custom interpolation/easing logic, with linear fallback when omitted or failing |
3) "What Should I Use?" Quick Mapping
| Need | Use |
|---|---|
| Draw custom graphics every frame | Node (draw, optional advance) |
| Render GPU shader effects or post-processing | Node or Layout with drawCanvas + GPUCanvas, preview / rollout-dependent |
| Position/size children in a layout | Layout (resize, optional measure) |
| Transform binding values | Converter (convert, reverseConvert) |
| Distort or rebuild existing shape path geometry | Path Effect (update(inPath, node)) |
| Run logic on state machine listener events | ListenerAction (performAction) |
| Gate transitions with custom boolean logic | TransitionCondition (evaluate) |
| Customize keyframe interpolation/easing in script | ScriptedInterpolator (transform, transformValue) |
| Share reusable helpers/types | Util |
| Validate utility logic | Test |