Scenes, nodes and components
Scene documents
Scenes are persisted as .scene.json: a node tree, component data and Prefab references. At runtime you get a read-only document plus a mutable instance: Prefabs are expanded and overrides applied while instantiating, after which node and component data is the single source of truth.
json
{
"formatVersion": 1,
"root": {
"uid": "n_root",
"name": "Root",
"components": [
{ "type": "suity.transform", "properties": { "x": 0, "y": 0 } }
]
}
}Nodes
SceneInstance and the SDK Node expose a consistent set of operations:
| Operation | API |
|---|---|
| Query by ref / uid | scene.get(ref) / scene.getByUid(uid) |
| Traverse | scene.getAll(), node.children |
Structural edits (require mutable) | scene.instantiatePrefab(...), node.addComponent(...), node.removeComponent(...) |
| Visual container | node.container() (Pixi Container) |
Nodes have two data-only switches:
activehides the whole subtree while still allowing selection and focus in the editor.bindis the binding name used with[Group/Element]paths (editor and Actor).
Components
Component types use the neutral suity.* prefix and are defined by the engine catalog:
| Type | Purpose |
|---|---|
suity.transform | Position / rotation / scale; exactly one per spatial node |
suity.sprite | Texture sprite |
suity.vector | SVG vector (vector Graphics with raster fallback) |
suity.text | Text box |
suity.image | Explicit size with a fit mode |
suity.button | Four-state overlay colors and click events |
suity.camera2d | 2D orthographic camera |
suity.customProperties | User-defined typed values and references |
suity.hitArea2d | Local rectangle hit area (physics/picking) |
suity.playAudio | Audio playback routed through the project mixer |
Shared component semantics:
enabledis data state: disabled components neither render nor respond to interaction, and Play rebuilds from current data.- Visual fields are view-first, structural fields data-first; writing view/native does not write back to data.
component.visual()returns the component's own render view (ornull);component.native()returns the module controller/renderer (ornull).
Prefabs
- A Prefab has strictly one root; the editor wraps multi-root selections in a synthetic main root.
- Runtime
instantiatePrefabrequires exactly one root, otherwise it returnsPREFAB_INVALID. - Instances are data-only: overrides apply once at instantiation, and later node/component edits do not write back to the Prefab.
- Direct child refs look like
instance/child; non-transform components on the source root, Layer/Tag and scene-owned children are preserved.
Assets
Assets are managed by the registry and support Addressable Keys, uids and plain URLs. At runtime scene.assets resolves them:
ts
const texture = await scene.assets.loadTexture("textures/hero");
const record = await scene.assets.resolve("audio/hit");The engine caches textures, SVGs and fonts; the same asset is shared across nodes.
Layers and tags
- Layer is a single value used for render order and logical grouping.
- Tag is multi-valued and used for physics/query filters (
filter.tags,excludeTags). - The camera is exposed as
scene.mainCamera;getMainCameraView(width, height)returns the letterboxed view rect. Without a usable camera, Play and deployment showNO CAMERA.
