Class: TMXTileMap

me. TMXTileMap

new TMXTileMap(levelId, data)

a TMX Tile Map Object Tiled QT +0.7.x format
Parameters:
Name Type Description
levelId String name of TMX map
data Object TMX map in JSON format
Source:
TMXTiledMap.js, line 160
Example
// create a new level object based on the TMX JSON object
var level = new me.TMXTileMap(levelId, me.loader.getTMX(levelId));
// add the level to the game world container
level.addTo(me.game.world, true);

Extends

Members

cols :Int

width of the tilemap in tiles
Type:
  • Int
Source:
TMXTiledMap.js, line 178

name :String

name of the tilemap
Type:
  • String
Source:
TMXTiledMap.js, line 164

rows :Int

height of the tilemap in tiles
Type:
  • Int
Source:
TMXTiledMap.js, line 185

tileheight :Int

Tile height
Type:
  • Int
Source:
TMXTiledMap.js, line 201

tilewidth :Int

Tile width
Type:
  • Int
Source:
TMXTiledMap.js, line 193

Methods

<static> getRenderer() → {me.TMXRenderer}

Return the map default renderer
Source:
TMXTiledMap.js, line 253
Returns:
renderer
Type
me.TMXRenderer

addTo(target, flatten)

add all the map layers and objects to the given container
Parameters:
Name Type Description
target me.Container container
flatten boolean if true, flatten all objects into the given container
Source:
TMXTiledMap.js, line 343
Example
// create a new level object based on the TMX JSON object
var level = new me.TMXTileMap(levelId, me.loader.getTMX(levelId));
// add the level to the game world container
level.addTo(me.game.world, true);

destroy()

destroy function, clean all allocated objects
Source:
TMXTiledMap.js, line 508

getLayers() → {Array.<me.TMXLayer>}

return all the existing layers
Source:
TMXTiledMap.js, line 495
Returns:
Array of Layers
Type
Array.<me.TMXLayer>

getObjects(flatten) → {Array.<me.Renderable>}

return an Array of instantiated objects, based on the map object definition
Parameters:
Name Type Description
flatten boolean if true, flatten all objects into the returned array,
ignoring all defined groups (no sub containers will be created)
Source:
TMXTiledMap.js, line 382
Returns:
Array of Objects
Type
Array.<me.Renderable>
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:41+08:00 using the DocStrap template modified by codename-.