Cancel a specific animation by handle. Pose stays at current value (no jump).
Cancel everything. Useful from a destructor or "reset scene" path.
Cancel every animation currently active under key.
True iff at least one animation is active. With key, scoped to that cancelKey.
Optionalkey: stringTrue iff the animator is currently globally paused.
True while the animator is currently executing an animation tick. Useful
for adapter wrappers (e.g. animateOnSetPose) that need to detect
"this setPose was called from inside another animation's onTick"
(momentum decay, in-flight tween, spring) and avoid recursively
scheduling a new wrap-animation that would fight the caller.
Keep the animator's RAF loop running until the returned cancel
function is called. Use for animations whose effect is read on every
frame but which don't have a natural progress state (e.g.
cycleVertexColors, which expresses its current value as a function
of performance.now() rather than as a tween from from to to).
Without a keep-alive entry the loop would idle and onTick would
stop firing even though the override is still installed.
Loop primitive: repeatedly invoke factory to produce a child animation.
The factory must wire its returned handle's onDone to call next so
the loop advances. Returns a handle whose pause/resume/setTimeScale/cancel
delegate to the current in-flight child (and prevent future iterations
on cancel).
The loop is registered with the animator under a supervisor entry so
animator.cancel(handle), animator.cancelKey(opts.cancelKey), and
animator.isActive(opts.cancelKey) all work for it.
Optionalopts: LoopOptionsSubscribe to a callback fired once per RAF frame while any animation is
active. Returns an unsubscribe function. Used by consumers (typically
<SceneCanvas>) that need to repaint when an animation's side-effect
is read from a non-scene channel (e.g. colorOverrides consulted from
a custom drawOne) — scene mutations naturally trigger a repaint, but
colorOverrides writes do not.
The callback fires AFTER the per-frame tick of each registered
animation, so by the time it runs colorOverrides.get(...) returns
the latest values. If no animations are active, no tick fires.
Freeze every animation managed by this animator.
Freeze every animation whose cancelKey matches.
Unified spring/decay primitive. With to set, behaves as a spring;
with to: null, behaves as a velocity-driven decay. Supports
mid-flight retargeting via the returned handle's setTarget.
Resume every animation managed by this animator.
Resume every animation whose cancelKey matches.
Multiply every animation's virtual-clock rate by scale. 1 = normal.
Set per-animation timeScale for every animation whose cancelKey matches.
Stagger primitive: schedule a per-item animation, offset by delay ms
per index (or a custom function of the index). Two forms:
factory directly, returns a composite
AnimationHandle.factory, get a StaggerBuilder for fluent
.each / .tween / .springPose calls.The composite handle's cancel cancels pending timers AND in-flight
children. pause / resume / setTimeScale propagate to in-flight
children; pause/resume also freeze and thaw pending per-item timers
(the remaining time before each pending fire is preserved across the
pause).
The stagger is registered with the animator under a supervisor entry so
animator.cancel(handle), animator.cancelKey(opts.cancelKey), and
animator.isActive(opts.cancelKey) all work for it.
Optionalopts: StaggerOptionsSugar over loop for the common case of looping a tween between two
values with optional direction handling (restart | reverse |
alternate). Registered with the animator like loop.
Per-node, per-channel color override registry consulted by the renderer's path layer before reading consumer accessors. Used by
tweenVertexColors,springVertexColors,cycleVertexColors,staggerVertexColors. Cleared automatically on animator unmount.