API reference

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

I

interfaceTileObject

@codexo/exojs-tilemap / tilemap / stable

A tile (GID) object carrying a resolved tile reference. `x`/`y` are the top-left corner of the bounding box, the same convention as every other object kind. Source formats that anchor a tile object elsewhere normalise to the corner on import: Tiled stores the position at the tileset's `objectalignment` point (bottom-left by default on an orthogonal map, bottom-centre on an isometric one) and rotates the tile image about that point, so a non-zero TileMapObjectBase.rotation on a tile object still pivots about the source anchor rather than about `(x, y)`. The owning tileset's drawing offset (Tiled `tileoffset`, reachable as `tile.tileset.offsetX`/`offsetY`) is likewise **not** folded into `x`/`y`. Object layers are data-only, so nothing in this package draws a tile object; code that does has to add that offset itself to match how a tile layer places the same tile.

14
props
0
methods
0
events
Import
import { TileObject } from '@codexo/exojs-tilemap'

A tile (GID) object carrying a resolved tile reference.

`x`/`y` are the top-left corner of the bounding box, the same convention as every other object kind. Source formats that anchor a tile object elsewhere normalise to the corner on import: Tiled stores the position at the tileset's `objectalignment` point (bottom-left by default on an orthogonal map, bottom-centre on an isometric one) and rotates the tile image about that point, so a non-zero TileMapObjectBase.rotation on a tile object still pivots about the source anchor rather than about `(x, y)`.

The owning tileset's drawing offset (Tiled `tileoffset`, reachable as `tile.tileset.offsetX`/`offsetY`) is likewise **not** folded into `x`/`y`. Object layers are data-only, so nothing in this package draws a tile object; code that does has to add that offset itself to match how a tile layer places the same tile.

Properties14
height: number
Bounding height in px (0 for points).
id: number
Source-unique object id.
kind: "tile"
name: string
Object name (may be empty; not unique).
properties: P
Immutable custom properties.
rotation: number
Rotation in degrees, clockwise, about (x, y) - except on a TileObject, whose pivot stays at the source format's own anchor and is generally not (x, y). See TileObject for why.
source?: unknown
The raw source-format record this object was parsed from, for the rare case that needs a field this model does not carry. Adapters that keep their parsed document alive set it (LdtkEntityInstance for LDtk, TiledObject for Tiled); a procedurally built object has none. Reading it ties the code to one source format - prefer the typed fields.
sourceId?: string
Stable string identity assigned by the authoring format, when it has one. LDtk sets it to the entity iid, which is globally unique and survives re-ordering, re-export and level moves - the identity to persist in a savegame. Tiled has no such field and leaves this unset; there, id is the identity and it is unique only within its map.
type: string
Object class/type string (Tiled type/class; may be empty).
visible: boolean
Whether the object is marked visible.
width: number
Bounding width in px (0 for points).
x: number
X of the object origin in object-layer pixel space.
y: number
Y of the object origin in object-layer pixel space.
Source