Bone
One bone of a skeleton. It turns around its pivot, carries its child bones and attached art, and can bend the shapes bound to it. Its w and h set the bone's width and length through its scale.
In a formula, a node is called by its name in the layers panel: Bone1.color
Properties
colorColor#
Colour the bone is drawn in on the canvas and in the tree, as {r, g, b, a} with each part from 0 to 1. A new bone gets a colour from a palette that depends on its depth.
animatable
minAngleNumber#
Lowest value the bone's rotation can take, in radians. Unset means no limit.
The limit only applies when both minAngle and maxAngle are set, maxAngle is greater than minAngle, and the range is smaller than a full turn (2π). Otherwise the bone turns freely. Note that rotation itself is in degrees, while these two are in radians.
radians · animatable
maxAngleNumber#
Highest value the bone's rotation can take, in radians. Unset means no limit.
See minAngle for when the limit applies. A rotation outside the range is moved to the nearest limit and the clamped value is stored.
radians · animatable
influenceRadiusNumber#
Distance in pixels from the bone over which its pull on bound shapes fades out. Unset or 0 uses the automatic radius, the bone's length.
It shapes the falloff only. Which shapes the bone drives is decided by what it was attached to, not by this radius. A bone that only moves one shape rigidly has no falloff to set.
animatable
Transform from Transform
yNumber#
Vertical position of the bone's joint, in pixels from its parent's origin. Larger values are lower.
animatable
wNumber#
Width of the bone as you see it, in pixels.
Changing it stretches the bone instead of reshaping it, so the artwork attached to the bone stretches with it. The bone keeps its rest size; dragging the width handle on the canvas does the same.
1 – ∞ · pixels · animatable
hNumber#
Length of the bone as you see it, in pixels. Changing it stretches the bone and the artwork attached to it, like dragging its end.
1 – ∞ · pixels · animatable
rotationNumber#
How far the bone is turned around its joint, in degrees, relative to its parent. Positive values turn it clockwise; child bones turn with it.
degrees · animatable
Appearance from Appearance
opacityNumber#
How opaque the node is, from 0 (invisible) to 1 (solid).
It applies to the node and everything inside it. It multiplies with the opacity of each paint.
Default 1 · 0 – 1 · animatable
blendModeBlendMode#
How the node mixes its colours with what is behind it, for example MULTIPLY or SCREEN.
NORMAL just draws over the background. The other values are NORMAL, PASS_THROUGH, MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, COLOR_DODGE, COLOR_BURN, HARD_LIGHT, SOFT_LIGHT, DIFFERENCE, EXCLUSION, HUE, SATURATION, COLOR and LUMINOSITY.
Default 'NORMAL' · animatable
visibleBoolean#
Whether the node is drawn. Set it to false to hide the node and everything inside it.
A hidden node still exists, so formulas can read and change its properties.
Default true · animatable
Node methods every node has them
is(typeOrTag: String) → Booleanmethod#
True when the node is of this type or carries this tag.
typeOrTagA node type such as 'RECT', or a tag.
clone() → Nodemethod#
Makes a copy of the node and returns it, so code can place and change the copy.
destroy()method#
Marks the node for removal; it is taken out of the scene at the end of the frame.
appendChild(child: Node) → Nodemethod#
Moves child into this node as its last child and returns it.
insertBefore(newChild: Node, refChild: Node | null) → Nodemethod#
Moves newChild into this node, just before refChild, and returns it.
refChildThe child to insert before; null appends at the end.
removeChild(child: Node) → Nodemethod#
Takes child out of this node and returns it.
replaceChildren(...nodes: Node)method#
Replaces all of this node's children with the given nodes, in that order.
insertAdjacentElement(position: 'afterbegin' | 'beforeend', element: Node) → Node | nullmethod#
Moves element into this node, as its first or last child.
position'afterbegin' puts it first, 'beforeend' last. Any other position does nothing and returns null.
on(event: String, fn: Function)method#
Calls fn each time fire(event) is called on this node. These are the node's own messages, not the Events panel: a click does not reach on('click').
off(event: String, fn: Function)method#
Stops calling fn for event.
fnThe same function that was passed to on.
fire(event: String, ...args: any)method#
Calls every function added with on(event) on this node, in the order they were added.
...argsPassed on to every listener.