API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classTileLayer
A generic, format-independent tile layer with chunk-first storage. Tile data is stored in fixed-size TileChunks indexed by signed chunk coordinates. For finite maps, only chunks that intersect the layer bounds exist. **Mutation must go through the layer's public APIs only.** `setTileAt` / `clearTileAt` validate coordinates, tileset references, and increment revision counters only when the stored value actually changes. Direct chunk mutation is not supported — the layer owns chunk storage and exposes only a ReadonlyTileChunk view. The layer is NOT a SceneNode — that integration lives in the future renderer slice.
import { TileLayer } from '@codexo/exojs-tilemap' A generic, format-independent tile layer with chunk-first storage.
Tile data is stored in fixed-size TileChunks indexed by signed chunk coordinates. For finite maps, only chunks that intersect the layer bounds exist.
**Mutation must go through the layer's public APIs only.** `setTileAt` / `clearTileAt` validate coordinates, tileset references, and increment revision counters only when the stored value actually changes. Direct chunk mutation is not supported — the layer owns chunk storage and exposes only a ReadonlyTileChunk view.
The layer is NOT a SceneNode — that integration lives in the future renderer slice.
new(options: TileLayerOptions): TileLayer chunkRange(): object clearRect(x: number, y: number, w: number, h: number): void clearTileAt(tx: number, ty: number): void countNonEmptyTiles(): number destroy(): void fillRect(x: number, y: number, w: number, h: number, tile: ResolvedTile): void getChunk(cx: number, cy: number): ReadonlyTileChunk | undefined getRawTileAt(tx: number, ty: number): number getTileAt(tx: number, ty: number): ResolvedTile | null inBounds(tx: number, ty: number): boolean loadedChunks(): IterableIterator<ReadonlyTileChunk> pixelToTile(px: number, py: number): object setTileAt(tx: number, ty: number, tile: ResolvedTile): void tilesInRect(x: number, y: number, w: number, h: number): Generator<object> tileToPixel(tx: number, ty: number): object chunkHeight: number chunkWidth: number height: number id: number name: string offsetX: number offsetY: number opacity: number properties: TileProperties tileHeight: number tilesets: readonly TileSet[] tileWidth: number visible: boolean width: number destroyed: boolean pixelHeight: number pixelWidth: number revision: number