API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classTileAnimator
Drives per-tile animations on one or more TileLayers, RPG-Maker style. On construction it scans the given layer(s) once and registers every cell whose tile carries an `animation` (see import('./types').TileDefinition). Each update advances a shared clock and rewrites **only** the registered animated cells, and **only** when a cell crosses a frame boundary - static tiles are never touched. Because a tile rewrite goes through `layer.setTileAt`, only the chunks that actually contain animated cells rebuild their geometry, and only on the (infrequent) frames where a boundary is crossed. The large static body of the map never rebuilds. An unbounded import('./TileLayer').TileLayer (see import('./TileLayer').TileLayer.bounded) is skipped entirely by the initial scan and reports zero animated cells for that layer, rather than sweeping every ever-loaded chunk. Streaming/procedural chunk providers that need animated tiles must drive per-chunk `TileAnimator` instances themselves (scanning only the newly-adopted chunk's tile range) - a whole-layer `TileAnimator` is not currently wired to react to chunk load/unload. Tick it from your update loop, like `TweenSequencer`: ```ts const animator = new TileAnimator(map.layers); scene.systems.add({ update: (t) => animator.update(t.deltaSeconds) }); ``` The animator references - but never owns - the layers and their tilesets; destroy only drops its own cell registry.
import { TileAnimator } from '@codexo/exojs-tilemap'Drives per-tile animations on one or more TileLayers, RPG-Maker style.
On construction it scans the given layer(s) once and registers every cell whose tile carries an `animation` (see import('./types').TileDefinition). Each update advances a shared clock and rewrites **only** the registered animated cells, and **only** when a cell crosses a frame boundary - static tiles are never touched. Because a tile rewrite goes through `layer.setTileAt`, only the chunks that actually contain animated cells rebuild their geometry, and only on the (infrequent) frames where a boundary is crossed. The large static body of the map never rebuilds.
An unbounded import('./TileLayer').TileLayer (see import('./TileLayer').TileLayer.bounded) is skipped entirely by the initial scan and reports zero animated cells for that layer, rather than sweeping every ever-loaded chunk. Streaming/procedural chunk providers that need animated tiles must drive per-chunk `TileAnimator` instances themselves (scanning only the newly-adopted chunk's tile range) - a whole-layer `TileAnimator` is not currently wired to react to chunk load/unload.
Tick it from your update loop, like `TweenSequencer`:
```ts const animator = new TileAnimator(map.layers); scene.systems.add({ update: (t) => animator.update(t.deltaSeconds) }); ```
The animator references - but never owns - the layers and their tilesets; destroy only drops its own cell registry.
new(layers: TileLayerA generic, format-independent tile layer with chunk-first storage. Tile data is stored in fixed-size TileChunks indexed by signed chunk coordinates. For finite… | readonly TileLayerA generic, format-independent tile layer with chunk-first storage. Tile data is stored in fixed-size TileChunks indexed by signed chunk coordinates. For finite…[]): TileAnimatordestroy(): voidrescan(): voidreset(): voidupdate(deltaSeconds: number): voidanimatedCellCount: numberelapsedMs: number