Skip to content

NodeProps

Fields to set on a node when making it (or with node.set): position, rotation, scale, look. Stage units.

engine.sprite('star', { x: 640, y: 360, scale: 2, anchor: 0.5, alpha: 0.8 })

optional x?: number

Position in the parent, stage units (y downwards).


optional y?: number

Position in the parent, stage units (y downwards).


optional rotation?: number

Radians, clockwise.


optional scale?: number

Both scales at once.


optional scaleX?: number

Horizontal scale (negative: mirrored).


optional scaleY?: number

Vertical scale.


optional alpha?: number

0–1, multiplied down the tree.


optional visible?: boolean

Hidden nodes and their children are not drawn.


optional tint?: ColorLike

A colour multiplied with the pixels (white: none), as 0xRRGGBB or CSS.


optional blend?: Blend

‘add’ for glows and sparks.


optional z?: number

Drawing order among siblings: higher on top (equal: order of adding).


optional anchor?: number | { x: number; y: number; }

Anchor, 0–1 of the size: 0 top-left, 0.5 the middle. A number sets both.


optional width?: number

Local width, stage units (sprites and shapes: stretched to it).


optional height?: number

Local height, stage units.


optional hitRadius?: number

Hit tests use a circle of this radius (local units) around the origin instead of the rectangle.


optional clip?: ClipRect | null

Clips the node and its children to this rectangle, in the node’s own units (null: no clip).


optional mask?: Node | null

Shows the node and its children only where this node is opaque (null: no mask). See Node.mask.


optional filters?: Filter[] | null

Filters, in order (null: none). See Node.filters.