TilesetData

A TilesetData maps GIDs (Global IDentifiers) to tiles.

Each tileset has a range of GIDs that map to the tiles it contains. This range starts at firstGid and extends to the firstGid of the next tileset. The index of a tile within a tileset is given by tile.gid - tileset.firstGid. A tileset uses its image as a 'tile atlas' and may specify per-tile properties.

Members

Functions

tileCol
int tileCol(TiledGid gid)

Find the grid position of a tile within this tileset.

tileOffsetX
int tileOffsetX(TiledGid gid)

Find the pixel position of a tile within this tileset.

tileOffsetY
int tileOffsetY(TiledGid gid)

Find the pixel position of a tile within this tileset.

tileProperties
string[string] tileProperties(TiledGid gid)

Find the properties defined for a tile in this tileset.

tileRow
int tileRow(TiledGid gid)

Find the grid position of a tile within this tileset.

Mixins

__anonymous
mixin JsonizeMe
Undocumented in source.

Properties

numCols
int numCols [@property getter]

Number of tile rows in the tileset

numRows
int numRows [@property getter]

Number of tile rows in the tileset

numTiles
int numTiles [@property getter]

Total number of tiles defined in the tileset

Variables

firstGid
TiledGid firstGid;

The GID that maps to the first tile in this set

image
string image;

Image used for tiles in this set

imageHeight
int imageHeight;

Height of source image in pixels

imageWidth
int imageWidth;

Width of source image in pixels

margin
int margin;

Buffer between image edge and tiles (in pixels)

name
string name;

Name given to this tileset

properties
string[string] properties;

Properties assigned to this tileset

spacing
int spacing;

Spacing between tiles in image (in pixels)

tileHeight
int tileHeight;

Maximum height of tiles in this set

tileWidth
int tileWidth;

Maximum width of tiles in this set

tileproperties
string[string][string] tileproperties;

Optional per-tile properties, indexed by the relative ID as a string.

Meta