API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceTileMapOptions
@codexo/exojs-tilemap / tilemap / stable
Options for constructing a TileMap.
16
props
0
methods
0
events
Import
import { TileMapOptions } from '@codexo/exojs-tilemap'Options for constructing a TileMap.
Properties16
backgroundColor?: null | numberMap background colour as a 0xRRGGBB integer, or null (Tiled backgroundcolor). Informational - the renderer does not auto-clear to it. Default null.
chunkHeight?: numberChunk height for layers (default 32).
chunkWidth?: numberChunk width for layers (default 32).
class?: stringMap class/type string (Tiled class). Defaults to ''.
documentOrder?: readonly number[]Combined document order across tile and image layers, as an ordered list of layer ids - exposed via TileMap.renderableLayers. Every tile and image layer passed to this map (via layers / imageLayers) must appear exactly once; an id that belongs to neither kind, or is listed more than once, throws. The list's length must also equal the total number of tile/image layer instances - nothing enforces unique ids across image layers, so two image layers sharing an id would otherwise both satisfy the id-based checks while one silently drops out of TileMap.renderableLayers; that mismatch throws too. A tile layer and an image layer sharing the same id makes the order ambiguous - that combination throws when documentOrder is provided. It is NOT rejected when this option is omitted: the fallback order below is unambiguous by construction (tile layers are always listed before image layers), so hand-built maps that predate this option are unaffected even if such an id collision exists. Omit to fall back to all tile layers in insertion order, followed by all image layers in insertion order - the map's implicit ordering before this option existed. Named documentOrder rather than renderOrder to avoid colliding with the unrelated renderOrder option above (Tiled's tile-draw- direction string, e.g. 'right-down').
height?: numberMap height in tiles. Must be provided iff width is.
Image layers (data-only; background/foreground images from Tiled image layers).
Layers (constructed externally and owned by the map after construction).
name?: stringMap name (for debugging).
objectLayers?: readonly ObjectLayerA data-only layer of TileMapObjects - spawn points, trigger zones, collision regions, markers. Object layers are not rendered by the tile renderer; they are pa…<ObjectSchemaA developer-declared mapping from object `type`/class strings to the property shape an object of that type is expected to carry. Supplied as the type parameter…>[]Object layers (data-only; spawn points, triggers, collision regions).
Map-level properties (copied and frozen).
renderOrder?: stringTile draw order (Tiled renderorder), informational. Default 'right-down'.
tileHeight: numberHeight of each tile in pixels.
Tilesets available to this map.
tileWidth: numberWidth of each tile in pixels.
width?: numberMap width in tiles. Omit together with height for an unbounded map - layers you add are then free to be unbounded too (this option does not constrain per-layer dimensions either way).
Source