Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sanchedev/tiny-engine/llms.txt
Use this file to discover all available pages before exploring further.
Transform is the fundamental layout node in tiny-engine. It has no visual representation of its own; instead it applies a position offset to the canvas context before drawing its children, so every descendant inherits the world-space coordinate system automatically.
Use Transform whenever you want to group game objects under a shared coordinate system — a character body and its attached sprite, a UI panel with multiple children, or any logical hierarchy you want to move as one unit.
Usage
Props
The node’s local position in the 2D plane. Accepts a
Vector2, a plain {x, y} object, a [x, y] tuple, or a single number (uniform). Defaults to Vector2.ZERO. Reactive when a SignalGetter is passed.A ref object created by
useRefNode(PrimaryNode.Transform). Attach it to access the underlying Transform instance at runtime.An optional script object whose lifecycle methods are called automatically alongside the node’s own lifecycle.
An optional identifier for this node. Must match
[a-zA-Z][a-zA-Z0-9-_]* when a string. Used with node.child({ path, type }) to locate descendants by path.Draw order among siblings. Higher values are drawn on top. Defaults to
0.Speed multiplier applied to
delta for this node and all its descendants. 0.5 = half-speed, 2 = double-speed. Defaults to 1.Child nodes nested inside this transform. All children inherit the transform’s world-space coordinate system.
Events
Subscribe to node lifecycle events usinguseEvent.
| Event name | Callback signature | Description |
|---|---|---|
started | () => void | Fires once when the node finishes start(). |
updated | (delta: number) => void | Fires every frame during the update cycle. |
drawed | (delta: number) => void | Fires every frame during the draw cycle. |
destroyed | () => void | Fires once when the node is destroyed. |
Nesting example
Nest any node type as a child. The child’sposition is relative to the parent transform’s origin.
Transform itself never renders pixels. If you need a visible shape at the same position, add a Sprite node as a child.Related
Sprite— add a texture inside a transformCollider— attach a physics shape as a childuseRefNode— access the node instance at runtimeuseEvent— subscribe to node events