Merge pull request #3430 from orblazer/fix-types

Fix types in Tilemaps
This commit is contained in:
Richard Davey 2018-03-20 14:14:36 +00:00 committed by GitHub
commit f88489119b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 464 additions and 426 deletions

View file

@ -18,7 +18,7 @@ var Rectangle = require('../geom/rectangle');
* @memberOf Phaser.Tilemaps
* @constructor
* @since 3.0.0
*
*
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.Flip
* @extends Phaser.GameObjects.Components.Visible
@ -50,7 +50,7 @@ var Tile = new Class({
{
/**
* The LayerData in the Tilemap data that this tile belongs to.
*
*
* @name Phaser.Tilemaps.Tile#layer
* @type {Phaser.Tilemaps.LayerData}
* @since 3.0.0
@ -60,7 +60,7 @@ var Tile = new Class({
/**
* The index of this tile within the map data corresponding to the tileset, or -1 if this
* represents a blank tile.
*
*
* @name Phaser.Tilemaps.Tile#index
* @type {integer}
* @since 3.0.0
@ -69,7 +69,7 @@ var Tile = new Class({
/**
* The x map coordinate of this tile in tile units.
*
*
* @name Phaser.Tilemaps.Tile#x
* @type {integer}
* @since 3.0.0
@ -78,7 +78,7 @@ var Tile = new Class({
/**
* The y map coordinate of this tile in tile units.
*
*
* @name Phaser.Tilemaps.Tile#y
* @type {integer}
* @since 3.0.0
@ -87,7 +87,7 @@ var Tile = new Class({
/**
* The width of the tile in pixels.
*
*
* @name Phaser.Tilemaps.Tile#width
* @type {integer}
* @since 3.0.0
@ -96,7 +96,7 @@ var Tile = new Class({
/**
* The height of the tile in pixels.
*
*
* @name Phaser.Tilemaps.Tile#height
* @type {integer}
* @since 3.0.0
@ -106,7 +106,7 @@ var Tile = new Class({
/**
* The map's base width of a tile in pixels. Tiled maps support multiple tileset sizes
* within one map, but they are still placed at intervals of the base tile size.
*
*
* @name Phaser.Tilemaps.Tile#baseWidth
* @type {integer}
* @since 3.0.0
@ -116,7 +116,7 @@ var Tile = new Class({
/**
* The map's base height of a tile in pixels. Tiled maps support multiple tileset sizes
* within one map, but they are still placed at intervals of the base tile size.
*
*
* @name Phaser.Tilemaps.Tile#baseHeight
* @type {integer}
* @since 3.0.0
@ -127,7 +127,7 @@ var Tile = new Class({
* The x coordinate of the top left of this tile in pixels. This is relative to the top left
* of the layer this tile is being rendered within. This property does NOT factor in camera
* scroll, layer scale or layer position.
*
*
* @name Phaser.Tilemaps.Tile#pixelX
* @type {number}
* @since 3.0.0
@ -138,7 +138,7 @@ var Tile = new Class({
* The y coordinate of the top left of this tile in pixels. This is relative to the top left
* of the layer this tile is being rendered within. This property does NOT factor in camera
* scroll, layer scale or layer position.
*
*
* @name Phaser.Tilemaps.Tile#pixelY
* @type {number}
* @since 3.0.0
@ -149,7 +149,7 @@ var Tile = new Class({
/**
* Tile specific properties. These usually come from Tiled.
*
*
* @name Phaser.Tilemaps.Tile#properties
* @type {object}
* @since 3.0.0
@ -158,7 +158,7 @@ var Tile = new Class({
/**
* The rotation angle of this tile.
*
*
* @name Phaser.Tilemaps.Tile#rotation
* @type {number}
* @since 3.0.0
@ -167,7 +167,7 @@ var Tile = new Class({
/**
* Whether the tile should collide with any object on the left side.
*
*
* @name Phaser.Tilemaps.Tile#collideLeft
* @type {boolean}
* @since 3.0.0
@ -176,7 +176,7 @@ var Tile = new Class({
/**
* Whether the tile should collide with any object on the right side.
*
*
* @name Phaser.Tilemaps.Tile#collideRight
* @type {boolean}
* @since 3.0.0
@ -185,7 +185,7 @@ var Tile = new Class({
/**
* Whether the tile should collide with any object on the top side.
*
*
* @name Phaser.Tilemaps.Tile#collideUp
* @type {boolean}
* @since 3.0.0
@ -194,7 +194,7 @@ var Tile = new Class({
/**
* Whether the tile should collide with any object on the bottom side.
*
*
* @name Phaser.Tilemaps.Tile#collideDown
* @type {boolean}
* @since 3.0.0
@ -203,7 +203,7 @@ var Tile = new Class({
/**
* Whether the tile's left edge is interesting for collisions.
*
*
* @name Phaser.Tilemaps.Tile#faceLeft
* @type {boolean}
* @since 3.0.0
@ -212,7 +212,7 @@ var Tile = new Class({
/**
* Whether the tile's right edge is interesting for collisions.
*
*
* @name Phaser.Tilemaps.Tile#faceRight
* @type {boolean}
* @since 3.0.0
@ -221,7 +221,7 @@ var Tile = new Class({
/**
* Whether the tile's top edge is interesting for collisions.
*
*
* @name Phaser.Tilemaps.Tile#faceTop
* @type {boolean}
* @since 3.0.0
@ -230,7 +230,7 @@ var Tile = new Class({
/**
* Whether the tile's bottom edge is interesting for collisions.
*
*
* @name Phaser.Tilemaps.Tile#faceBottom
* @type {boolean}
* @since 3.0.0
@ -239,7 +239,7 @@ var Tile = new Class({
/**
* Tile collision callback.
*
*
* @name Phaser.Tilemaps.Tile#collisionCallback
* @type {function}
* @since 3.0.0
@ -248,7 +248,7 @@ var Tile = new Class({
/**
* The context in which the collision callback will be called.
*
*
* @name Phaser.Tilemaps.Tile#collisionCallbackContext
* @type {object}
* @since 3.0.0
@ -258,7 +258,7 @@ var Tile = new Class({
/**
* The tint to apply to this tile. Note: tint is currently a single color value instead of
* the 4 corner tint component on other GameObjects.
*
*
* @name Phaser.Tilemaps.Tile#tint
* @type {number}
* @default
@ -268,7 +268,7 @@ var Tile = new Class({
/**
* An empty object where physics-engine specific information (e.g. bodies) may be stored.
*
*
* @name Phaser.Tilemaps.Tile#physics
* @type {object}
* @since 3.0.0
@ -282,10 +282,10 @@ var Tile = new Class({
*
* @method Phaser.Tilemaps.Tile#containsPoint
* @since 3.0.0
*
*
* @param {number} x - The x coordinate to test.
* @param {number} y - The y coordinate to test.
*
*
* @return {boolean} True if the coordinates are within this Tile, otherwise false.
*/
containsPoint: function (x, y)
@ -299,9 +299,9 @@ var Tile = new Class({
*
* @method Phaser.Tilemaps.Tile#containsPoint
* @since 3.0.0
*
*
* @param {Phaser.Tilemaps.Tile} tile - The tile to copy from.
*
*
* @return {Phaser.Tilemaps.Tile} This Tile object.
*/
copy: function (tile)
@ -327,11 +327,11 @@ var Tile = new Class({
* The collision group for this Tile, defined within the Tileset. This returns a reference to
* the collision group stored within the Tileset, so any modification of the returned object
* will impact all tiles that have the same index as this tile.
*
*
* @method Phaser.Tilemaps.Tile#getCollisionGroup
* @since 3.0.0
*
* @return {object|null} tileset
*
* @return {?object} tileset
*/
getCollisionGroup: function ()
{
@ -343,11 +343,11 @@ var Tile = new Class({
* collision data, tile animations and terrain information. This returns a reference to the tile
* data stored within the Tileset, so any modification of the returned object will impact all
* tiles that have the same index as this tile.
*
*
* @method Phaser.Tilemaps.Tile#getTileData
* @since 3.0.0
*
* @return {object|null} tileset
*
* @return {?object} tileset
*/
getTileData: function ()
{
@ -357,12 +357,12 @@ var Tile = new Class({
/**
* Gets the world X position of the left side of the tile, factoring in the layers position,
* scale and scroll.
*
*
* @method Phaser.Tilemaps.Tile#getLeft
* @since 3.0.0
*
*
* @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.
*
*
* @return {number}
*/
getLeft: function (camera)
@ -375,12 +375,12 @@ var Tile = new Class({
/**
* Gets the world X position of the right side of the tile, factoring in the layer's position,
* scale and scroll.
*
*
* @method Phaser.Tilemaps.Tile#getRight
* @since 3.0.0
*
*
* @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.
*
*
* @return {number}
*/
getRight: function (camera)
@ -393,12 +393,12 @@ var Tile = new Class({
/**
* Gets the world Y position of the top side of the tile, factoring in the layer's position,
* scale and scroll.
*
*
* @method Phaser.Tilemaps.Tile#getTop
* @since 3.0.0
*
*
* @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.
*
*
* @return {number}
*/
getTop: function (camera)
@ -419,9 +419,9 @@ var Tile = new Class({
* @method Phaser.Tilemaps.Tile#getBottom
* @since 3.0.0
*
*
* @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.
*
*
* @return {number}
*/
getBottom: function (camera)
@ -436,13 +436,13 @@ var Tile = new Class({
/**
* Gets the world rectangle bounding box for the tile, factoring in the layers position,
* scale and scroll.
*
*
* @method Phaser.Tilemaps.Tile#getBounds
* @since 3.0.0
*
*
* @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.
* @param {object} [output] - [description]
*
*
* @return {Phaser.Geom.Rectangle|object}
*/
getBounds: function (camera, output)
@ -460,12 +460,12 @@ var Tile = new Class({
/**
* Gets the world X position of the center of the tile, factoring in the layer's position,
* scale and scroll.
*
*
* @method Phaser.Tilemaps.Tile#getCenterX
* @since 3.0.0
*
*
* @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.
*
*
* @return {number}
*/
getCenterX: function (camera)
@ -476,12 +476,12 @@ var Tile = new Class({
/**
* Gets the world Y position of the center of the tile, factoring in the layer's position,
* scale and scroll.
*
*
* @method Phaser.Tilemaps.Tile#getCenterY
* @since 3.0.0
*
*
* @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check.
*
*
* @return {number}
*/
getCenterY: function (camera)
@ -491,7 +491,7 @@ var Tile = new Class({
/**
* Clean up memory.
*
*
* @method Phaser.Tilemaps.Tile#destroy
* @since 3.0.0
*/
@ -508,12 +508,12 @@ var Tile = new Class({
*
* @method Phaser.Tilemaps.Tile#intersects
* @since 3.0.0
*
*
* @param {number} x - The x axis in pixels.
* @param {number} y - The y axis in pixels.
* @param {number} right - The right point.
* @param {number} bottom - The bottom point.
*
*
* @return {boolean}
*/
intersects: function (x, y, right, bottom)
@ -526,13 +526,13 @@ var Tile = new Class({
/**
* Checks if the tile is interesting.
*
*
* @method Phaser.Tilemaps.Tile#isInteresting
* @since 3.0.0
*
* @param {boolean} collides - If true, will consider the tile interesting if it collides on any side.
* @param {boolean} faces - If true, will consider the tile interesting if it has an interesting face.
*
*
* @return {boolean} True if the Tile is interesting, otherwise false.
*/
isInteresting: function (collides, faces)
@ -548,9 +548,9 @@ var Tile = new Class({
*
* @method Phaser.Tilemaps.Tile#resetCollision
* @since 3.0.0
*
*
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces for this tile and its neighbors.
*
*
* @return {Phaser.Tilemaps.Tile} This Tile object.
*/
resetCollision: function (recalculateFaces)
@ -582,7 +582,7 @@ var Tile = new Class({
/**
* Reset faces.
*
*
* @method Phaser.Tilemaps.Tile#resetFaces
* @since 3.0.0
*
@ -600,7 +600,7 @@ var Tile = new Class({
/**
* Sets the collision flags for each side of this tile and updates the interesting faces list.
*
*
* @method Phaser.Tilemaps.Tile#setCollision
* @since 3.0.0
*
@ -610,7 +610,7 @@ var Tile = new Class({
* @param {boolean} [down] - Indicating collide with any object on the bottom.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces
* for this tile and its neighbors.
*
*
* @return {Phaser.Tilemaps.Tile} This Tile object.
*/
setCollision: function (left, right, up, down, recalculateFaces)
@ -646,13 +646,13 @@ var Tile = new Class({
/**
* Set a callback to be called when this tile is hit by an object. The callback must true for
* collision processing to take place.
*
*
* @method Phaser.Tilemaps.Tile#setCollisionCallback
* @since 3.0.0
*
* @param {function} callback - Callback function.
* @param {object} context - Callback will be called within this context.
*
*
* @return {Phaser.Tilemaps.Tile} This Tile object.
*/
setCollisionCallback: function (callback, context)
@ -673,7 +673,7 @@ var Tile = new Class({
/**
* Sets the size of the tile and updates its pixelX and pixelY.
*
*
* @method Phaser.Tilemaps.Tile#setSize
* @since 3.0.0
*
@ -681,7 +681,7 @@ var Tile = new Class({
* @param {integer} tileHeight - The height of the tile in pixels.
* @param {integer} baseWidth - The base width a tile in the map (in pixels).
* @param {integer} baseHeight - The base height of the tile in pixels (in pixels).
*
*
* @return {Phaser.Tilemaps.Tile} This Tile object.
*/
setSize: function (tileWidth, tileHeight, baseWidth, baseHeight)
@ -698,7 +698,7 @@ var Tile = new Class({
/**
* Used internally. Updates the tile's world XY position based on the current tile size.
*
*
* @method Phaser.Tilemaps.Tile#updatePixelXY
* @since 3.0.0
*
@ -717,7 +717,7 @@ var Tile = new Class({
/**
* True if this tile can collide on any of its faces or has a collision callback set.
*
*
* @name Phaser.Tilemaps.Tile#canCollide
* @type {boolean}
* @readOnly
@ -732,7 +732,7 @@ var Tile = new Class({
/**
* True if this tile can collide on any of its faces.
*
*
* @name Phaser.Tilemaps.Tile#collides
* @type {boolean}
* @readOnly
@ -747,7 +747,7 @@ var Tile = new Class({
/**
* True if this tile has any interesting faces.
*
*
* @name Phaser.Tilemaps.Tile#hasInterestingFace
* @type {boolean}
* @readOnly
@ -763,7 +763,7 @@ var Tile = new Class({
/**
* The tileset that contains this Tile. This will only return null if accessed from a LayerData
* instance before the tile is placed within a StaticTilemapLayer or DynamicTilemapLayer.
*
*
* @name Phaser.Tilemaps.Tile#tileset
* @type {?Phaser.Tilemaps.Tileset}
* @readOnly
@ -781,9 +781,9 @@ var Tile = new Class({
* The tilemap layer that contains this Tile. This will only return null if accessed from a
* LayerData instance before the tile is placed within a StaticTilemapLayer or
* DynamicTilemapLayer.
*
*
* @name Phaser.Tilemaps.Tile#tilemapLayer
* @type {Phaser.Tilemaps.StaticTilemapLayer|Phaser.Tilemaps.DynamicTilemapLayer|null}
* @type {?Phaser.Tilemaps.StaticTilemapLayer|Phaser.Tilemaps.DynamicTilemapLayer}
* @readOnly
* @since 3.0.0
*/
@ -797,7 +797,7 @@ var Tile = new Class({
/**
* The tilemap that contains this Tile. This will only return null if accessed from a LayerData
* instance before the tile is placed within a StaticTilemapLayer or DynamicTilemapLayer.
*
*
* @name Phaser.Tilemaps.Tile#tilemap
* @type {?Phaser.Tilemaps.Tilemap}
* @readOnly

File diff suppressed because it is too large Load diff

View file

@ -42,7 +42,7 @@ var Tileset = new Class({
/**
* The name of the Tileset.
*
*
* @name Phaser.Tilemaps.Tileset#name
* @type {string}
* @since 3.0.0
@ -51,7 +51,7 @@ var Tileset = new Class({
/**
* The starting index of the first tile index this Tileset contains.
*
*
* @name Phaser.Tilemaps.Tileset#firstgid
* @type {integer}
* @since 3.0.0
@ -60,7 +60,7 @@ var Tileset = new Class({
/**
* The width of each tile (in pixels). Use setTileSize to change.
*
*
* @name Phaser.Tilemaps.Tileset#tileWidth
* @type {integer}
* @readOnly
@ -70,7 +70,7 @@ var Tileset = new Class({
/**
* The height of each tile (in pixels). Use setTileSize to change.
*
*
* @name Phaser.Tilemaps.Tileset#tileHeight
* @type {integer}
* @readOnly
@ -80,7 +80,7 @@ var Tileset = new Class({
/**
* The margin around the tiles in the sheet (in pixels). Use `setSpacing` to change.
*
*
* @name Phaser.Tilemaps.Tileset#tileMargin
* @type {integer}
* @readOnly
@ -90,7 +90,7 @@ var Tileset = new Class({
/**
* The spacing between each the tile in the sheet (in pixels). Use `setSpacing` to change.
*
*
* @name Phaser.Tilemaps.Tileset#tileSpacing
* @type {integer}
* @readOnly
@ -101,7 +101,7 @@ var Tileset = new Class({
/**
* Tileset-specific properties per tile that are typically defined in the Tiled editor in the
* Tileset editor.
*
*
* @name Phaser.Tilemaps.Tileset#tileProperties
* @type {object}
* @since 3.0.0
@ -111,7 +111,7 @@ var Tileset = new Class({
/**
* Tileset-specific data per tile that are typically defined in the Tiled editor, e.g. within
* the Tileset collision editor. This is where collision objects and terrain are stored.
*
*
* @name Phaser.Tilemaps.Tileset#tileData
* @type {object}
* @since 3.0.0
@ -120,9 +120,9 @@ var Tileset = new Class({
/**
* The cached image that contains the individual tiles. Use setImage to set.
*
*
* @name Phaser.Tilemaps.Tileset#image
* @type {Phaser.Textures.Texture|null}
* @type {?Phaser.Textures.Texture}
* @readOnly
* @since 3.0.0
*/
@ -130,7 +130,7 @@ var Tileset = new Class({
/**
* The number of tile rows in the the tileset.
*
*
* @name Phaser.Tilemaps.Tileset#rows
* @type {integer}
* @readOnly
@ -140,7 +140,7 @@ var Tileset = new Class({
/**
* The number of tile columns in the tileset.
*
*
* @name Phaser.Tilemaps.Tileset#columns
* @type {integer}
* @readOnly
@ -150,7 +150,7 @@ var Tileset = new Class({
/**
* The total number of tiles in the tileset.
*
*
* @name Phaser.Tilemaps.Tileset#total
* @type {integer}
* @readOnly
@ -161,7 +161,7 @@ var Tileset = new Class({
/**
* The look-up table to specific tile image texture coordinates (UV in pixels). Each element
* contains the coordinates for a tile in an object of the form {x, y}.
*
*
* @name Phaser.Tilemaps.Tileset#texCoordinates
* @type {object[]}
* @readOnly
@ -178,8 +178,8 @@ var Tileset = new Class({
* @since 3.0.0
*
* @param {integer} tileIndex - The unique id of the tile across all tilesets in the map.
*
* @return {object|undefined|null}
*
* @return {?(object|undefined)}
*/
getTileProperties: function (tileIndex)
{
@ -197,8 +197,8 @@ var Tileset = new Class({
* @since 3.0.0
*
* @param {integer} tileIndex - The unique id of the tile across all tilesets in the map.
*
* @return {object|undefined|null}
*
* @return {?object|undefined}
*/
getTileData: function (tileIndex)
{
@ -215,8 +215,8 @@ var Tileset = new Class({
* @since 3.0.0
*
* @param {integer} tileIndex - The unique id of the tile across all tilesets in the map.
*
* @return {object|null}
*
* @return {?object}
*/
getTileCollisionGroup: function (tileIndex)
{
@ -232,7 +232,7 @@ var Tileset = new Class({
* @since 3.0.0
*
* @param {integer} tileIndex - The unique id of the tile across all tilesets in the map.
*
*
* @return {boolean}
*/
containsTileIndex: function (tileIndex)
@ -251,8 +251,8 @@ var Tileset = new Class({
* @since 3.0.0
*
* @param {integer} tileIndex - The unique id of the tile across all tilesets in the map.
*
* @return {object|null} Object in the form { x, y } representing the top-left UV coordinate
*
* @return {?object} Object in the form { x, y } representing the top-left UV coordinate
* within the Tileset image.
*/
getTileTextureCoordinates: function (tileIndex)
@ -269,7 +269,7 @@ var Tileset = new Class({
* @since 3.0.0
*
* @param {Phaser.Textures.Texture} texture - The image that contains the tiles.
*
*
* @return {Phaser.Tilemaps.Tileset} This Tileset object.
*/
setImage: function (texture)
@ -289,7 +289,7 @@ var Tileset = new Class({
*
* @param {integer} [tileWidth] - The width of a tile in pixels.
* @param {integer} [tileHeight] - The height of a tile in pixels.
*
*
* @return {Phaser.Tilemaps.Tileset} This Tileset object.
*/
setTileSize: function (tileWidth, tileHeight)
@ -313,7 +313,7 @@ var Tileset = new Class({
*
* @param {integer} [margin] - The margin around the tiles in the sheet (in pixels).
* @param {integer} [spacing] - The spacing between the tiles in the sheet (in pixels).
*
*
* @return {Phaser.Tilemaps.Tileset} This Tileset object.
*/
setSpacing: function (margin, spacing)
@ -337,7 +337,7 @@ var Tileset = new Class({
*
* @param {integer} imageWidth - The (expected) width of the image to slice.
* @param {integer} imageHeight - The (expected) height of the image to slice.
*
*
* @return {Phaser.Tilemaps.Tileset} This Tileset object.
*/
updateTileData: function (imageWidth, imageHeight)

View file

@ -19,8 +19,8 @@
* @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 Tilemap Layer to act upon.
*
* @return {Phaser.Tilemaps.Tile|null} The first (or n skipped) tile with the matching index.
*
* @return {?Phaser.Tilemaps.Tile} The first (or n skipped) tile with the matching index.
*/
var FindByIndex = function (findIndex, skip, reverse, layer)
{

View file

@ -6,6 +6,16 @@
var GetTilesWithin = require('./GetTilesWithin');
/**
* @callback FindTileCallback
*
* @param {Phaser.Tilemaps.Tile} value - [description]
* @param {number} index - [description]
* @param {Phaser.Tilemaps.Tile[]} array - [description]
*
* @return {boolean} [description]
*/
/**
* Find the first tile in the given rectangular area (in tile coordinates) of the layer that
* satisfies the provided testing function. I.e. finds the first tile for which `callback` returns
@ -14,7 +24,7 @@ var GetTilesWithin = require('./GetTilesWithin');
* @function Phaser.Tilemaps.Components.FindTile
* @since 3.0.0
*
* @param {function} callback - The callback. Each tile in the given area will be passed to this
* @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]
@ -29,8 +39,8 @@ var GetTilesWithin = require('./GetTilesWithin');
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
* have at least one interesting face.
* @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon.
*
* @return {Phaser.Tilemaps.Tile|null} A Tile that matches the search, or null if no Tile found
*
* @return {?Phaser.Tilemaps.Tile} A Tile that matches the search, or null if no Tile found
*/
var FindTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer)
{

View file

@ -6,6 +6,14 @@
var GetTilesWithin = require('./GetTilesWithin');
/**
* @callback EachTileCallback
*
* @param {Phaser.Tilemaps.Tile} value - [description]
* @param {number} index - [description]
* @param {Phaser.Tilemaps.Tile[]} array - [description]
*/
/**
* For each tile in the given rectangular area (in tile coordinates) of the layer, run the given
* callback. Similar to Array.prototype.forEach in vanilla JS.
@ -13,7 +21,7 @@ var GetTilesWithin = require('./GetTilesWithin');
* @function Phaser.Tilemaps.Components.ForEachTile
* @since 3.0.0
*
* @param {function} callback - The callback. Each tile in the given area will be passed to this
* @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]

View file

@ -18,11 +18,11 @@ var Color = require('../../display/color');
*
* @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|null} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at
* @param {?Phaser.Display.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|null} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled
* @param {?Phaser.Display.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|null} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting
* @param {?Phaser.Display.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 Tilemap Layer to act upon.
*/

View file

@ -25,7 +25,7 @@ var TilemapComponents = require('../components');
* @memberOf Phaser.Tilemaps
* @constructor
* @since 3.0.0
*
*
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.Depth
@ -74,7 +74,7 @@ var DynamicTilemapLayer = new Class({
/**
* Used internally by physics system to perform fast type checks.
*
*
* @name Phaser.Tilemaps.DynamicTilemapLayer#isTilemap
* @type {boolean}
* @readOnly
@ -84,7 +84,7 @@ var DynamicTilemapLayer = new Class({
/**
* The Tilemap that this layer is a part of.
*
*
* @name Phaser.Tilemaps.DynamicTilemapLayer#tilemap
* @type {Phaser.Tilemaps.Tilemap}
* @since 3.0.0
@ -93,7 +93,7 @@ var DynamicTilemapLayer = new Class({
/**
* The index of the LayerData associated with this layer.
*
*
* @name Phaser.Tilemaps.DynamicTilemapLayer#layerIndex
* @type {integer}
* @since 3.0.0
@ -103,7 +103,7 @@ var DynamicTilemapLayer = new Class({
/**
* The LayerData associated with this layer. LayerData can only be associated with one
* tilemap layer.
*
*
* @name Phaser.Tilemaps.DynamicTilemapLayer#layer
* @type {Phaser.Tilemaps.LayerData}
* @since 3.0.0
@ -114,7 +114,7 @@ var DynamicTilemapLayer = new Class({
/**
* The Tileset associated with this layer. A tilemap layer can only render from one Tileset.
*
*
* @name Phaser.Tilemaps.DynamicTilemapLayer#tileset
* @type {Phaser.Tilemaps.Tileset}
* @since 3.0.0
@ -124,7 +124,7 @@ var DynamicTilemapLayer = new Class({
/**
* Used internally with the canvas render. This holds the tiles that are visible within the
* camera.
*
*
* @name Phaser.Tilemaps.DynamicTilemapLayer#culledTiles
* @type {array}
* @since 3.0.0
@ -143,10 +143,10 @@ var DynamicTilemapLayer = new Class({
* Calculates interesting faces at the given tile coordinates of the specified layer. Interesting
* faces are used internally for optimizing collisions against tiles. This method is mostly used
* internally to optimize recalculating faces when only one tile has been changed.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesAt
* @since 3.0.0
*
*
* @param {integer} tileX - The x coordinate.
* @param {integer} tileY - The y coordinate.
*
@ -163,10 +163,10 @@ var DynamicTilemapLayer = new Class({
* Calculates interesting faces within the rectangular area specified (in tile coordinates) of the
* layer. Interesting faces are used internally for optimizing collisions against tiles. This method
* is mostly used internally.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesWithin
* @since 3.0.0
*
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
@ -186,10 +186,10 @@ var DynamicTilemapLayer = new Class({
* optionally specify if each tile will be replaced with a new tile after the Sprite has been
* created. This is useful if you want to lay down special tiles in a level that are converted to
* Sprites, but want to replace the tile itself with a floor tile or similar once converted.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#createFromTiles
* @since 3.0.0
*
*
* @param {integer|array} indexes - The tile index, or array of indexes, to create Sprites from.
* @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
@ -209,10 +209,10 @@ var DynamicTilemapLayer = new Class({
/**
* Returns the tiles in the given layer that are within the cameras viewport.
* This is used internally.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#cull
* @since 3.0.0
*
*
* @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against.
*
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
@ -226,10 +226,10 @@ var DynamicTilemapLayer = new Class({
* Copies the tiles in the source rectangular area to a new destination (all specified in tile
* coordinates) within the layer. This copies all tile properties & recalculates collision
* information in the destination region.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#copy
* @since 3.0.0
*
*
* @param {integer} srcTileX - [description]
* @param {integer} srcTileY - [description]
* @param {integer} width - [description]
@ -250,7 +250,7 @@ var DynamicTilemapLayer = new Class({
/**
* Destroys this DynamicTilemapLayer and removes its link to the associated LayerData.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#destroy
* @since 3.0.0
*/
@ -274,10 +274,10 @@ var DynamicTilemapLayer = new Class({
* Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the
* specified index. Tiles will be set to collide if the given index is a colliding index.
* Collision information in the region will be recalculated.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#fill
* @since 3.0.0
*
*
* @param {integer} index - [description]
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
@ -298,10 +298,10 @@ var DynamicTilemapLayer = new Class({
* For each tile in the given rectangular area (in tile coordinates) of the layer, run the given
* filter callback function. Any tiles that pass the filter test (i.e. where the callback returns
* true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#filterTiles
* @since 3.0.0
*
*
* @param {function} callback - The callback. Each tile in the given area will be passed to this
* callback as the first and only parameter. The callback should return true for tiles that pass the
* filter.
@ -331,10 +331,10 @@ var DynamicTilemapLayer = new Class({
* continues horizontally until it hits the end of the row, then it drops down to the next column.
* If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to
* the top-left.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#findByIndex
* @since 3.0.0
*
*
* @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
@ -351,10 +351,10 @@ var DynamicTilemapLayer = new Class({
* Find the first tile in the given rectangular area (in tile coordinates) of the layer that
* satisfies the provided testing function. I.e. finds the first tile for which `callback` returns
* true. Similar to Array.prototype.find in vanilla JS.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#findTile
* @since 3.0.0
*
*
* @param {function} 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.
@ -370,7 +370,7 @@ var DynamicTilemapLayer = new Class({
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
* have at least one interesting face.
*
* @return {Phaser.Tilemaps.Tile|null}
* @return {?Phaser.Tilemaps.Tile}
*/
findTile: function (callback, context, tileX, tileY, width, height, filteringOptions)
{
@ -380,10 +380,10 @@ var DynamicTilemapLayer = new Class({
/**
* For each tile in the given rectangular area (in tile coordinates) of the layer, run the given
* callback. Similar to Array.prototype.forEach in vanilla JS.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#forEachTile
* @since 3.0.0
*
*
* @param {function} 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.
@ -404,16 +404,16 @@ var DynamicTilemapLayer = new Class({
forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions)
{
TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer);
return this;
},
/**
* Gets a tile at the given tile coordinates from the given layer.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAt
* @since 3.0.0
*
*
* @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
@ -428,10 +428,10 @@ var DynamicTilemapLayer = new Class({
/**
* Gets a tile at the given world coordinates from the given layer.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAtWorldXY
* @since 3.0.0
*
*
* @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
@ -448,10 +448,10 @@ var DynamicTilemapLayer = new Class({
/**
* Gets the tiles in the given rectangular area (in tile coordinates) of the layer.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithin
* @since 3.0.0
*
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
@ -474,10 +474,10 @@ var DynamicTilemapLayer = new Class({
/**
* Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle,
* Line, Rectangle or Triangle. The shape should be in world coordinates.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinShape
* @since 3.0.0
*
*
* @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
@ -497,10 +497,10 @@ var DynamicTilemapLayer = new Class({
/**
* Gets the tiles in the given rectangular area (in world coordinates) of the layer.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinWorldXY
* @since 3.0.0
*
*
* @param {number} worldX - [description]
* @param {number} worldY - [description]
* @param {number} width - [description]
@ -524,10 +524,10 @@ var DynamicTilemapLayer = new Class({
/**
* Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns
* false if there is no tile or if the tile at that location has an index of -1.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAt
* @since 3.0.0
*
*
* @param {integer} tileX - [description]
* @param {integer} tileY - [description]
*
@ -541,10 +541,10 @@ var DynamicTilemapLayer = new Class({
/**
* Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns
* false if there is no tile or if the tile at that location has an index of -1.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAtWorldXY
* @since 3.0.0
*
*
* @param {number} worldX - [description]
* @param {number} worldY - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
@ -561,10 +561,10 @@ var DynamicTilemapLayer = new Class({
* or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified
* location. If you pass in an index, only the index at the specified location will be changed.
* Collision information will be recalculated at the specified location.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAt
* @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]
@ -582,10 +582,10 @@ var DynamicTilemapLayer = new Class({
* an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the
* specified location. If you pass in an index, only the index at the specified location will be
* changed. Collision information will be recalculated at the specified location.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAtWorldXY
* @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]
@ -605,10 +605,10 @@ var DynamicTilemapLayer = new Class({
* all attributes will be copied over to the specified location. If you pass in an index, only the
* index at the specified location will be changed. Collision information will be recalculated
* within the region tiles were changed.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#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]
@ -630,10 +630,10 @@ var DynamicTilemapLayer = new Class({
* those will be used for randomly assigning new tile indexes. If an array is not provided, the
* indexes found within the region (excluding -1) will be used for randomly assigning new tile
* indexes. This method only modifies tile indexes and does not change collision information.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#randomize
* @since 3.0.0
*
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
@ -652,10 +652,10 @@ var DynamicTilemapLayer = new Class({
/**
* Removes the tile at the given tile coordinates in the specified layer and updates the layer's
* collision information.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAt
* @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]
@ -673,10 +673,10 @@ var DynamicTilemapLayer = new Class({
/**
* Removes the tile at the given world coordinates in the specified layer and updates the layer's
* collision information.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAtWorldXY
* @since 3.0.0
*
*
* @param {integer|Phaser.Tilemaps.Tile} tile - The index of this tile to set or a Tile object.
* @param {number} worldX - [description]
* @param {number} worldY - [description]
@ -697,17 +697,17 @@ var DynamicTilemapLayer = new Class({
* get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles
* are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation
* wherever you want on the screen.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#renderDebug
* @since 3.0.0
*
*
* @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|null} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at
* @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|null} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled
* @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|null} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting
* @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.
*
* @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.
@ -723,10 +723,10 @@ var DynamicTilemapLayer = new Class({
* Scans the given rectangular area (given in tile coordinates) for tiles with an index matching
* `findIndex` and updates their index to match `newIndex`. This only modifies the index and does
* not change collision information.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#replaceByIndex
* @since 3.0.0
*
*
* @param {integer} findIndex - [description]
* @param {integer} newIndex - [description]
* @param {integer} [tileX=0] - [description]
@ -747,10 +747,10 @@ var DynamicTilemapLayer = new Class({
* Sets collision on the given tile or tiles within a layer by index. You can pass in either a
* single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if
* collision will be enabled (true) or disabled (false).
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#setCollision
* @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.
@ -771,10 +771,10 @@ var DynamicTilemapLayer = new Class({
* `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set
* collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be
* enabled (true) or disabled (false).
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionBetween
* @since 3.0.0
*
*
* @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
@ -799,7 +799,7 @@ var DynamicTilemapLayer = new Class({
* has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can
* also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a
* "types" property that matches any of those values, its collision flag will be updated.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByProperty
* @since 3.0.0
*
@ -809,7 +809,7 @@ var DynamicTilemapLayer = new Class({
* collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the
* update.
*
*
* @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object.
*/
setCollisionByProperty: function (properties, collides, recalculateFaces)
@ -823,10 +823,10 @@ var DynamicTilemapLayer = new Class({
* Sets collision on all tiles in the given layer, except for tiles that have an index specified in
* the given array. The `collides` parameter controls if collision will be enabled (true) or
* disabled (false).
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByExclusion
* @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.
@ -847,10 +847,10 @@ var DynamicTilemapLayer = new Class({
* (typically defined in Tiled within the tileset collision editor). If any objects are found within
* a tiles collision group, the tile's colliding information will be set. The `collides` parameter
* controls if collision will be enabled (true) or disabled (false).
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#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
@ -870,10 +870,10 @@ var DynamicTilemapLayer = new Class({
* 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.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#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 {function} callback - The callback that will be invoked when the tile is collided with.
@ -892,10 +892,10 @@ var DynamicTilemapLayer = new Class({
* Sets a collision callback for the given rectangular area (in tile coordinates) within the layer.
* If a callback is already set for the tile index it will be replaced. Set the callback to null to
* remove it.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#setTileLocationCallback
* @since 3.0.0
*
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
@ -917,10 +917,10 @@ var DynamicTilemapLayer = new Class({
* layer. It will only randomize the tiles in that area, so if they're all the same nothing will
* appear to have changed! This method only modifies tile indexes and does not change collision
* information.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#shuffle
* @since 3.0.0
*
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
@ -939,10 +939,10 @@ var DynamicTilemapLayer = new Class({
* Scans the given rectangular area (given in tile coordinates) for tiles with an index matching
* `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision
* information.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#swapByIndex
* @since 3.0.0
*
*
* @param {integer} tileA - First tile index.
* @param {integer} tileB - Second tile index.
* @param {integer} [tileX=0] - [description]
@ -962,10 +962,10 @@ var DynamicTilemapLayer = new Class({
/**
* Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the
* layers position, scale and scroll.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldX
* @since 3.0.0
*
*
* @param {integer} tileX - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
*
@ -979,10 +979,10 @@ var DynamicTilemapLayer = new Class({
/**
* Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the
* layers position, scale and scroll.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldY
* @since 3.0.0
*
*
* @param {integer} tileY - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
*
@ -997,10 +997,10 @@ var DynamicTilemapLayer = new Class({
* Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the
* layers position, scale and scroll. This will return a new Vector2 object or update the given
* `point` object.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldXY
* @since 3.0.0
*
*
* @param {integer} tileX - [description]
* @param {integer} tileY - [description]
* @param {Phaser.Math.Vector2} [point] - [description]
@ -1027,10 +1027,10 @@ var DynamicTilemapLayer = new Class({
*
* The probability of any index being choose is (the index's weight) / (sum of all weights). This
* method only modifies tile indexes and does not change collision information.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#weightedRandomize
* @since 3.0.0
*
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
@ -1051,10 +1051,10 @@ var DynamicTilemapLayer = new Class({
/**
* Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the
* layers position, scale and scroll.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#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.
@ -1070,10 +1070,10 @@ var DynamicTilemapLayer = new Class({
/**
* Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the
* layers position, scale and scroll.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileXY
* @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.
@ -1090,10 +1090,10 @@ var DynamicTilemapLayer = new Class({
* Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the
* layers position, scale and scroll. This will return a new Vector2 object or update the given
* `point` object.
*
*
* @method Phaser.Tilemaps.DynamicTilemapLayer#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

View file

@ -33,7 +33,7 @@ var ObjectLayer = new Class({
/**
* [description]
*
*
* @name Phaser.Tilemaps.ObjectLayer#name
* @type {string}
* @since 3.0.0
@ -42,7 +42,7 @@ var ObjectLayer = new Class({
/**
* [description]
*
*
* @name Phaser.Tilemaps.ObjectLayer#opacity
* @type {number}
* @since 3.0.0
@ -51,7 +51,7 @@ var ObjectLayer = new Class({
/**
* [description]
*
*
* @name Phaser.Tilemaps.ObjectLayer#properties
* @type {object}
* @since 3.0.0
@ -60,7 +60,7 @@ var ObjectLayer = new Class({
/**
* [description]
*
*
* @name Phaser.Tilemaps.ObjectLayer#propertyTypes
* @type {object}
* @since 3.0.0
@ -69,7 +69,7 @@ var ObjectLayer = new Class({
/**
* [description]
*
*
* @name Phaser.Tilemaps.ObjectLayer#type
* @type {string}
* @since 3.0.0
@ -78,7 +78,7 @@ var ObjectLayer = new Class({
/**
* [description]
*
*
* @name Phaser.Tilemaps.ObjectLayer#visible
* @type {boolean}
* @since 3.0.0
@ -87,9 +87,9 @@ var ObjectLayer = new Class({
/**
* [description]
*
*
* @name Phaser.Tilemaps.ObjectLayer#objects
* @type {array}
* @type {Phaser.GameObjects.GameObject[]}
* @since 3.0.0
*/
this.objects = GetFastValue(config, 'objects', []);

View file

@ -24,7 +24,7 @@ var ParseTilesets = require('./ParseTilesets');
* consumption. However if your map is small or you need to update the tiles dynamically, then leave
* the default value set.
*
* @return {object|null} [description]
* @return {?object} [description]
*/
var ParseWeltmeister = function (name, json, insertNull)
{

View file

@ -28,7 +28,7 @@ var AssignTileProperties = require('./AssignTileProperties');
* consumption. However if your map is small or you need to update the tiles dynamically, then leave
* the default value set.
*
* @return {Phaser.Tilemaps.MapData|null} [description]
* @return {?Phaser.Tilemaps.MapData} [description]
*/
var ParseJSONTiled = function (name, json, insertNull)
{

View file

@ -26,7 +26,7 @@ var Utils = require('../../renderer/webgl/Utils');
* @memberOf Phaser.Tilemaps
* @constructor
* @since 3.0.0
*
*
* @extends Phaser.GameObjects.Components.Alpha
* @extends Phaser.GameObjects.Components.BlendMode
* @extends Phaser.GameObjects.Components.Depth
@ -75,7 +75,7 @@ var StaticTilemapLayer = new Class({
/**
* Used internally by physics system to perform fast type checks.
*
*
* @name Phaser.Tilemaps.StaticTilemapLayer#isTilemap
* @type {boolean}
* @readOnly
@ -85,7 +85,7 @@ var StaticTilemapLayer = new Class({
/**
* The Tilemap that this layer is a part of.
*
*
* @name Phaser.Tilemaps.StaticTilemapLayer#tilemap
* @type {Phaser.Tilemaps.Tilemap}
* @since 3.0.0
@ -94,7 +94,7 @@ var StaticTilemapLayer = new Class({
/**
* The index of the LayerData associated with this layer.
*
*
* @name Phaser.Tilemaps.StaticTilemapLayer#layerIndex
* @type {integer}
* @since 3.0.0
@ -104,7 +104,7 @@ var StaticTilemapLayer = new Class({
/**
* The LayerData associated with this layer. LayerData can only be associated with one
* tilemap layer.
*
*
* @name Phaser.Tilemaps.StaticTilemapLayer#layer
* @type {Phaser.Tilemaps.LayerData}
* @since 3.0.0
@ -115,7 +115,7 @@ var StaticTilemapLayer = new Class({
/**
* The Tileset associated with this layer. A tilemap layer can only render from one Tileset.
*
*
* @name Phaser.Tilemaps.StaticTilemapLayer#tileset
* @type {Phaser.Tilemaps.Tileset}
* @since 3.0.0
@ -125,7 +125,7 @@ var StaticTilemapLayer = new Class({
/**
* Used internally with the canvas render. This holds the tiles that are visible within the
* camera.
*
*
* @name Phaser.Tilemaps.StaticTilemapLayer#culledTiles
* @type {array}
* @since 3.0.0
@ -207,10 +207,10 @@ var StaticTilemapLayer = new Class({
/**
* Upload the tile data to a VBO.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#upload
* @since 3.0.0
*
*
* @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to render to.
*
* @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.
@ -346,10 +346,10 @@ var StaticTilemapLayer = new Class({
* Calculates interesting faces at the given tile coordinates of the specified layer. Interesting
* faces are used internally for optimizing collisions against tiles. This method is mostly used
* internally to optimize recalculating faces when only one tile has been changed.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesAt
* @since 3.0.0
*
*
* @param {integer} tileX - The x coordinate.
* @param {integer} tileY - The y coordinate.
*
@ -366,10 +366,10 @@ var StaticTilemapLayer = new Class({
* Calculates interesting faces within the rectangular area specified (in tile coordinates) of the
* layer. Interesting faces are used internally for optimizing collisions against tiles. This method
* is mostly used internally.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesWithin
* @since 3.0.0
*
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
@ -389,10 +389,10 @@ var StaticTilemapLayer = new Class({
* optionally specify if each tile will be replaced with a new tile after the Sprite has been
* created. This is useful if you want to lay down special tiles in a level that are converted to
* Sprites, but want to replace the tile itself with a floor tile or similar once converted.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#createFromTiles
* @since 3.0.0
*
*
* @param {integer|array} indexes - The tile index, or array of indexes, to create Sprites from.
* @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
@ -412,10 +412,10 @@ var StaticTilemapLayer = new Class({
/**
* Returns the tiles in the given layer that are within the cameras viewport.
* This is used internally.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#cull
* @since 3.0.0
*
*
* @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against.
*
* @return {Phaser.Tilemaps.Tile[]} An array of Tile objects.
@ -427,7 +427,7 @@ var StaticTilemapLayer = new Class({
/**
* Destroys this StaticTilemapLayer and removes its link to the associated LayerData.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#destroy
* @since 3.0.0
*/
@ -452,10 +452,10 @@ var StaticTilemapLayer = new Class({
* continues horizontally until it hits the end of the row, then it drops down to the next column.
* If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to
* the top-left.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#findByIndex
* @since 3.0.0
*
*
* @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
@ -472,10 +472,10 @@ var StaticTilemapLayer = new Class({
* Find the first tile in the given rectangular area (in tile coordinates) of the layer that
* satisfies the provided testing function. I.e. finds the first tile for which `callback` returns
* true. Similar to Array.prototype.find in vanilla JS.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#findTile
* @since 3.0.0
*
*
* @param {function} 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.
@ -491,7 +491,7 @@ var StaticTilemapLayer = new Class({
* @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that
* have at least one interesting face.
*
* @return {Phaser.Tilemaps.Tile|null}
* @return {?Phaser.Tilemaps.Tile}
*/
findTile: function (callback, context, tileX, tileY, width, height, filteringOptions)
{
@ -502,10 +502,10 @@ var StaticTilemapLayer = new Class({
* For each tile in the given rectangular area (in tile coordinates) of the layer, run the given
* filter callback function. Any tiles that pass the filter test (i.e. where the callback returns
* true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#filterTiles
* @since 3.0.0
*
*
* @param {function} callback - The callback. Each tile in the given area will be passed to this
* callback as the first and only parameter. The callback should return true for tiles that pass the
* filter.
@ -532,10 +532,10 @@ var StaticTilemapLayer = new Class({
/**
* For each tile in the given rectangular area (in tile coordinates) of the layer, run the given
* callback. Similar to Array.prototype.forEach in vanilla JS.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#forEachTile
* @since 3.0.0
*
*
* @param {function} 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.
@ -562,10 +562,10 @@ var StaticTilemapLayer = new Class({
/**
* Gets a tile at the given tile coordinates from the given layer.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#getTileAt
* @since 3.0.0
*
*
* @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
@ -580,10 +580,10 @@ var StaticTilemapLayer = new Class({
/**
* Gets a tile at the given world coordinates from the given layer.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#getTileAtWorldXY
* @since 3.0.0
*
*
* @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
@ -600,10 +600,10 @@ var StaticTilemapLayer = new Class({
/**
* Gets the tiles in the given rectangular area (in tile coordinates) of the layer.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithin
* @since 3.0.0
*
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
@ -625,10 +625,10 @@ var StaticTilemapLayer = new Class({
/**
* Gets the tiles in the given rectangular area (in world coordinates) of the layer.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinWorldXY
* @since 3.0.0
*
*
* @param {number} worldX - [description]
* @param {number} worldY - [description]
* @param {number} width - [description]
@ -652,10 +652,10 @@ var StaticTilemapLayer = new Class({
/**
* Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle,
* Line, Rectangle or Triangle. The shape should be in world coordinates.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinShape
* @since 3.0.0
*
*
* @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
@ -676,10 +676,10 @@ var StaticTilemapLayer = new Class({
/**
* Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns
* false if there is no tile or if the tile at that location has an index of -1.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAt
* @since 3.0.0
*
*
* @param {integer} tileX - [description]
* @param {integer} tileY - [description]
*
@ -693,10 +693,10 @@ var StaticTilemapLayer = new Class({
/**
* Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns
* false if there is no tile or if the tile at that location has an index of -1.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAtWorldXY
* @since 3.0.0
*
*
* @param {number} worldX - [description]
* @param {number} worldY - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
@ -713,17 +713,17 @@ var StaticTilemapLayer = new Class({
* get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles
* are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation
* wherever you want on the screen.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#renderDebug
* @since 3.0.0
*
*
* @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|null} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at
* @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|null} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled
* @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|null} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting
* @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.
*
* @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.
@ -739,10 +739,10 @@ var StaticTilemapLayer = new Class({
* Sets collision on the given tile or tiles within a layer by index. You can pass in either a
* single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if
* collision will be enabled (true) or disabled (false).
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#setCollision
* @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.
@ -763,10 +763,10 @@ var StaticTilemapLayer = new Class({
* `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set
* collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be
* enabled (true) or disabled (false).
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionBetween
* @since 3.0.0
*
*
* @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
@ -791,7 +791,7 @@ var StaticTilemapLayer = new Class({
* has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can
* also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a
* "types" property that matches any of those values, its collision flag will be updated.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByProperty
* @since 3.0.0
*
@ -801,7 +801,7 @@ var StaticTilemapLayer = new Class({
* collision.
* @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the
* update.
*
*
* @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object.
*/
setCollisionByProperty: function (properties, collides, recalculateFaces)
@ -815,10 +815,10 @@ var StaticTilemapLayer = new Class({
* Sets collision on all tiles in the given layer, except for tiles that have an index specified in
* the given array. The `collides` parameter controls if collision will be enabled (true) or
* disabled (false).
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByExclusion
* @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.
@ -839,10 +839,10 @@ var StaticTilemapLayer = new Class({
* 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.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#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 {function} callback - The callback that will be invoked when the tile is collided with.
@ -862,10 +862,10 @@ var StaticTilemapLayer = new Class({
* (typically defined in Tiled within the tileset collision editor). If any objects are found within
* a tiles collision group, the tile's colliding information will be set. The `collides` parameter
* controls if collision will be enabled (true) or disabled (false).
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#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
@ -884,10 +884,10 @@ var StaticTilemapLayer = new Class({
* Sets a collision callback for the given rectangular area (in tile coordinates) within the layer.
* If a callback is already set for the tile index it will be replaced. Set the callback to null to
* remove it.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#setTileLocationCallback
* @since 3.0.0
*
*
* @param {integer} [tileX=0] - [description]
* @param {integer} [tileY=0] - [description]
* @param {integer} [width=max width based on tileX] - [description]
@ -907,10 +907,10 @@ var StaticTilemapLayer = new Class({
/**
* Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the
* layers position, scale and scroll.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldX
* @since 3.0.0
*
*
* @param {integer} tileX - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
*
@ -924,10 +924,10 @@ var StaticTilemapLayer = new Class({
/**
* Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the
* layers position, scale and scroll.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldY
* @since 3.0.0
*
*
* @param {integer} tileY - [description]
* @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - [description]
*
@ -942,10 +942,10 @@ var StaticTilemapLayer = new Class({
* Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the
* layers position, scale and scroll. This will return a new Vector2 object or update the given
* `point` object.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldXY
* @since 3.0.0
*
*
* @param {integer} tileX - [description]
* @param {integer} tileY - [description]
* @param {Phaser.Math.Vector2} [point] - [description]
@ -961,10 +961,10 @@ var StaticTilemapLayer = new Class({
/**
* Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the
* layers position, scale and scroll.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#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.
@ -980,10 +980,10 @@ var StaticTilemapLayer = new Class({
/**
* Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the
* layers position, scale and scroll.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileXY
* @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.
@ -1000,10 +1000,10 @@ var StaticTilemapLayer = new Class({
* Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the
* layers position, scale and scroll. This will return a new Vector2 object or update the given
* `point` object.
*
*
* @method Phaser.Tilemaps.StaticTilemapLayer#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