API reference

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

C

classTileMapView

@codexo/exojs-tilemap / tilemap / stable

Groups a TileMap's layers into independently placeable scene nodes so application actors can be interleaved **between** tile layers. A view produces exactly one canonical TileLayerNode per map layer (stable identity, map document order) and, optionally, named TileMapBands grouping subsets of those nodes. The application parents the bands / layer nodes wherever it wants — typically as siblings of its own actor containers: ```ts const view = map.createView({ bands: { ground: ['background', 'ground'], roof: ['roofs'] } }); worldRoot.addChild(view.band('ground'), actors, view.band('roof')); // or without bands: worldRoot.addChild(view.getLayerNodeById(groundId)!, actors, view.getLayerNodeById(roofId)!); ``` **Actors are application-owned siblings.** A `TileMapView` never adopts or destroys actors. The view is a helper, not a scene node — it does not own the world container, the TileMap, the TileLayers, or tileset textures. **Ownership:** the view owns its generated layer nodes and bands. A layer assigned to a band is owned by that band; an unbanded layer is owned by the view directly. TileMapView.destroy destroys every band and layer node (detaching them from their application parents) but leaves actors, the map, its layers, and Loader-owned textures untouched. There is no map-replacement mutation API: to swap maps, destroy the old view, construct a new one, and re-parent its bands — the actor tree is never involved.

5
props
6
methods
0
events
Import
import { TileMapView } from '@codexo/exojs-tilemap'

Groups a TileMap's layers into independently placeable scene nodes so application actors can be interleaved **between** tile layers.

A view produces exactly one canonical TileLayerNode per map layer (stable identity, map document order) and, optionally, named TileMapBands grouping subsets of those nodes. The application parents the bands / layer nodes wherever it wants — typically as siblings of its own actor containers:

```ts const view = map.createView({ bands: { ground: ['background', 'ground'], roof: ['roofs'] } }); worldRoot.addChild(view.band('ground'), actors, view.band('roof')); // or without bands: worldRoot.addChild(view.getLayerNodeById(groundId)!, actors, view.getLayerNodeById(roofId)!); ```

**Actors are application-owned siblings.** A `TileMapView` never adopts or destroys actors. The view is a helper, not a scene node — it does not own the world container, the TileMap, the TileLayers, or tileset textures.

**Ownership:** the view owns its generated layer nodes and bands. A layer assigned to a band is owned by that band; an unbanded layer is owned by the view directly. TileMapView.destroy destroys every band and layer node (detaching them from their application parents) but leaves actors, the map, its layers, and Loader-owned textures untouched. There is no map-replacement mutation API: to swap maps, destroy the old view, construct a new one, and re-parent its bands — the actor tree is never involved.

Constructors 1
new(map: TileMap, options?: TileMapViewOptions): TileMapView
Methods 6
band(name: string): TileMapBand
destroy(): void
getLayerNodeById(id: number): TileLayerNode | undefined
getLayerNodesByName(name: string): readonly TileLayerNode[]
hasBand(name: string): boolean
refreshLayers(): this
Properties 5
bands: readonly TileMapBand[]
destroyed: boolean
layers: readonly TileLayerNode[]
map: TileMap
pixelSnapMode: PixelSnapMode
Source