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?"
Matrix details use the accepted direct Web boundary 2.42.0 -> C++
runtime-v0.1.344; current editor-only and later-source findings are labelled
separately. GPU callback guidance remains rollout-dependent. Web 2.42.0 adds
a separate experimental, default-off enableGPUCanvas import option at the
JavaScript host layer; it is not a Luau callback or LSP declaration. For
versioned API tracking, see
Runtime Compatibility Baseline.
Runtime source registration, public documentation, and editor/release
availability are separate claims. FileFormat and TextFileFormat are current
editor Luau protocols, but serialized host fields, implemented-method
bits, scriptProtocolValue, dependency verification, module IDs, and RASC
workspace messages are not callable APIs. Native host methods such as
StateMachineInstance:keyInput and module trace labels are also not Luau
contracts. Context.log is a current editor property, while the exact target's
C++ Luau Context has no matching dispatch.
An authored utility module is a ScriptAsset marked as a module and is loaded
with its authored require("Name"). A ScriptModuleAsset is a distinct
self-contained compiled WASM host payload. Its language value, handle, and
serialized identity never become a Luau global, type, or alternate require
name.
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 only when rendering | context: Context (init), renderer: Renderer (draw), Canvas/GPUCanvas work merged into draw, seconds: number (advance), event: PointerEvent (pointerDown/Move/Up/Exit), current Editor-reference gamepad payloads (gamepadConnected/Event/Disconnected); source/runtime-only keyboard/text callbacks are tracked separately |
| Layout | init; resize is optional | context: Context (init), size: Vector and displayScale: number (resize; old two-parameter callbacks remain compatible), renderer: Renderer (draw), Canvas/GPUCanvas work merged into draw, 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(...) |
Editor document extensions
| Protocol | Factory | Callback inputs | Runtime/export handoff |
|---|---|---|---|
FileFormat | return function(): FileFormat | FormatDocument; optional EditorContext, FormatSurface, cached buffer | Binary Blob |
TextFileFormat | return function(): TextFileFormat | Same view inputs plus pure highlight, diagnostic, completion, hover, and format callbacks | Plain Blob via context:blob(name) |
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 work inside draw | ⚠️ 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 merge offscreen
Canvas/Early AccessGPUCanvasrender passes intodraw(self, renderer)and composite the resulting image there. The retireddrawCanvasname must not be added to new scripts.
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. In the
August 14 current Editor reference,
ReportedEvent,ViewModelChange, andNoneEventexpose no public fields, while gamepad payloads use three distinct connected/event/disconnected types with full state on the first two. Historical*Invocationwrapper names belong to pinned runtime source, not current Editor-authored examples.
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 merged draw + GPUCanvas, Early Access / 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 |