API Reference › Tween
namespace

Tween

Value interpolation over a timeline, off the fixed frame clock. The timeline helpers Tween.progress/Tween.loop/Tween.yoyo turn an elapsed timer and a duration into a normalized amount; Tween.ease shapes that amount through an easing curve (shared with Ease); and the typed blends Tween.number/Tween.round/Tween.point/Tween.tint interpolate a fixed, int, Vector, or color. All deterministic fixed-point, so a replay reproduces every eased value exactly. Beyond these pure interpolators there are fluent handles the engine advances for you: Tween.to starts one and returns a handle, Tween.chain and Tween.delay sequence more segments, and Tween.value / Tween.done / Tween.parallel / Tween.stop read and control them.

Tween.progress(timer, duration) -> fixedA one-shot 0..1 amount, clamped, for timer over duration.Tween.loop(timer, duration) -> fixedA repeating 0..1 sawtooth amount over duration.Tween.yoyo(timer, duration) -> fixedA repeating 0..1..0 triangle amount over duration.Tween.done(timer, duration) -> boolTrue once a one-shot tween's timer reaches its duration.Tween.ease(t, mode) -> fixedShape a 0..1 amount through an easing curve chosen by a literal mode.Tween.number(from, to, t) -> fixedLinear blend of two fixeds by amount t.Tween.round(from, to, t) -> intLinear blend of two ints by amount t, rounded to the nearest int.Tween.point(from, to, t) -> VectorComponent-wise blend of two Vectors by amount t.Tween.tint(from, to, t) -> intPer-channel blend of two colors by amount t.Tween.to(from, to, dur, ease) -> handleStart a fluent, engine-advanced tween and return a handle.Tween.chain(handle, to, dur, ease) -> handleAppend a tween segment that runs after the handle's current queue.Tween.delay(handle, ticks) -> handleAppend a pause to a tween handle's sequence.Tween.value(handle) -> intThe current value of a fluent tween handle this frame.Tween.stop(handle)Stop and dispose a tween handle, freezing its value.Tween.parallel(a, b) -> boolAre two tween handles both finished? — a parallel completion query.
← All symbols