Interface Map

Tiled map. This is the root type in a Tiled JSON file.

interface Map {
    backgroundcolor?: string;
    class?: string;
    compressionlevel: number;
    editorsettings?: unknown;
    height: number;
    hexsidelength?: number;
    infinite: boolean;
    layers: AnyLayer[];
    nextlayerid: number;
    nextobjectid: number;
    orientation: MapOrientation;
    parallaxoriginx?: number;
    parallaxoriginy?: number;
    properties?: AnyProperty[];
    renderorder: RenderOrder;
    staggeraxis?: StaggerAxis;
    staggerindex?: StaggerIndex;
    tiledversion: string;
    tileheight: number;
    tilesets?: AnyTileset[];
    tilewidth: number;
    type: "map";
    version: string;
    width: number;
}

Properties

backgroundcolor?: string

Optional background color.

class?: string

Optional class of the map.

compressionlevel: number

The compression level to use for tile layer data. Defaults to -1, which means to use the algorithm default.

editorsettings?: unknown

Irrelevant editor-specific settings.

height: number

Number of tile rows.

hexsidelength?: number

Length of the side of a hex tile in pixels. Only set for hexagonal maps.

infinite: boolean

Whether the map has infinite dimensions.

layers: AnyLayer[]

Array of layers.

nextlayerid: number

Auto-increments for each layer.

nextobjectid: number

Auto-increments for each placed object.

orientation: MapOrientation

The map orientation.

parallaxoriginx?: number

X coordinate of the parallax origin in pixels. 0 if not set.

parallaxoriginy?: number

Y coordinate of the parallax origin in pixels. 0 if not set.

properties?: AnyProperty[]

Array of properties. Empty if not set.

renderorder: RenderOrder

The map render order.

staggeraxis?: StaggerAxis

The stagger axis. Only set for staggered / hexagonal maps.

staggerindex?: StaggerIndex

The stagger index. Only set for staggered / hexagonal maps.

tiledversion: string

The Tiled version used to save the file.

tileheight: number

Map grid height.

tilesets?: AnyTileset[]

Array of tilesets. Empty if not set.

tilewidth: number

Map grid width.

type: "map"

Always "map".

version: string

The JSON format version.

width: number

Number of tile columns.

Generated using TypeDoc