new TmxMap()
Object representing a tile map generated by Tiled Map Editor.
Parses the .tmx file content and facilitates the access to its data.
- Source:
Members
-
height :int
-
Number of tiles along the y-axis.
Type:
- int
- Source:
-
layers :Array
-
The different layers of the map.
Type:
- Array
- Source:
-
objectGroups :Array
-
The different groups of objects defined in the tile map.
Type:
- Array
- Source:
-
orientation :string
-
Whether the tile map is orthogonal or isometric.
Type:
- string
- Source:
-
properties :FM.TmxPropertySet
-
Custom properties of the map.
Type:
- Source:
-
tileHeight :int
-
Height of a tile.
Type:
- int
- Source:
-
tileSets :Array
-
The different tile sets of the tile map.
Type:
- Array
- Source:
-
tileWidth :int
-
Width of a tile.
Type:
- int
- Source:
-
version :string
-
Version number of the tile map.
Type:
- string
- Source:
-
width :int
-
Number of tiles along the x-axis.
Type:
- int
- Source:
Methods
-
getGidOwner(pGid) → {FM.TmxTileSet}
-
Retrieve the tile set matching the specified id. Works only after TmxTileSet has been initialized with an image.
Parameters:
Name Type Description pGid
int The gid of the tileset to retrieve. - Source:
Returns:
The tile set matching the gid provided, or null if none is found.- Type
- FM.TmxTileSet
-
getLayer(pName) → {FM.TmxLayer}
-
Retrieve a layer from its name.
Parameters:
Name Type Description pName
string Name of the layer to retrieve. - Source:
Returns:
Layer corresponding of the specified name.- Type
- FM.TmxLayer
-
getObjectGroup(pName) → {FM.TmxGroup}
-
Retrieve an object group from its name.
Parameters:
Name Type Description pName
string Name of the group to retrieve. - Source:
Returns:
Group of objects matching the given name.- Type
- FM.TmxGroup
-
getTileSet(pName) → {FM.TmxTileSet}
-
Retrieve a tile set from its name.
Parameters:
Name Type Description pName
string The name of the tile set to retrieve. - Source:
Returns:
Tile set corresponding to the given name.- Type
- FM.TmxTileSet
-
load(pSource)
-
Load the tile map and create javascript objects.
Parameters:
Name Type Description pSource
string The string of the .tmx file content. - Source: