Class: TMXTileset

me. TMXTileset

new TMXTileset(tileset)

a TMX Tile Set Object
Parameters:
Name Type Description
tileset Object tileset data in JSON format (http://docs.mapeditor.org/en/stable/reference/tmx-map-format/#tileset)
Source:
TMXTileset.js, line 23

Extends

Classes

Error

Members

isAnimated :Boolean

Tileset contains animated tiles
Type:
  • Boolean
Source:
TMXTileset.js, line 62

isCollection :Boolean

true if the tileset is a "Collection of Image" Tileset
Type:
  • Boolean
Source:
TMXTileset.js, line 70

Methods

contains(gid) → {Boolean}

return true if the gid belongs to the tileset
Parameters:
Name Type Description
gid Number
Source:
TMXTileset.js, line 194
Returns:
Type
Boolean

getTileImage(gid) → {Image}

return the tile image from a "Collection of Image" tileset
Parameters:
Name Type Description
gid Number
Source:
TMXTileset.js, line 171
Returns:
corresponding image or undefined
Type
Image

getTileProperties(tileId) → {Object}

return the properties of the specified tile
Parameters:
Name Type Description
tileId Number
Source:
TMXTileset.js, line 227
Returns:
Type
Object

getViewTileId(gid) → {Number}

Get the view (local) tile ID from a GID, with animations applied
Parameters:
Name Type Description
gid Number Global tile ID
Source:
TMXTileset.js, line 206
Returns:
View tile ID
Type
Number