Documentation
    Preparing search index...

    Class AnimationSystem

    Advances every tracked animation player once per fixed step (§39 step 3).

    Explicit registration, exactly as MotionSystem tracks nodes: a player is advanced because AnimationSystem.track was called with it. A tween does not attach itself to a system — it has no way to know which system, or which application, should own it — so play() starts a tween and track() makes something move it.

    After advancing a player the system drops it if it is finished or "stopped", because those are precisely the states from which advance can never do anything again:

    state advance does tracked after the step
    "running" animates yes
    "paused" nothing yes — resume() revives it
    "idle" nothing yes — play() revives it
    "finished" nothing no
    "stopped" nothing no

    Keeping a finished tween would cost a call per step forever and hold its target alive; dropping a paused or idle one would silently break the two legitimate ways of resuming. A finished player is not stopped by the system: it keeps its values and can still be scrubbed with seek, and a caller that wants its §16 property claims released calls stop() itself.

    The tracked set is a Set iterated live, mirroring MotionSystem (a snapshot would allocate every step). The consequences, which are Set semantics: a player untracked during the step — including by the system's own auto-untracking, and by an onComplete callback — is not advanced again in that step, and one tracked during the step is advanced in the same step. Track and untrack outside the step if that distinction matters.

    Implements

    Index
    priority: number

    Execution order key (§39); default PRIORITY_ANIMATION_TARGETS.

    • get disposed(): boolean

      Whether AnimationSystem.dispose has run. Disposal is terminal (§83): a disposed system refuses its mutating entry points with INVALID_APPLICATION_STATE (§89) rather than silently working.

      Returns boolean

    • get items(): IterableIterator<Advanceable>

      Tracked players, in the order they will be advanced.

      Returns IterableIterator<Advanceable>

    • get size(): number

      Number of tracked players.

      Returns number

    • Stops advancing everything. The system stays registered.

      Returns void

    • Drops every tracked player (§39 teardown).

      Deliberately does not stop them: the system is a driver, not an owner, and disposing an application should not reach into animations that the application may still be scrubbing or serializing.

      Returns void

    • Advances every tracked player by one fixed step, in insertion order, then drops the ones that can never advance again (see the class documentation).

      The delta is time.fixedDeltaTime — the scaled simulation delta. The scheduler has already applied timeScale when filling its accumulator (§10: accumulator += elapsedRealTime * timeScale), so a fixed step is one fixedDeltaTime of scaled simulation time and the number of steps per frame is what timeScale changes. Multiplying by time.timeScale here would scale the same time twice, and animation would run at timeScale².

      Allocates nothing.

      Parameters

      Returns void

    • Whether item is tracked.

      Parameters

      Returns boolean

    • No per-registration setup is needed (§39).

      Returns void

    • Starts advancing item and returns it, so a player can be built, played, and tracked in one expression. Idempotent — tracking twice keeps the original position in the iteration order.

      The player need not be playing yet: an "idle" tween is advanced (a no-op) until something calls play() on it.

      Type Parameters

      Parameters

      • item: T

      Returns T

    • Stops advancing item. Returns whether it was tracked.

      Parameters

      Returns boolean