API reference

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

N

namespaceTiled Functions

@codexo/exojs-tiled / tiled / stable

Free functions and constants exported from @codexo/exojs-tiled.

5
props
4
methods
0
events
Overview

Free functions and constants exported from @codexo/exojs-tiled. Import any of them directly, for example `import { createTiledLayer } from '@codexo/exojs-tiled'`.

Functions4
getTiledObjectAnchorOffset(alignment: TiledResolvedObjectAlignmentA TiledObjectAlignment with Tiled's orientation-dependent default already applied., width: number, height: number): { x: number; y: number }
Offset of a tile object's stored x/y anchor from the top-left corner of its width × height bounding box, for an already-resolved alignment. Subtract this from the stored position to obtain the corner: cornerX = object.x - offset.x.
Resolve a tileset's objectalignment into a concrete alignment for tile objects on a map of the given orientation. Tiled's default ('unspecified', and an absent field) is orientation dependent: 'bottom' on an isometric map and 'bottomleft' on every other orientation, including staggered and hexagonal.
Best-effort conversion of a TiledWangSetData to a runtime WangSet from @codexo/exojs-tilemap. ## Supported types - **'corner'** - Maps the four corner positions of each wangtile to the four corner bits of the 8-bit blob mask and returns a WangSet of type 'blob'. Only color index > 0 in the Tiled wangid is treated as "this terrain"; color index 0 means unset (not this terrain). Tiled corner wangid position → WangSet blob bit mapping: - wangid[7] (top-left) → bit 0 (value 1) - wangid[1] (top-right) → bit 2 (value 4) - wangid[5] (bottom-left) → bit 5 (value 32) - wangid[3] (bottom-right) → bit 7 (value 128) This is a best-effort conversion accurate for the common **single-color** corner terrain (blob-style). Multi-color terrains are accepted but only the presence/absence of any color (> 0 = set) is used; which specific color is set is ignored. - **'edge'** - Maps the four edge positions to the 4-bit edge mask and returns a WangSet of type 'edge'. Tiled edge wangid position → WangSet edge bit mapping: - wangid[0] (top) → bit 0 (value 1) - wangid[2] (right) → bit 1 (value 2) - wangid[4] (bottom) → bit 2 (value 4) - wangid[6] (left) → bit 3 (value 8) - **'mixed' / unknown** - Returns null; mixed wangsets interleave corner and edge semantics in a way that cannot be faithfully represented by a single blob or edge mask without additional heuristics.
Constants5
Default immutable Tiled extension descriptor. Installs two asset types: - tileMapType - loader.load(tileMapType.asset('world.tmj')) returns a format-independent runtime TileMap (common case). - tiledSourceType - loader.load(tiledSourceType.asset('world.tmj')) returns the raw parsed TiledMap source model (advanced/diagnostic). Depends on tilemapExtension so that snapshot construction always materialises the generic tilemap runtime before the Tiled adapter. Pass it to the application that should have it via ApplicationOptions.extensions.