Completed Tilemap class docs

This commit is contained in:
Richard Davey 2018-09-28 14:02:12 +01:00
parent 99ba77c29d
commit 43067aa30e
2 changed files with 171 additions and 215 deletions

View file

@ -106,6 +106,7 @@ andiCR
@bobonthenet
Kanthi
31826615
bsparks

View file

@ -673,11 +673,10 @@ var Tilemap = new Class({
* @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted
* tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a
* one-to-one mapping with the indexes array.
* @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e.
* scene.make.sprite).
* @param {SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite).
* @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.GameObjects.Sprite[]} Returns an array of Tiles, or null if the layer given was invalid.
*/
@ -771,13 +770,13 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#fill
* @since 3.0.0
*
* @param {integer} index - [description]
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
* @param {integer} [height=max height based on tileY] - [description]
* @param {boolean} [recalculateFaces=true] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {integer} index - The tile index to fill the area with.
* @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.
*/
@ -840,18 +839,15 @@ var Tilemap = new Class({
* callback as the first and only parameter. The callback should return true for tiles that pass the
* filter.
* @param {object} [context] - The context under which the callback should be run.
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
* @param {integer} [height=max height based on tileY] - [description]
* @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter.
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {object} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
* -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide
* on at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
* have at least one interesting face.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
* @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to apply the filter on. If not provided will use the current layer.
*
* @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid.
*/
@ -877,9 +873,8 @@ var Tilemap = new Class({
*
* @param {integer} index - The tile index value to search for.
* @param {integer} [skip=0] - The number of times to skip a matching tile before returning.
* @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the
* bottom-right. Otherwise it scans from the top-left.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left.
* @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer.
*
* @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid.
*/
@ -933,21 +928,17 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#findTile
* @since 3.0.0
*
* @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this
* callback as the first and only parameter.
* @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter.
* @param {object} [context] - The context under which the callback should be run.
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
* @param {integer} [height=max height based on tileY] - [description]
* @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search.
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {object} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
* -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide
* on at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
* have at least one interesting face.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
* @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer.
*
* @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid.
*/
@ -969,21 +960,17 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#forEachTile
* @since 3.0.0
*
* @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this
* callback as the first and only parameter.
* @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter.
* @param {object} [context] - The context under which the callback should be run.
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
* @param {integer} [height=max height based on tileY] - [description]
* @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search.
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {object} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
* -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide
* on at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
* have at least one interesting face.
* @param {LayerData} [layer] - [description]
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
* @param {Phaser.Tilemaps.LayerData} [layer] - The Tile layer to run the search on. If not provided will use the current layer.
*
* @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.
*/
@ -1139,9 +1126,8 @@ var Tilemap = new Class({
*
* @param {integer} tileX - X position to get the tile from (given in tile units, not pixels).
* @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels).
* @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile
* object with an index of -1.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid.
*/
@ -1163,10 +1149,9 @@ var Tilemap = new Class({
*
* @param {number} worldX - X position to get the tile from (given in pixels)
* @param {number} worldY - Y position to get the tile from (given in pixels)
* @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile
* object with an index of -1.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid.
*/
@ -1191,18 +1176,15 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#getTilesWithin
* @since 3.0.0
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
* @param {integer} [height=max height based on tileY] - [description]
* @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {object} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
* -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on
* at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
* have at least one interesting face.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid.
*/
@ -1225,14 +1207,11 @@ var Tilemap = new Class({
*
* @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates
* @param {object} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
* -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on
* at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
* have at least one interesting face.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid.
*/
@ -1252,19 +1231,16 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#getTilesWithinWorldXY
* @since 3.0.0
*
* @param {number} worldX - [description]
* @param {number} worldY - [description]
* @param {number} width - [description]
* @param {number} height - [description]
* @param {number} worldX - The world x coordinate for the top-left of the area.
* @param {number} worldY - The world y coordinate for the top-left of the area.
* @param {number} width - The width of the area.
* @param {number} height - The height of the area.
* @param {object} [filteringOptions] - Optional filters to apply when getting the tiles.
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have
* -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on
* at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
* have at least one interesting face.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index.
* @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side.
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid.
*/
@ -1319,9 +1295,9 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#hasTileAt
* @since 3.0.0
*
* @param {integer} tileX - [description]
* @param {integer} tileY - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {integer} tileX - The x coordinate, in tiles, not pixels.
* @param {integer} tileY - The y coordinate, in tiles, not pixels.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used.
*
* @return {?boolean} Returns a boolean, or null if the layer given was invalid.
*/
@ -1343,10 +1319,10 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#hasTileAtWorldXY
* @since 3.0.0
*
* @param {number} worldX - [description]
* @param {number} worldY - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {number} worldX - The x coordinate, in pixels.
* @param {number} worldY - The y coordinate, in pixels.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used.
*
* @return {?boolean} Returns a boolean, or null if the layer given was invalid.
*/
@ -1393,12 +1369,12 @@ var Tilemap = new Class({
* @since 3.0.0
*
* @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object.
* @param {integer} tileX - [description]
* @param {integer} tileY - [description]
* @param {boolean} [recalculateFaces=true] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {integer} tileX - The x coordinate, in tiles, not pixels.
* @param {integer} tileY - The y coordinate, in tiles, not pixels.
* @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid.
* @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid or the coordinates were out of bounds.
*/
putTileAt: function (tile, tileX, tileY, recalculateFaces, layer)
{
@ -1424,11 +1400,11 @@ var Tilemap = new Class({
* @since 3.0.0
*
* @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object.
* @param {integer} worldX - [description]
* @param {integer} worldY - [description]
* @param {boolean} [recalculateFaces=true] - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {number} worldX - The x coordinate, in pixels.
* @param {number} worldY - The y coordinate, in pixels.
* @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid.
*/
@ -1456,12 +1432,11 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#putTilesAt
* @since 3.0.0
*
* @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles
* or tile indexes to place.
* @param {integer} tileX - [description]
* @param {integer} tileY - [description]
* @param {boolean} [recalculateFaces=true] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place.
* @param {integer} tileX - The x coordinate, in tiles, not pixels.
* @param {integer} tileY - The y coordinate, in tiles, not pixels.
* @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.
*/
@ -1492,12 +1467,12 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#randomize
* @since 3.0.0
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
* @param {integer} [height=max height based on tileY] - [description]
* @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.
*/
@ -1525,9 +1500,9 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#calculateFacesAt
* @since 3.0.0
*
* @param {integer} tileX - [description]
* @param {integer} tileY - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {integer} tileX - The x coordinate, in tiles, not pixels.
* @param {integer} tileY - The y coordinate, in tiles, not pixels.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.
*/
@ -1552,11 +1527,11 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#calculateFacesWithin
* @since 3.0.0
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
* @param {integer} [height=max height based on tileY] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid.
*/
@ -1607,12 +1582,11 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#removeTileAt
* @since 3.0.0
*
* @param {integer} tileX - [description]
* @param {integer} tileY - [description]
* @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified
* location with null instead of a Tile with an index of -1.
* @param {boolean} [recalculateFaces=true] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {integer} tileX - The x coordinate, in tiles, not pixels.
* @param {integer} tileY - The y coordinate, in tiles, not pixels.
* @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1.
* @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid.
*/
@ -1637,13 +1611,12 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#removeTileAtWorldXY
* @since 3.0.0
*
* @param {number} worldX - [description]
* @param {number} worldY - [description]
* @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified
* location with null instead of a Tile with an index of -1.
* @param {boolean} [recalculateFaces=true] - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {number} worldX - The x coordinate, in pixels.
* @param {number} worldY - The y coordinate, in pixels.
* @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1.
* @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid.
*/
@ -1671,13 +1644,10 @@ var Tilemap = new Class({
*
* @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon.
* @param {object} styleConfig - An object specifying the colors to use for the debug drawing.
* @param {?Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at
* non-colliding tile locations. If set to null, non-colliding tiles will not be drawn.
* @param {?Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled
* rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn.
* @param {?Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting
* tile faces. If set to null, interesting tile faces will not be drawn.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {?Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at non-colliding tile locations. If set to null, non-colliding tiles will not be drawn.
* @param {?Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn.
* @param {?Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting tile faces. If set to null, interesting tile faces will not be drawn.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to search. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.
*/
@ -1703,13 +1673,13 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#replaceByIndex
* @since 3.0.0
*
* @param {integer} findIndex - [description]
* @param {integer} newIndex - [description]
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
* @param {integer} [height=max height based on tileY] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {integer} findIndex - The index of the tile to search for.
* @param {integer} newIndex - The index of the tile to replace it with.
* @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be.
* @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.
*/
@ -1738,11 +1708,9 @@ var Tilemap = new Class({
* @since 3.0.0
*
* @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes.
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear
* collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the
* update.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.
*/
@ -1770,11 +1738,9 @@ var Tilemap = new Class({
*
* @param {integer} start - The first index of the tile to be set for collision.
* @param {integer} stop - The last index of the tile to be set for collision.
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear
* collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the
* update.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.
*/
@ -1803,13 +1769,10 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#setCollisionByProperty
* @since 3.0.0
*
* @param {object} properties - An object with tile properties and corresponding values that should
* be checked.
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear
* collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the
* update.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {object} properties - An object with tile properties and corresponding values that should be checked.
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.
*/
@ -1835,11 +1798,9 @@ var Tilemap = new Class({
* @since 3.0.0
*
* @param {integer[]} indexes - An array of the tile indexes to not be counted for collision.
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear
* collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the
* update.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.
*/
@ -1865,11 +1826,9 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#setCollisionFromCollisionGroup
* @since 3.0.0
*
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear
* collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the
* update.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.
*/
@ -1895,11 +1854,10 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#setTileIndexCallback
* @since 3.0.0
*
* @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a
* collision callback set for.
* @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for.
* @param {function} callback - The callback that will be invoked when the tile is collided with.
* @param {object} callbackContext - The context under which the callback is called.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.
*/
@ -1924,13 +1882,13 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#setTileLocationCallback
* @since 3.0.0
*
* @param {integer} tileX - [description]
* @param {integer} tileY - [description]
* @param {integer} width - [description]
* @param {integer} height - [description]
* @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area.
* @param {integer} width - How many tiles wide from the `tileX` index the area will be.
* @param {integer} height - How many tiles tall from the `tileY` index the area will be.
* @param {function} callback - The callback that will be invoked when the tile is collided with.
* @param {object} [callbackContext] - The context under which the callback is called.
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid.
*/
@ -2135,9 +2093,9 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#tileToWorldX
* @since 3.0.0
*
* @param {integer} tileX - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {integer} tileX - The x coordinate, in tiles, not pixels.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?number} Returns a number, or null if the layer given was invalid.
*/
@ -2159,9 +2117,9 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#tileToWorldY
* @since 3.0.0
*
* @param {integer} tileY - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {integer} tileY - The y coordinate, in tiles, not pixels.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?number} Returns a number, or null if the layer given was invalid.
*/
@ -2184,11 +2142,11 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#tileToWorldXY
* @since 3.0.0
*
* @param {integer} tileX - [description]
* @param {integer} tileY - [description]
* @param {Phaser.Math.Vector2} [point] - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {integer} tileX - The x coordinate, in tiles, not pixels.
* @param {integer} tileY - The y coordinate, in tiles, not pixels.
* @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid.
*/
@ -2256,11 +2214,10 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#worldToTileX
* @since 3.0.0
*
* @param {number} worldX - [description]
* @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the
* nearest integer.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {number} worldX - The x coordinate to be converted, in pixels, not tiles.
* @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?number} Returns a number, or null if the layer given was invalid.
*/
@ -2282,11 +2239,10 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#worldToTileY
* @since 3.0.0
*
* @param {number} worldY - [description]
* @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the
* nearest integer.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {number} worldY - The y coordinate to be converted, in pixels, not tiles.
* @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?number} Returns a number, or null if the layer given was invalid.
*/
@ -2309,13 +2265,12 @@ var Tilemap = new Class({
* @method Phaser.Tilemaps.Tilemap#worldToTileXY
* @since 3.0.0
*
* @param {number} worldX - [description]
* @param {number} worldY - [description]
* @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the
* nearest integer.
* @param {Phaser.Math.Vector2} [point] - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
* @param {Phaser.Tilemaps.LayerData} [layer] - [description]
* @param {number} worldX - The x coordinate to be converted, in pixels, not tiles.
* @param {number} worldY - The y coordinate to be converted, in pixels, not tiles.
* @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer.
* @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created.
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.
* @param {Phaser.Tilemaps.LayerData} [layer] - The tile layer to use. If not given the current layer is used.
*
* @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid.
*/