Tilemap#tilesets

tilesets :array An array of Tilesets. Source code: tilemap/Tilemap.js (Line 105)

Tilemap#tiles

tiles :array The super array of Tiles. Source code: tilemap/Tilemap.js (Line 115)

Tilemap#Tilemap

new Tilemap(game, key, tileWidth, tileHeight, width, height) Creates a new Phaser.Tilemap object. The map can either be populated with data from a Tiled JSON file or from a CSV file. Tiled is a free software package specifically for creating tile maps, and is available from http://www.mapeditor.org To do this pass the Cache key as the first parameter. When using Tiled data you need only provide the key.When using CSV data you must provide the key and the tileWidth and tileHeight parameters.If

Tilemap#tileHeight

tileHeight : number The base height of the tiles in the map (in pixels). Source code: tilemap/Tilemap.js (Line 65)

Tilemap#swap()

swap(tileA, tileB, x, y, width, height, layer) Scans the given area for tiles with an index matching tileA and swaps them with tileB. Parameters Name Type Argument Description tileA number First tile index. tileB number Second tile index. 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 operat

Tilemap#shuffle()

shuffle(x, y, width, height, layer) Shuffles a set of tiles in a given area. It will only randomise the tiles in that area, so if they're all the same nothing will appear to have changed! Parameters Name Type Argument Description 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 num

Tilemap#setTileSize()

setTileSize(tileWidth, tileHeight) Sets the base tile size for the map. Parameters Name Type Description tileWidth number The width of the tiles the map uses for calculations. tileHeight number The height of the tiles the map uses for calculations. Source code: tilemap/Tilemap.js (Line 237)

Tilemap#setTileLocationCallback()

setTileLocationCallback(x, y, width, height, callback, callbackContext, layer) Sets a global collision callback for the given map location within the layer. This will affect all tiles on this layer found in the given area.If a callback is already set for the tile index it will be replaced. Set the callback to null to remove it.If you want to set a callback for a tile at a specific location on the map then see setTileLocationCallback. Parameters Name Type Argument Description x number X p

Tilemap#setTileIndexCallback()

setTileIndexCallback(indexes, callback, callbackContext, layer) Sets a global collision callback for the given tile index within the layer. This will affect all tiles on this layer that have the same index.If a callback is already set for the tile index it will be replaced. Set the callback to null to remove it.If you want to set a callback for a tile at a specific location on the map then see setTileLocationCallback. Parameters Name Type Argument Description indexes number | array Eithe

Tilemap#setPreventRecalculate()

setPreventRecalculate(value) Turn off/on the recalculation of faces for tile or collision updates.setPreventRecalculate(true) puts recalculation on hold while setPreventRecalculate(false) recalculates all the changed layers. Parameters Name Type Description value boolean If true it will put the recalculation on hold. Source code: tilemap/Tilemap.js (Line 1044)