Skip to content

Tween

const Tween: object

Defined in: Tween.ts:10

Static factory for creating tween Processes.

custom(setter, from, to, duration, easing?): Process

Tween using a custom setter. duration is in seconds, finite and > 0; both endpoints must be finite.

(value) => void

number

number

number

EasingFunction = easeLinear

Process

stagger<T>(items, factory, stepSeconds): Process[]

Map a Process factory over an array, staggering each item’s START by stepSeconds (item 0 starts immediately, item 1 after stepSeconds, and so on). Returns one Process per item — enqueue them all on a process queue (or useSplitText’s run) to play a staggered cascade across a split text’s chars / words / lines. The factory runs when each item’s turn begins, so a Tween.to built inside it reads its from value at start time, not build time.

stepSeconds must be finite and >= 0. Zero is allowed and starts every item at once.

T

readonly T[]

(item, index) => Process

number

Process[]

to(target, property, to, duration, easing?): Process

Tween a numeric property on a target object. duration is in seconds, finite and > 0; both endpoints must be finite.

Record<string, number>

string

number

number

EasingFunction = easeLinear

Process

vec2(setter, from, to, duration, easing?): Process

Tween a Vec2 value. duration is in seconds, finite and > 0; both endpoints must be finite.

(value) => void

Vec2Like

Vec2Like

number

EasingFunction = easeLinear

Process

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/core.md.