Skip to content

SpriteProps

NodeProps, and the frame to show.

optional x?: number

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

NodeProps.x


optional y?: number

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

NodeProps.y


optional rotation?: number

Radians, clockwise.

NodeProps.rotation


optional scale?: number

Both scales at once.

NodeProps.scale


optional scaleX?: number

Horizontal scale (negative: mirrored).

NodeProps.scaleX


optional scaleY?: number

Vertical scale.

NodeProps.scaleY


optional alpha?: number

0–1, multiplied down the tree.

NodeProps.alpha


optional visible?: boolean

Hidden nodes and their children are not drawn.

NodeProps.visible


optional tint?: ColorLike

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

NodeProps.tint


optional blend?: Blend

‘add’ for glows and sparks.

NodeProps.blend


optional z?: number

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

NodeProps.z


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

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

NodeProps.anchor


optional width?: number

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

NodeProps.width


optional height?: number

Local height, stage units.

NodeProps.height


optional hitRadius?: number

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

NodeProps.hitRadius


optional clip?: ClipRect | null

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

NodeProps.clip


optional mask?: Node | null

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

NodeProps.mask


optional filters?: Filter[] | null

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

NodeProps.filters


optional frame?: string | Frame

An atlas frame, or the name of a loaded or baked one.


optional slice?: number | Insets

Nine-slice insets in frame pixels: one number for all sides, or [top, right, bottom, left]. The corners keep their size when the sprite is resized, the edges and the middle stretch. Default: the frame’s own (an atlas’s scale9Borders), else none.