API reference

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

C

classTileSet

@codexo/exojs-tilemap / tilemap / stable

A resolved tileset: a uniform grid of tiles within a texture atlas. Does **not** own its texture - the Loader or application code retains texture ownership. Tileset dimensions are validated at construction and frozen thereafter. Multiple tilesets are supported per TileMap; each carries its own tile dimensions, spacing, and optional per-tile metadata.

13
props
4
methods
0
events
Import
import { TileSet } from '@codexo/exojs-tilemap'

A resolved tileset: a uniform grid of tiles within a texture atlas.

Does **not** own its texture - the Loader or application code retains texture ownership. Tileset dimensions are validated at construction and frozen thereafter.

Multiple tilesets are supported per TileMap; each carries its own tile dimensions, spacing, and optional per-tile metadata.

Constructors1
Methods4
Iterate over all defined tiles (sparse).
Retrieve per-tile metadata, or undefined if none defined.
getTileRect(localTileId: number): { height: number; width: number; x: number; y: number }
Compute the pixel-space source rectangle for a local tile ID within the atlas, accounting for columns, spacing, and margin.
Replace all tile definitions with the given array. Each entry's properties are copied and frozen. Part of the tilemap SDK contract for extension packages that build tilesets programmatically.
Properties13
class: string
Tileset class/type string (Tiled class; may be empty).
columns: number
Number of columns in the atlas grid.
margin: number
Pixel margin around the atlas.
name: string
Stable runtime name.
offsetX: number
Visual drawing offset X in pixels (Tiled tileoffset). Applied by the tile-layer geometry builder and by the tile-collision helpers - i.e. wherever this package places a tile on a grid. It is **not** folded into a TileObject's x/y: object layers are data-only, so code that draws a tile object itself has to add this offset the way a tile layer would.
offsetY: number
Visual drawing offset Y in pixels (Tiled tileoffset) - see offsetX for where it applies.
rows: number
Number of rows implied by tileCount and columns.
spacing: number
Pixel spacing between tiles in the atlas.
tileCount: number
Total number of tiles in the tileset.
tileHeight: number
Tile height in pixels.
tileWidth: number
Tile width in pixels.
Read-only snapshot of all per-tile definitions. The returned record is a caller-owned copy.
Source