Skip to main content

Interface: TweenStepper

Defined in: tween/stepper.ts:11

A non-generator animation driver. advance(dt) moves the animation forward by dt seconds and returns true once it has completed (and applied its final value). It must be primed at t=0 before the first advance so the starting frame is correct — callers apply the initial value via seek(0).

This is the flat alternative to a FrameGenerator: parallel can drive a batch of steppers in one tight loop with zero generator resumes per item, which matters when hundreds of node tweens run simultaneously.

Methods

advance()

advance(dt): boolean

Defined in: tween/stepper.ts:22

Advance the animation by dt seconds.

Parameters

dt

number

Returns

boolean

true when the animation has finished and its final value has been applied; false if it is still running.


seek()

seek(elapsed): void

Defined in: tween/stepper.ts:16

Jump to the value corresponding to elapsed seconds from the start. Call with 0 to prime the stepper before the first advance.

Parameters

elapsed

number

Returns

void