API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classTileMap
A generic, format-independent tile map. Owns a finite grid of TileLayers and a shared set of TileSets. Tile data is stored in compact chunked arrays — no per-tile heap objects. The map does NOT own tileset textures (those are Loader-owned) and does NOT own SceneNode children (the future TileMapNode will own those). Multiple tilesets are supported: each cell stores a packed tileset index and local tile ID, so different tilesets may have different tile dimensions.
import { TileMap } from '@codexo/exojs-tilemap' A generic, format-independent tile map.
Owns a finite grid of TileLayers and a shared set of TileSets. Tile data is stored in compact chunked arrays — no per-tile heap objects.
The map does NOT own tileset textures (those are Loader-owned) and does NOT own SceneNode children (the future TileMapNode will own those).
Multiple tilesets are supported: each cell stores a packed tileset index and local tile ID, so different tilesets may have different tile dimensions.
new(options: TileMapOptions): TileMap addLayer(layer: TileLayer): void addTileset(tileset: TileSet): void clearTileAt(layerId: number, tx: number, ty: number): void createView(options?: TileMapViewOptions): TileMapView destroy(): void getLayerById(id: number): TileLayer | undefined getLayerByName(name: string): TileLayer | undefined getTileAt(layerId: number, tx: number, ty: number): ResolvedTile | null getTileLayer(name: string): TileLayer | undefined getTileset(name: string): TileSet | undefined pixelToTile(px: number, py: number): object removeLayer(id: number): boolean setTileAt(layerId: number, tx: number, ty: number, tile: ResolvedTile): void tileToPixel(tx: number, ty: number): object chunkHeight: number chunkWidth: number height: number name: string properties: TileProperties tileHeight: number tileWidth: number width: number destroyed: boolean layers: readonly TileLayer[] pixelHeight: number pixelWidth: number revision: number tilesets: readonly TileSet[]