API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classChunkStreamer
Drives TileLayer._adoptChunk/TileLayer._evictChunk calls from a View's position: chunks near the view are requested from a ChunkSource and installed; chunks that scroll far enough away are evicted. Works on both unbounded and bounded layers (a bounded-but-large layer still benefits from not keeping every chunk resident at once) - for a bounded layer, the wanted range is clamped to TileLayer.chunkRange. Touches only the TileLayer data layer - import('./TileLayerNode').TileLayerNode reacts to `_adoptChunk`/`_evictChunk` on its own via a structural listener, so this class has no rendering dependency and no reference to any scene node. Tracks its own resident set (chunks *this instance* has loaded), never touching chunks that predate its attachment or were installed by another source. Tick it from your update loop, like import('./TileAnimator').TileAnimator: ```ts const streamer = new ChunkStreamer(layer, mySource, view); scene.systems.add({ update: () => streamer.update() }); ```
import { ChunkStreamer } from '@codexo/exojs-tilemap'Drives TileLayer._adoptChunk/TileLayer._evictChunk calls from a View's position: chunks near the view are requested from a ChunkSource and installed; chunks that scroll far enough away are evicted. Works on both unbounded and bounded layers (a bounded-but-large layer still benefits from not keeping every chunk resident at once) - for a bounded layer, the wanted range is clamped to TileLayer.chunkRange.
Touches only the TileLayer data layer - import('./TileLayerNode').TileLayerNode reacts to `_adoptChunk`/`_evictChunk` on its own via a structural listener, so this class has no rendering dependency and no reference to any scene node.
Tracks its own resident set (chunks *this instance* has loaded), never touching chunks that predate its attachment or were installed by another source.
Tick it from your update loop, like import('./TileAnimator').TileAnimator:
```ts const streamer = new ChunkStreamer(layer, mySource, view); scene.systems.add({ update: () => streamer.update() }); ```
new(layer: 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…, source: ChunkSourceSupplies chunk data for one import('./TileLayer').TileLayer on demand, keyed by signed chunk coordinates - the abstraction a import('./ChunkStreamer').ChunkStr…, view: View2D camera that defines what region of the world is visible on screen. Maintains a center position, a visible area size, a rotation, and an optional zoom level.…, options?: ChunkStreamerOptionsOptions for a ChunkStreamer. All optional.): ChunkStreamerdestroy(): voidupdate(): voidresidentCount: number