API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classTileMapView
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. **Image layers.** A view also produces exactly one canonical ImageLayerNode per TileMap.imageLayers entry (stable identity, map document order), reachable through imageLayerNodes, getImageLayerNodeById, and getImageLayerNodeByName. Image layers are selectable in TileMapViewOptions.bands exactly like tile layers: a band member list may mix both kinds, and the band stacks its members by the map's combined document order (import('./TileMap').TileMap.renderableLayers). A banded image node is owned by its band; an unbanded one is owned by the view directly, and the application parents it wherever the image belongs in draw order - the same way actors are interleaved.
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.
**Image layers.** A view also produces exactly one canonical ImageLayerNode per TileMap.imageLayers entry (stable identity, map document order), reachable through imageLayerNodes, getImageLayerNodeById, and getImageLayerNodeByName. Image layers are selectable in TileMapViewOptions.bands exactly like tile layers: a band member list may mix both kinds, and the band stacks its members by the map's combined document order (import('./TileMap').TileMap.renderableLayers). A banded image node is owned by its band; an unbanded one is owned by the view directly, and the application parents it wherever the image belongs in draw order - the same way actors are interleaved.
destroy(): voidgetImageLayerNodeById(id: number): ImageLayerNodeA scene node that renders one Tiled ImageLayer as a single RepeatingSprite wrapped in a Container. The layer's pixel `offset` becomes this node's position; `pa… | undefinedgetImageLayerNodeByName(name: string): ImageLayerNodeA scene node that renders one Tiled ImageLayer as a single RepeatingSprite wrapped in a Container. The layer's pixel `offset` becomes this node's position; `pa… | undefinedgetLayerNodesByName(name: string): readonly TileLayerNodeA scene node that renders one generic TileLayer as a Container of per-chunk TileChunkNode drawables. Each non-empty loaded chunk becomes one child positioned a…[]hasBand(name: string): booleanrefreshLayers(): thisdestroyed: boolean