API reference

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

C

classTileAnimator

@codexo/exojs-tilemap / tilemap / stable

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. 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.

2
props
4
methods
0
events
Import
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.

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.

Constructors 1
new(layers: TileLayer | readonly TileLayer[]): TileAnimator
Methods 4
destroy(): void
rescan(): void
reset(): void
update(deltaSeconds: number): void
Properties 2
animatedCellCount: number
elapsedMs: number
Source