generateTweenTimerSystem

View sourcegenerateTweenTimerSystem<T>(tween: typeof Tween): SystemFunc

Creates a system that advances the elapsed time of a concrete tween type.

Each time the returned system runs, it reads the current delta from the world’s VirtualClock once, then updates every entity containing the supplied Tween constructor with Math.min(timeTaken + delta, duration). It does not require repeat or flip markers, reset time, update finish, or apply easing. The assignment is an upper cap only; negative deltas are not clamped to zero. The returned system requires a VirtualClock resource; a missing clock makes its resource lookup fail.

Examples

const timerSystem = generateTweenTimerSystem(Position2DTween)
app.registerSystem({ schedule: AppSchedule.Update, system: timerSystem })

Type Parameters

T

Parameters

NameDescriptionDefault
tween

Concrete tween constructor to query.

—

Returns

World system that advances and caps tween time.