API reference

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

I

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 | number
Map background colour as a 0xRRGGBB integer, or null (Tiled backgroundcolor). Informational - the renderer does not auto-clear to it. Default null.
chunkHeight?: number
Chunk height for layers (default 32).
chunkWidth?: number
Chunk width for layers (default 32).
class?: string
Map 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?: number
Map height in tiles. Must be provided iff width is.
name?: string
Map name (for debugging).
renderOrder?: string
Tile draw order (Tiled renderorder), informational. Default 'right-down'.
tileHeight: number
Height of each tile in pixels.
tileWidth: number
Width of each tile in pixels.
width?: number
Map 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