Examples
const updateSystem = generateTweenUpdateSystem(
Position2D,
Position2DTween,
(from, to, progress, out) => out.set(from, to, progress)
)Function
generateTweenUpdateSystem<T>(component: object, tween: typeof Tween, interpolate: TweenLerp<T>): SystemFuncCreates a system that interpolates a component from a concrete tween.
The returned system queries entities containing both component and the
supplied concrete Tween constructor. For each match it computes
tween.easing(tween.timeTaken / tween.duration) and calls interpolate
with from, to, the eased progress, and the live component as its output
value. This helper does not advance time, clamp progress, or handle a zero
duration; JavaScript’s division result is passed to the easing function.
const updateSystem = generateTweenUpdateSystem(
Position2D,
Position2DTween,
(from, to, progress, out) => out.set(from, to, progress)
)