API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classAnimationSystem

@codexo/exojs / animation / stable

Owns and advances the AnimatedSprites whose frame playback is currently running, driving them once per frame from Application.update - the SystemMethods.preFrame phase, at SystemOrder.CoreAnimation. Registration is automatic and requires no user wiring: an AnimatedSprite registers itself here as soon as it is both *playing* and *attached* to a scene tree owned by an Application, and deregisters on `stop()`/`pause()`, on clip completion, on detach from the tree, and on `destroy()`. A sprite that is never attached to a tree (e.g. one drawn immediate-mode via `context.render(sprite)`) is never registered, and must be ticked by hand with AnimatedSprite.update - which stays public exactly for that case. Update iteration uses a snapshot so `onFrame`/`onComplete` handlers may freely play, stop, add or destroy sprites during the same frame without corrupting the loop.

1
props
6
methods
0
events
Import
import { AnimationSystem } from '@codexo/exojs'

Owns and advances the AnimatedSprites whose frame playback is currently running, driving them once per frame from Application.update - the SystemMethods.preFrame phase, at SystemOrder.CoreAnimation.

Registration is automatic and requires no user wiring: an AnimatedSprite registers itself here as soon as it is both *playing* and *attached* to a scene tree owned by an Application, and deregisters on `stop()`/`pause()`, on clip completion, on detach from the tree, and on `destroy()`. A sprite that is never attached to a tree (e.g. one drawn immediate-mode via `context.render(sprite)`) is never registered, and must be ticked by hand with AnimatedSprite.update - which stays public exactly for that case.

Update iteration uses a snapshot so `onFrame`/`onComplete` handlers may freely play, stop, add or destroy sprites during the same frame without corrupting the loop.

Constructors1
new(): AnimationSystem
Methods6
Register sprite so it is advanced once per frame. Idempotent, and a no-op for a destroyed sprite or a destroyed system. Called automatically by AnimatedSprite; there is no need to call it by hand.
clear(): this
Deregister every sprite immediately. Playback state is left as-is - the sprites are simply no longer advanced by this system.
destroy(): void
Tear down the system. Deregisters every sprite and makes subsequent updates no-ops.
Advance every registered sprite by the frame delta, converted to seconds at this single point of use. Sprites destroyed since the last frame are evicted rather than ticked, so a destroyed node can never be driven after teardown. Iterates a snapshot so playback callbacks that register or deregister sprites do not corrupt the loop.
Properties1
size: number
Number of sprites currently registered for per-frame advancement.
Source