Skip to content

Wiggle API / Node

Interface: Node

Properties

enter

readonly enter: Motion

Entrance motion for this node.


exit

readonly exit: ExitMotion

Exit motion for this node.


opacity

readonly opacity: Prop


perspective

readonly perspective: Prop

Camera distance in pixels for the perspective of a tilt. Zero is an orthographic tilt (no foreshortening); a few hundred to a couple thousand gives a natural look, smaller being stronger.


rotation

readonly rotation: Prop


rotationX

readonly rotationX: Prop

2.5D tilt about the horizontal axis, in degrees. With perspective set, the layer foreshortens like a card tilted in space. Applies to a drawn layer (text, shape, image, video), not a group.


rotationY

readonly rotationY: Prop

2.5D tilt about the vertical axis, in degrees.


scale

readonly scale: Prop


x

readonly x: Prop


y

readonly y: Prop

Methods

anchor()

anchor(x, y): Node

Set the anchor point (fraction of the node's bounds) that sits at the position and that scale and rotation pivot around. Default 0.5, 0.5.

Parameters

x

number

y

number

Returns

Node


at()

at(time): Node

Set when this element's entrance begins, in seconds from scene start.

Parameters

time

Duration

Returns

Node


chars()

chars(): NodeGroup

Split a text node into per-character units.

Returns

NodeGroup


lines()

lines(): NodeGroup

Split a text node into per-line units.

Returns

NodeGroup


moveTo()

moveTo(x, y, opts?): Node

Animate to a position, starting at at seconds. ease is a named curve or a spring (default "inOut"). With a spring and no duration, the motion settles naturally.

Parameters

x

number

y

number

opts?
at?

Duration

duration?

Duration

ease?

Easing

Returns

Node


rotateTo()

rotateTo(degrees, opts?): Node

Animate to a rotation in degrees, starting at at seconds. Several tweens on the same property chain, each continuing from the last. See moveTo for ease.

Parameters

degrees

number

opts?
at?

Duration

duration?

Duration

ease?

Easing

Returns

Node


scaleTo()

scaleTo(scale, opts?): Node

Animate to a uniform scale, starting at at seconds. See moveTo for ease.

Parameters

scale

number

opts?
at?

Duration

duration?

Duration

ease?

Easing

Returns

Node


words()

words(): NodeGroup

Split a text node into per-word units for staggered motion.

Returns

NodeGroup