Tilemap#getTile()

getTile(x, y, layer, nonNull) → {Phaser.Tile} Gets a tile from the Tilemap Layer. The coordinates are given in tile values. Parameters Name Type Argument Default Description x number X position to get the tile from (given in tile units, not pixels) y number Y position to get the tile from (given in tile units, not pixels) layer number | string | Phaser.TilemapLayer <optional> The layer to get the tile from. nonNull boolean <optional> false If true getTile wo

Tilemap#getLayerIndex()

getLayerIndex(name) → {number} Gets the layer index based on its name. Parameters Name Type Description name string The name of the layer to get. Returns number - The index of the layer in this tilemap, or null if not found. Source code: tilemap/Tilemap.js (Line 740)

Tilemap#getImageIndex()

getImageIndex(name) → {number} Gets the image index based on its name. Parameters Name Type Description name string The name of the image to get. Returns number - The index of the image in this tilemap, or null if not found. Source code: tilemap/Tilemap.js (Line 766)

Tilemap#game

game : Phaser.Game A reference to the currently running Game. Source code: tilemap/Tilemap.js (Line 33)

Tilemap#format

format : number The format of the map data, either Phaser.Tilemap.CSV or Phaser.Tilemap.TILED_JSON. Source code: tilemap/Tilemap.js (Line 75)

Tilemap#forEach()

forEach(callback, context, x, y, width, height, layer) For each tile in the given area defined by x/y and width/height run the given callback. Parameters Name Type Argument Description callback number The callback. Each tile in the given area will be passed to this callback as the first and only parameter. context number The context under which the callback should be run. x number X position of the top left of the area to operate one, given in tiles, not pixels. y number Y po

Tilemap#fill()

fill(index, x, y, width, height, layer) Fills the given area with the specified tile. Parameters Name Type Argument Description index number The index of the tile that the area will be filled with. x number X position of the top left of the area to operate one, given in tiles, not pixels. y number Y position of the top left of the area to operate one, given in tiles, not pixels. width number The width in tiles of the area to operate on. height number The height in tiles o

Tilemap#enableDebug

enableDebug : boolean If set then console.log is used to dump out useful layer creation debug data. Source code: tilemap/Tilemap.js (Line 140)

Tilemap#dump()

dump() Dumps the tilemap data out to the console. Source code: tilemap/Tilemap.js (Line 1888)

Tilemap#destroy()

destroy() Removes all layer data from this tile map and nulls the game reference.Note: You are responsible for destroying any TilemapLayer objects you generated yourself, as Tilemap doesn't keep a reference to them. Source code: tilemap/Tilemap.js (Line 1929)