NodeProps
Fields to set on a node when making it (or with node.set): position, rotation, scale, look. Stage units.
Example
Section titled “Example”engine.sprite('star', { x: 640, y: 360, scale: 2, anchor: 0.5, alpha: 0.8 })Extended by
Section titled “Extended by”Properties
Section titled “Properties”
optionalx?:number
Position in the parent, stage units (y downwards).
optionaly?:number
Position in the parent, stage units (y downwards).
rotation?
Section titled “rotation?”
optionalrotation?:number
Radians, clockwise.
scale?
Section titled “scale?”
optionalscale?:number
Both scales at once.
scaleX?
Section titled “scaleX?”
optionalscaleX?:number
Horizontal scale (negative: mirrored).
scaleY?
Section titled “scaleY?”
optionalscaleY?:number
Vertical scale.
alpha?
Section titled “alpha?”
optionalalpha?:number
0–1, multiplied down the tree.
visible?
Section titled “visible?”
optionalvisible?:boolean
Hidden nodes and their children are not drawn.
optionaltint?:ColorLike
A colour multiplied with the pixels (white: none), as 0xRRGGBB or CSS.
blend?
Section titled “blend?”
optionalblend?:Blend
‘add’ for glows and sparks.
optionalz?:number
Drawing order among siblings: higher on top (equal: order of adding).
anchor?
Section titled “anchor?”
optionalanchor?:number| {x:number;y:number; }
Anchor, 0–1 of the size: 0 top-left, 0.5 the middle. A number sets both.
width?
Section titled “width?”
optionalwidth?:number
Local width, stage units (sprites and shapes: stretched to it).
height?
Section titled “height?”
optionalheight?:number
Local height, stage units.
hitRadius?
Section titled “hitRadius?”
optionalhitRadius?:number
Hit tests use a circle of this radius (local units) around the origin instead of the rectangle.
optionalclip?:ClipRect|null
Clips the node and its children to this rectangle, in the node’s own units (null: no clip).
optionalmask?:Node|null
Shows the node and its children only where this node is opaque (null: no mask). See Node.mask.
filters?
Section titled “filters?”
optionalfilters?:Filter[] |null
Filters, in order (null: none). See Node.filters.