generateTweenRepeatTween

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

Creates a system that restarts concrete tweens marked with TweenRepeat.

The returned system queries for the supplied concrete Tween constructor and the repeat marker. When a matching tween has timeTaken >= duration, it sets timeTaken to 0. It does not inspect the tween’s repeat boolean, preserve an overshoot, or advance the timer; the generated timer system handles advancement separately.

Examples

const repeatSystem = generateTweenRepeatTween(Position2DTween)
repeatSystem(world) // resets matching tweens at their duration

Type Parameters

T

Parameters

NameDescriptionDefault
tween

Concrete tween constructor to query.

—

Returns

World system that resets completed marked tweens.