diff --git a/README.md b/README.md
index d8351756..d7764c7a 100644
--- a/README.md
+++ b/README.md
@@ -79,6 +79,7 @@ Bug Fixes:
* Fixed easing tween example case. Issue #379 (thanks wesleywerner)
* Removed SAT.js UMD wrapped, fixes issue #361 (thanks luizbills)
* Removed inContact check from Body.separate.
+* Fixed Tilemap docs (wrongly pointed to Tileset methods)
See the full Change Log for all the 1.1.4 updates and API changes (as there were a lot of them!)
diff --git a/build/phaser.js b/build/phaser.js
index 0d47d086..4b6ad76a 100644
--- a/build/phaser.js
+++ b/build/phaser.js
@@ -18,7 +18,7 @@
*
* Phaser - http://www.phaser.io
*
-* v1.1.5 - Built at: Wed Feb 12 2014 15:20:51
+* v1.1.5 - Built at: Wed Feb 12 2014 15:32:36
*
* By Richard Davey http://www.photonstorm.com @photonstorm
*
@@ -43097,14 +43097,49 @@ Phaser.Tilemap = function (game, key) {
return;
}
+ /**
+ * @property {number} width - The width of the map (in tiles).
+ */
this.width = data.width;
+
+ /**
+ * @property {number} height - The height of the map (in tiles).
+ */
this.height = data.height;
+
+ /**
+ * @property {number} tileWidth - The base width of the tiles in the map (in pixels).
+ */
this.tileWidth = data.tileWidth;
+
+ /**
+ * @property {number} tileHeight - The base height of the tiles in the map (in pixels).
+ */
this.tileHeight = data.tileHeight;
+
+ /**
+ * @property {string} orientation - The orientation of the map data (as specified in Tiled), usually 'orthogonal'.
+ */
this.orientation = data.orientation;
+
+ /**
+ * @property {number} version - The version of the map data (as specified in Tiled, usually 1).
+ */
this.version = data.version;
+
+ /**
+ * @property {object} properties - Map specific properties as specified in Tiled.
+ */
this.properties = data.properties;
+
+ /**
+ * @property {number} widthInPixels - The width of the map in pixels based on width * tileWidth.
+ */
this.widthInPixels = data.widthInPixels;
+
+ /**
+ * @property {number} heightInPixels - The height of the map in pixels based on height * tileHeight.
+ */
this.heightInPixels = data.heightInPixels;
/**
@@ -43149,13 +43184,13 @@ Phaser.Tilemap = function (game, key) {
this._results = [];
/**
- * @property {number} _tempA - Internal var.
+ * @property {number} _tempA - Internal cache var.
* @private
*/
this._tempA = 0;
/**
- * @property {number} _tempB - Internal var.
+ * @property {number} _tempB - Internal cache var.
* @private
*/
this._tempB = 0;
@@ -43210,7 +43245,7 @@ Phaser.Tilemap.prototype = {
format: Phaser.Tilemap.CSV,
data: data,
indexes: [],
- dirty: true
+ dirty: true
});
@@ -43256,12 +43291,13 @@ Phaser.Tilemap.prototype = {
},
- // Region? Remove tile from map data?
+ /*
createFromTiles: function (layer, tileIndex, key, frame, group) {
if (typeof group === 'undefined') { group = this.game.world; }
},
+ */
/**
* Creates a Sprite for every object matching the given gid in the map data. You can optionally specify the group that the Sprite will be created in. If none is
@@ -43269,7 +43305,7 @@ Phaser.Tilemap.prototype = {
* configure Sprite properties from within the map editor. For example giving an object a property if alpha: 0.5 in the map editor will duplicate that when the
* Sprite is created. You could also give it a value like: body.velocity.x: 100 to set it moving automatically.
*
- * @method Phaser.Tileset#createFromObjects
+ * @method Phaser.Tilemap#createFromObjects
* @param {string} name - The name of the Object Group to create Sprites from.
* @param {number} gid - The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
* @param {string} key - The Game.cache key of the image that this Sprite will use.
@@ -43314,8 +43350,10 @@ Phaser.Tilemap.prototype = {
/**
* Creates a new TilemapLayer object. By default TilemapLayers are fixed to the camera.
+ * The `layer` parameter is important. If you've created your map in Tiled then you can get this by looking in Tiled and looking at the Layer name.
+ * Or you can open the JSON file it exports and look at the layers[].name value. Either way it must match.
*
- * @method Phaser.Tileset#createLayer
+ * @method Phaser.Tilemap#createLayer
* @param {number|string} layer - The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
* @param {number} [width] - The rendered width of the layer, should never be wider than Game.width. If not given it will be set to Game.width.
* @param {number} [height] - The rendered height of the layer, should never be wider than Game.height. If not given it will be set to Game.height.
@@ -43350,7 +43388,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the layer index based on the layers name.
*
- * @method Phaser.Tileset#getIndex
+ * @method Phaser.Tilemap#getIndex
* @protected
* @param {array} location - The local array to search.
* @param {string} name - The name of the array element to get.
@@ -43373,7 +43411,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the layer index based on its name.
*
- * @method Phaser.Tileset#getLayerIndex
+ * @method Phaser.Tilemap#getLayerIndex
* @param {string} name - The name of the layer to get.
* @return {number} The index of the layer in this tilemap, or null if not found.
*/
@@ -43386,7 +43424,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the tileset index based on its name.
*
- * @method Phaser.Tileset#getTilesetIndex
+ * @method Phaser.Tilemap#getTilesetIndex
* @param {string} name - The name of the tileset to get.
* @return {number} The index of the tileset in this tilemap, or null if not found.
*/
@@ -43399,7 +43437,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the image index based on its name.
*
- * @method Phaser.Tileset#getImageIndex
+ * @method Phaser.Tilemap#getImageIndex
* @param {string} name - The name of the image to get.
* @return {number} The index of the image in this tilemap, or null if not found.
*/
@@ -43412,7 +43450,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the object index based on its name.
*
- * @method Phaser.Tileset#getObjectIndex
+ * @method Phaser.Tilemap#getObjectIndex
* @param {string} name - The name of the object to get.
* @return {number} The index of the object in this tilemap, or null if not found.
*/
@@ -43427,7 +43465,7 @@ Phaser.Tilemap.prototype = {
* 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.Tileset#setTileIndexCallback
+ * @method Phaser.Tilemap#setTileIndexCallback
* @param {number|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.
@@ -43458,7 +43496,7 @@ Phaser.Tilemap.prototype = {
* 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.Tileset#setTileLocationCallback
+ * @method Phaser.Tilemap#setTileLocationCallback
* @param {number} x - X position of the top left of the area to copy (given in tiles, not pixels)
* @param {number} y - Y position of the top left of the area to copy (given in tiles, not pixels)
* @param {number} width - The width of the area to copy (given in tiles, not pixels)
@@ -43489,7 +43527,7 @@ Phaser.Tilemap.prototype = {
* Sets collision the given tile or tiles. 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.Tileset#setCollision
+ * @method Phaser.Tilemap#setCollision
* @param {number|array} indexes - Either a single tile index, or an array of tile IDs to be checked for collision.
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
* @param {number|string|Phaser.TilemapLayer} [layer] - The layer to operate on. If not given will default to this.currentLayer.
@@ -43523,7 +43561,7 @@ Phaser.Tilemap.prototype = {
* 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.Tileset#setCollisionBetween
+ * @method Phaser.Tilemap#setCollisionBetween
* @param {number} start - The first index of the tile to be set for collision.
* @param {number} 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.
@@ -43554,7 +43592,7 @@ Phaser.Tilemap.prototype = {
* Sets collision on all tiles in the given layer, except for the IDs of those in the given array.
* The `collides` parameter controls if collision will be enabled (true) or disabled (false).
*
- * @method Phaser.Tileset#setCollisionByExclusion
+ * @method Phaser.Tilemap#setCollisionByExclusion
* @param {array} indexes - An array of the tile IDs to not be counted for collision.
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
* @param {number|string|Phaser.TilemapLayer} [layer] - The layer to operate on. If not given will default to this.currentLayer.
@@ -43583,7 +43621,7 @@ Phaser.Tilemap.prototype = {
* Sets collision values on a tile in the set.
* You shouldn't usually call this method directly, instead use setCollision, setCollisionBetween or setCollisionByExclusion.
*
- * @method Phaser.Tileset#setCollisionByIndex
+ * @method Phaser.Tilemap#setCollisionByIndex
* @protected
* @param {number} index - The index of the tile on the layer.
* @param {boolean} [collides=true] - If true it will enable collision on the tile. If false it will clear collision values from the tile.
@@ -43626,7 +43664,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the TilemapLayer index as used in the setCollision calls.
*
- * @method Phaser.Tileset#getLayer
+ * @method Phaser.Tilemap#getLayer
* @protected
* @param {number|string|Phaser.TilemapLayer} layer - The layer to operate on. If not given will default to this.currentLayer.
* @return {number} The TilemapLayer index.
@@ -43657,7 +43695,7 @@ Phaser.Tilemap.prototype = {
/**
* Internal function.
*
- * @method Phaser.Tileset#calculateFaces
+ * @method Phaser.Tilemap#calculateFaces
* @protected
* @param {number} layer - The index of the TilemapLayer to operate on.
*/
@@ -43714,7 +43752,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile above the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileAbove
+ * @method Phaser.Tilemap#getTileAbove
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -43734,7 +43772,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile below the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileBelow
+ * @method Phaser.Tilemap#getTileBelow
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -43754,7 +43792,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile to the left of the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileLeft
+ * @method Phaser.Tilemap#getTileLeft
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -43774,7 +43812,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile to the right of the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileRight
+ * @method Phaser.Tilemap#getTileRight
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -43831,7 +43869,7 @@ Phaser.Tilemap.prototype = {
this.layers[layer].data[y][x].index = tile;
}
- this.layers[layer].dirty = true;
+ this.layers[layer].dirty = true;
this.calculateFaces(layer);
}
@@ -43991,7 +44029,7 @@ Phaser.Tilemap.prototype = {
this.layers[layer].data[ diffY + tileblock[i].y ][ diffX + tileblock[i].x ].copy(tileblock[i]);
}
- this.layers[layer].dirty = true;
+ this.layers[layer].dirty = true;
this.calculateFaces(layer);
},
diff --git a/build/phaser.min.js b/build/phaser.min.js
index 123d53e4..e5c87920 100644
--- a/build/phaser.min.js
+++ b/build/phaser.min.js
@@ -10,4 +10,4 @@
},repeat:function(a,b,c,d){return this.create(a,!1,b,c,d,Array.prototype.splice.call(arguments,4))},loop:function(a,b,c){return this.create(a,!0,0,b,c,Array.prototype.splice.call(arguments,3))},start:function(){this._started=this.game.time.now,this.running=!0},stop:function(){this.running=!1,this.events.length=0},remove:function(a){for(var b=0;b
new PIXI.Polygon(x,y, x,y, x,
diff --git a/docs/Phaser.QuadTree.html b/docs/Phaser.QuadTree.html
index f97069a0..ac6c6a12 100644
--- a/docs/Phaser.QuadTree.html
+++ b/docs/Phaser.QuadTree.html
@@ -1634,7 +1634,7 @@ Split the node into 4 subnodes
diff --git a/docs/Phaser.RandomDataGenerator.html b/docs/Phaser.RandomDataGenerator.html
index 6df624e0..6c5188d8 100644
--- a/docs/Phaser.RandomDataGenerator.html
+++ b/docs/Phaser.RandomDataGenerator.html
@@ -2051,7 +2051,7 @@ Random number generator from
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 12 2014 15:23:45 GMT-0000 (GMT) using the DocStrap template.
+ on Wed Feb 12 2014 15:32:20 GMT-0000 (GMT) using the DocStrap template.
diff --git a/docs/Phaser.Rectangle.html b/docs/Phaser.Rectangle.html
index 69d98a4a..733b03d7 100644
--- a/docs/Phaser.Rectangle.html
+++ b/docs/Phaser.Rectangle.html
@@ -7392,7 +7392,7 @@ This method checks the x, y, width, and height properties of the Rectangles.
diff --git a/docs/Phaser.RenderTexture.html b/docs/Phaser.RenderTexture.html
index e2944bc7..d2b7d6d9 100644
--- a/docs/Phaser.RenderTexture.html
+++ b/docs/Phaser.RenderTexture.html
@@ -1994,7 +1994,7 @@ If the display object is a Group or has children it will draw all children as we
diff --git a/docs/Phaser.RequestAnimationFrame.html b/docs/Phaser.RequestAnimationFrame.html
index 8a713f23..2c6128ef 100644
--- a/docs/Phaser.RequestAnimationFrame.html
+++ b/docs/Phaser.RequestAnimationFrame.html
@@ -1317,7 +1317,7 @@
diff --git a/docs/Phaser.Signal.html b/docs/Phaser.Signal.html
index f7acc3d6..7fd45304 100644
--- a/docs/Phaser.Signal.html
+++ b/docs/Phaser.Signal.html
@@ -2302,7 +2302,7 @@ IMPORTANT: should be called only during signal dispatch, calling it before/after
diff --git a/docs/Phaser.SinglePad.html b/docs/Phaser.SinglePad.html
index 9a383f20..54735128 100644
--- a/docs/Phaser.SinglePad.html
+++ b/docs/Phaser.SinglePad.html
@@ -3789,7 +3789,7 @@ analog trigger buttons on the XBOX 360 controller
diff --git a/docs/Phaser.Sound.html b/docs/Phaser.Sound.html
index f4a5f875..108aa58a 100644
--- a/docs/Phaser.Sound.html
+++ b/docs/Phaser.Sound.html
@@ -5813,7 +5813,7 @@ This allows you to bundle multiple sounds together into a single audio file and
diff --git a/docs/Phaser.SoundManager.html b/docs/Phaser.SoundManager.html
index 61baf5f0..1602f767 100644
--- a/docs/Phaser.SoundManager.html
+++ b/docs/Phaser.SoundManager.html
@@ -2871,7 +2871,7 @@ Note: On Firefox 25+ on Linux if you have media.gstreamer disabled in about:conf
diff --git a/docs/Phaser.Sprite.html b/docs/Phaser.Sprite.html
index 00cfdf67..8665b71a 100644
--- a/docs/Phaser.Sprite.html
+++ b/docs/Phaser.Sprite.html
@@ -7955,7 +7955,7 @@ It will dispatch the onRevived event, you can listen to Sprite.events.onRevived
diff --git a/docs/Phaser.Stage.html b/docs/Phaser.Stage.html
index 387e2f15..475c1228 100644
--- a/docs/Phaser.Stage.html
+++ b/docs/Phaser.Stage.html
@@ -1944,7 +1944,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
diff --git a/docs/Phaser.StageScaleMode.html b/docs/Phaser.StageScaleMode.html
index a1a18bc7..fc33400f 100644
--- a/docs/Phaser.StageScaleMode.html
+++ b/docs/Phaser.StageScaleMode.html
@@ -4918,7 +4918,7 @@ Please note that this needs to be supported by the web browser and isn't the sam
diff --git a/docs/Phaser.State.html b/docs/Phaser.State.html
index abab9677..2af10025 100644
--- a/docs/Phaser.State.html
+++ b/docs/Phaser.State.html
@@ -2582,7 +2582,7 @@ If you need to use the loader, you may need to use them here.
diff --git a/docs/Phaser.StateManager.html b/docs/Phaser.StateManager.html
index b55fde6e..c0dfa54c 100644
--- a/docs/Phaser.StateManager.html
+++ b/docs/Phaser.StateManager.html
@@ -3268,7 +3268,7 @@ State must exist and have at least one callback function registered..
diff --git a/docs/Phaser.Text.html b/docs/Phaser.Text.html
index 7146feb1..89174689 100644
--- a/docs/Phaser.Text.html
+++ b/docs/Phaser.Text.html
@@ -2574,7 +2574,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
diff --git a/docs/Phaser.Tile.html b/docs/Phaser.Tile.html
index 27e6086b..4dcba3a7 100644
--- a/docs/Phaser.Tile.html
+++ b/docs/Phaser.Tile.html
@@ -3979,7 +3979,7 @@ The callback must true true for collision processing to take place.
diff --git a/docs/Phaser.TileSprite.html b/docs/Phaser.TileSprite.html
index 27152725..8e065c04 100644
--- a/docs/Phaser.TileSprite.html
+++ b/docs/Phaser.TileSprite.html
@@ -8590,7 +8590,7 @@ It will dispatch the onRevived event, you can listen to Sprite.events.onRevived
diff --git a/docs/Phaser.Tilemap.html b/docs/Phaser.Tilemap.html
index 2bcf4b59..51864888 100644
--- a/docs/Phaser.Tilemap.html
+++ b/docs/Phaser.Tilemap.html
@@ -666,7 +666,7 @@ A map may have multiple layers. You can perform operations on the map data such
Source:
@@ -726,7 +726,7 @@ A map may have multiple layers. You can perform operations on the map data such
Source:
@@ -828,7 +828,7 @@ A map may have multiple layers. You can perform operations on the map data such
Source:
@@ -930,7 +930,7 @@ A map may have multiple layers. You can perform operations on the map data such
Source:
@@ -1041,6 +1041,210 @@ A map may have multiple layers. You can perform operations on the map data such
+
+
+
+
+
+
+
+
+
+ height
+
+
+
+
+
+
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ height
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The height of the map (in tiles).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ heightInPixels
+
+
+
+
+
+
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ heightInPixels
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The height of the map in pixels based on height * tileHeight.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
@@ -1134,7 +1338,7 @@ A map may have multiple layers. You can perform operations on the map data such
Source:
@@ -1338,7 +1542,7 @@ A map may have multiple layers. You can perform operations on the map data such
Source:
@@ -1440,7 +1644,313 @@ A map may have multiple layers. You can perform operations on the map data such
Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ orientation
+
+
+
+
+
+
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ orientation
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+ The orientation of the map data (as specified in Tiled), usually 'orthogonal'.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ properties
+
+
+
+
+
+
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ properties
+
+
+
+
+
+object
+
+
+
+
+
+
+
+
+
+ Map specific properties as specified in Tiled.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tileHeight
+
+
+
+
+
+
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ tileHeight
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The base height of the tiles in the map (in pixels).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -1542,7 +2052,7 @@ A map may have multiple layers. You can perform operations on the map data such
- Source:
@@ -1644,7 +2154,415 @@ A map may have multiple layers. You can perform operations on the map data such
- Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tileWidth
+
+
+
+
+
+
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ tileWidth
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The base width of the tiles in the map (in pixels).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ version
+
+
+
+
+
+
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ version
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The version of the map data (as specified in Tiled, usually 1).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ width
+
+
+
+
+
+
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ width
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The width of the map (in tiles).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ widthInPixels
+
+
+
+
+
+
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ widthInPixels
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The width of the map in pixels based on width * tileWidth.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -1802,7 +2720,125 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
- Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <protected> calculateFaces(layer)
+
+
+
+
+
+
+
+ Internal function.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The index of the TilemapLayer to operate on.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -2062,7 +3098,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
- Source:
@@ -2249,7 +3285,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
- Source:
@@ -2272,6 +3308,623 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
+
+
+
+
+
+ createFromObjects(name, gid, key, frame, exists, autoCull, group)
+
+
+
+
+
+
+
+ Creates a Sprite for every object matching the given gid in the map data. You can optionally specify the group that the Sprite will be created in. If none is
+given it will be created in the World. All properties from the map data objectgroup are copied across to the Sprite, so you can use this as an easy way to
+configure Sprite properties from within the map editor. For example giving an object a property if alpha: 0.5 in the map editor will duplicate that when the
+Sprite is created. You could also give it a value like: body.velocity.x: 100 to set it moving automatically.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+ Argument
+
+
+
+ Default
+
+
+ Description
+
+
+
+
+
+
+
+
+ name
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The name of the Object Group to create Sprites from.
+
+
+
+
+
+
+ gid
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
+
+
+
+
+
+
+ key
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The Game.cache key of the image that this Sprite will use.
+
+
+
+
+
+
+ frame
+
+
+
+
+
+number
+|
+
+string
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If the Sprite image contains multiple frames you can specify which one to use here.
+
+
+
+
+
+
+ exists
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ The default exists state of the Sprite.
+
+
+
+
+
+
+ autoCull
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ The default autoCull state of the Sprite. Sprites that are autoCulled are culled from the camera if out of its range.
+
+
+
+
+
+
+ group
+
+
+
+
+
+Phaser.Group
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Optional Group to add the Sprite to. If not specified it will be added to the World group.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ createLayer(layer, width, height, group) → {Phaser.TilemapLayer}
+
+
+
+
+
+
+
+ Creates a new TilemapLayer object. By default TilemapLayers are fixed to the camera.
+The layer parameter is important. If you've created your map in Tiled then you can get this by looking in Tiled and looking at the Layer name.
+Or you can open the JSON file it exports and look at the layers[].name value. Either way it must match.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+ Argument
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+|
+
+string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
+
+
+
+
+
+
+ width
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+ The rendered width of the layer, should never be wider than Game.width. If not given it will be set to Game.width.
+
+
+
+
+
+
+ height
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+ The rendered height of the layer, should never be wider than Game.height. If not given it will be set to Game.height.
+
+
+
+
+
+
+ group
+
+
+
+
+
+Phaser.Group
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+ Optional Group to add the object to. If not specified it will be added to the World group.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+
+
+ The TilemapLayer object. This is an extension of Phaser.Sprite and can be moved around the display list accordingly.
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Phaser.TilemapLayer
+
+
+
+
+
+
+
+
+
@@ -2318,7 +3971,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
@@ -2387,7 +4040,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
@@ -2678,7 +4331,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
@@ -3000,7 +4653,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
@@ -3023,6 +4676,740 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
+
+
+
+
+
+ getImageIndex(name) → {number}
+
+
+
+
+
+
+
+ Gets the image index based on its name.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ name
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+ The name of the image to get.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+
+
+ The index of the image in this tilemap, or null if not found.
+
+
+
+
+
+ -
+ Type
+
+ -
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <protected> getIndex(location, name) → {number}
+
+
+
+
+
+
+
+ Gets the layer index based on the layers name.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ location
+
+
+
+
+
+array
+
+
+
+
+
+
+
+
+
+ The local array to search.
+
+
+
+
+
+
+ name
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+ The name of the array element to get.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+
+
+ The index of the element in the array, or null if not found.
+
+
+
+
+
+ -
+ Type
+
+ -
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <protected> getLayer(layer) → {number}
+
+
+
+
+
+
+
+ Gets the TilemapLayer index as used in the setCollision calls.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+|
+
+string
+|
+
+Phaser.TilemapLayer
+
+
+
+
+
+
+
+
+
+ The layer to operate on. If not given will default to this.currentLayer.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+
+
+ The TilemapLayer index.
+
+
+
+
+
+ -
+ Type
+
+ -
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getLayerIndex(name) → {number}
+
+
+
+
+
+
+
+ Gets the layer index based on its name.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ name
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+ The name of the layer to get.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+
+
+ The index of the layer in this tilemap, or null if not found.
+
+
+
+
+
+ -
+ Type
+
+ -
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getObjectIndex(name) → {number}
+
+
+
+
+
+
+
+ Gets the object index based on its name.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ name
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+ The name of the object to get.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+
+
+ The index of the object in this tilemap, or null if not found.
+
+
+
+
+
+ -
+ Type
+
+ -
+
+number
+
+
+
+
+
+
+
+
+
@@ -3198,7 +5585,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
@@ -3244,6 +5631,807 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
+
+
+
+
+
+ getTileAbove(layer, x, y)
+
+
+
+
+
+
+
+ Gets the tile above the tile coordinates given.
+Mostly used as an internal function by calculateFaces.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
+
+
+
+
+
+
+ x
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The x coordinate to get the tile from. In tiles, not pixels.
+
+
+
+
+
+
+ y
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The y coordinate to get the tile from. In tiles, not pixels.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getTileBelow(layer, x, y)
+
+
+
+
+
+
+
+ Gets the tile below the tile coordinates given.
+Mostly used as an internal function by calculateFaces.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
+
+
+
+
+
+
+ x
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The x coordinate to get the tile from. In tiles, not pixels.
+
+
+
+
+
+
+ y
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The y coordinate to get the tile from. In tiles, not pixels.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getTileLeft(layer, x, y)
+
+
+
+
+
+
+
+ Gets the tile to the left of the tile coordinates given.
+Mostly used as an internal function by calculateFaces.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
+
+
+
+
+
+
+ x
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The x coordinate to get the tile from. In tiles, not pixels.
+
+
+
+
+
+
+ y
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The y coordinate to get the tile from. In tiles, not pixels.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getTileRight(layer, x, y)
+
+
+
+
+
+
+
+ Gets the tile to the right of the tile coordinates given.
+Mostly used as an internal function by calculateFaces.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
+
+
+
+
+
+
+ x
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The x coordinate to get the tile from. In tiles, not pixels.
+
+
+
+
+
+
+ y
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+ The y coordinate to get the tile from. In tiles, not pixels.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getTilesetIndex(name) → {number}
+
+
+
+
+
+
+
+ Gets the tileset index based on its name.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ name
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+ The name of the tileset to get.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Returns:
+
+
+
+ The index of the tileset in this tilemap, or null if not found.
+
+
+
+
+
+ -
+ Type
+
+ -
+
+number
+
+
+
+
+
+
+
+
+
@@ -3419,7 +6607,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
@@ -3671,7 +6859,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
@@ -3903,7 +7091,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
@@ -4197,7 +7385,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
@@ -4457,7 +7645,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
@@ -4526,7 +7714,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
@@ -4848,7 +8036,947 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setCollision(indexes, collides, layer)
+
+
+
+
+
+
+
+ Sets collision the given tile or tiles. 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).
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+ Argument
+
+
+
+ Default
+
+
+ Description
+
+
+
+
+
+
+
+
+ indexes
+
+
+
+
+
+number
+|
+
+array
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Either a single tile index, or an array of tile IDs to be checked for collision.
+
+
+
+
+
+
+ collides
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ If true it will enable collision. If false it will clear collision.
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+|
+
+string
+|
+
+Phaser.TilemapLayer
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The layer to operate on. If not given will default to this.currentLayer.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setCollisionBetween(start, stop, collides, layer)
+
+
+
+
+
+
+
+ Sets collision on a range of tiles where the tile IDs increment sequentially.
+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).
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+ Argument
+
+
+
+ Default
+
+
+ Description
+
+
+
+
+
+
+
+
+ start
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The first index of the tile to be set for collision.
+
+
+
+
+
+
+ stop
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The last index of the tile to be set for collision.
+
+
+
+
+
+
+ collides
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ If true it will enable collision. If false it will clear collision.
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+|
+
+string
+|
+
+Phaser.TilemapLayer
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The layer to operate on. If not given will default to this.currentLayer.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setCollisionByExclusion(indexes, collides, layer)
+
+
+
+
+
+
+
+ Sets collision on all tiles in the given layer, except for the IDs of those in the given array.
+The collides parameter controls if collision will be enabled (true) or disabled (false).
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+ Argument
+
+
+
+ Default
+
+
+ Description
+
+
+
+
+
+
+
+
+ indexes
+
+
+
+
+
+array
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ An array of the tile IDs to not be counted for collision.
+
+
+
+
+
+
+ collides
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ If true it will enable collision. If false it will clear collision.
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+|
+
+string
+|
+
+Phaser.TilemapLayer
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The layer to operate on. If not given will default to this.currentLayer.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <protected> setCollisionByIndex(index, collides, layer, recalculate)
+
+
+
+
+
+
+
+ Sets collision values on a tile in the set.
+You shouldn't usually call this method directly, instead use setCollision, setCollisionBetween or setCollisionByExclusion.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+ Argument
+
+
+
+ Default
+
+
+ Description
+
+
+
+
+
+
+
+
+ index
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The index of the tile on the layer.
+
+
+
+
+
+
+ collides
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ If true it will enable collision on the tile. If false it will clear collision values from the tile.
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The layer to operate on. If not given will default to this.currentLayer.
+
+
+
+
+
+
+ recalculate
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ Recalculates the tile faces after the update.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -4972,7 +9100,565 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
- Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setTileIndexCallback(indexes, callback, callbackContext, layer)
+
+
+
+
+
+
+
+ Sets a global collision callback for the given tile index within the layer. This will affect all tiles on this layer that have the same index.
+If a callback is already set for the tile index it will be replaced. Set the callback to null to remove it.
+If you want to set a callback for a tile at a specific location on the map then see setTileLocationCallback.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+ Argument
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ indexes
+
+
+
+
+
+number
+|
+
+array
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Either a single tile index, or an array of tile indexes to have a collision callback set for.
+
+
+
+
+
+
+ callback
+
+
+
+
+
+function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The callback that will be invoked when the tile is collided with.
+
+
+
+
+
+
+ callbackContext
+
+
+
+
+
+object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The context under which the callback is called.
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+|
+
+string
+|
+
+Phaser.TilemapLayer
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+ The layer to operate on. If not given will default to this.currentLayer.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setTileLocationCallback(x, y, width, height, callback, callbackContext, layer)
+
+
+
+
+
+
+
+ Sets a global collision callback for the given tile index within the layer. This will affect all tiles on this layer that have the same index.
+If a callback is already set for the tile index it will be replaced. Set the callback to null to remove it.
+If you want to set a callback for a tile at a specific location on the map then see setTileLocationCallback.
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+ Argument
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ x
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ X position of the top left of the area to copy (given in tiles, not pixels)
+
+
+
+
+
+
+ y
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Y position of the top left of the area to copy (given in tiles, not pixels)
+
+
+
+
+
+
+ width
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The width of the area to copy (given in tiles, not pixels)
+
+
+
+
+
+
+ height
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The height of the area to copy (given in tiles, not pixels)
+
+
+
+
+
+
+ callback
+
+
+
+
+
+function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The callback that will be invoked when the tile is collided with.
+
+
+
+
+
+
+ callbackContext
+
+
+
+
+
+object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The context under which the callback is called.
+
+
+
+
+
+
+ layer
+
+
+
+
+
+number
+|
+
+string
+|
+
+Phaser.TilemapLayer
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+ The layer to operate on. If not given will default to this.currentLayer.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
@@ -5232,7 +9918,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
- Source:
@@ -5554,7 +10240,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
- Source:
@@ -5605,7 +10291,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
diff --git a/docs/Phaser.TilemapLayer.html b/docs/Phaser.TilemapLayer.html
index 7a4cdb29..ad9bb3d8 100644
--- a/docs/Phaser.TilemapLayer.html
+++ b/docs/Phaser.TilemapLayer.html
@@ -4614,7 +4614,7 @@ half as quickly as the 'normal' camera-locked layers do)
diff --git a/docs/Phaser.TilemapParser.html b/docs/Phaser.TilemapParser.html
index 53528640..322389a6 100644
--- a/docs/Phaser.TilemapParser.html
+++ b/docs/Phaser.TilemapParser.html
@@ -1457,7 +1457,7 @@
diff --git a/docs/Phaser.Tileset.html b/docs/Phaser.Tileset.html
index b54bc3f3..71893fa2 100644
--- a/docs/Phaser.Tileset.html
+++ b/docs/Phaser.Tileset.html
@@ -1849,124 +1849,6 @@ You should not normally instantiate this class directly.
--
-
<protected> calculateFaces(layer)
-
-
-
--
-
-
-
-
Internal function.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The index of the TilemapLayer to operate on.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
checkTileIndex(index) → {boolean}
@@ -2108,1355 +1990,6 @@ You should not normally instantiate this class directly.
-
-
-
-
-
- createFromObjects(name, gid, key, frame, exists, autoCull, group)
-
-
-
-
-
-
-
- Creates a Sprite for every object matching the given gid in the map data. You can optionally specify the group that the Sprite will be created in. If none is
-given it will be created in the World. All properties from the map data objectgroup are copied across to the Sprite, so you can use this as an easy way to
-configure Sprite properties from within the map editor. For example giving an object a property if alpha: 0.5 in the map editor will duplicate that when the
-Sprite is created. You could also give it a value like: body.velocity.x: 100 to set it moving automatically.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
- Argument
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- name
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The name of the Object Group to create Sprites from.
-
-
-
-
-
-
- gid
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
-
-
-
-
-
-
- key
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The Game.cache key of the image that this Sprite will use.
-
-
-
-
-
-
- frame
-
-
-
-
-
-number
-|
-
-string
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- If the Sprite image contains multiple frames you can specify which one to use here.
-
-
-
-
-
-
- exists
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
- The default exists state of the Sprite.
-
-
-
-
-
-
- autoCull
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
- The default autoCull state of the Sprite. Sprites that are autoCulled are culled from the camera if out of its range.
-
-
-
-
-
-
- group
-
-
-
-
-
-Phaser.Group
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Optional Group to add the Sprite to. If not specified it will be added to the World group.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- createLayer(layer, width, height, group) → {Phaser.TilemapLayer}
-
-
-
-
-
-
-
- Creates a new TilemapLayer object. By default TilemapLayers are fixed to the camera.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
- Argument
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-|
-
-string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
-
-
-
-
-
-
- width
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
- The rendered width of the layer, should never be wider than Game.width. If not given it will be set to Game.width.
-
-
-
-
-
-
- height
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
- The rendered height of the layer, should never be wider than Game.height. If not given it will be set to Game.height.
-
-
-
-
-
-
- group
-
-
-
-
-
-Phaser.Group
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
- Optional Group to add the object to. If not specified it will be added to the World group.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns:
-
-
-
- The TilemapLayer object. This is an extension of Phaser.Sprite and can be moved around the display list accordingly.
-
-
-
-
-
- -
- Type
-
- -
-
-Phaser.TilemapLayer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getImageIndex(name) → {number}
-
-
-
-
-
-
-
- Gets the image index based on its name.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- name
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
-
- The name of the image to get.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns:
-
-
-
- The index of the image in this tilemap, or null if not found.
-
-
-
-
-
- -
- Type
-
- -
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <protected> getIndex(location, name) → {number}
-
-
-
-
-
-
-
- Gets the layer index based on the layers name.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- location
-
-
-
-
-
-array
-
-
-
-
-
-
-
-
-
- The local array to search.
-
-
-
-
-
-
- name
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
-
- The name of the array element to get.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns:
-
-
-
- The index of the element in the array, or null if not found.
-
-
-
-
-
- -
- Type
-
- -
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <protected> getLayer(layer) → {number}
-
-
-
-
-
-
-
- Gets the TilemapLayer index as used in the setCollision calls.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-|
-
-string
-|
-
-Phaser.TilemapLayer
-
-
-
-
-
-
-
-
-
- The layer to operate on. If not given will default to this.currentLayer.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns:
-
-
-
- The TilemapLayer index.
-
-
-
-
-
- -
- Type
-
- -
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getLayerIndex(name) → {number}
-
-
-
-
-
-
-
- Gets the layer index based on its name.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- name
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
-
- The name of the layer to get.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns:
-
-
-
- The index of the layer in this tilemap, or null if not found.
-
-
-
-
-
- -
- Type
-
- -
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getObjectIndex(name) → {number}
-
-
-
-
-
-
-
- Gets the object index based on its name.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- name
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
-
- The name of the object to get.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns:
-
-
-
- The index of the object in this tilemap, or null if not found.
-
-
-
-
-
- -
- Type
-
- -
-
-number
-
-
-
-
-
-
-
-
-
@@ -3602,807 +2135,6 @@ Sprite is created. You could also give it a value like: body.velocity.x: 100 to
-
-
-
-
-
- getTileAbove(layer, x, y)
-
-
-
-
-
-
-
- Gets the tile above the tile coordinates given.
-Mostly used as an internal function by calculateFaces.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
-
-
-
-
-
-
- x
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The x coordinate to get the tile from. In tiles, not pixels.
-
-
-
-
-
-
- y
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The y coordinate to get the tile from. In tiles, not pixels.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getTileBelow(layer, x, y)
-
-
-
-
-
-
-
- Gets the tile below the tile coordinates given.
-Mostly used as an internal function by calculateFaces.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
-
-
-
-
-
-
- x
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The x coordinate to get the tile from. In tiles, not pixels.
-
-
-
-
-
-
- y
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The y coordinate to get the tile from. In tiles, not pixels.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getTileLeft(layer, x, y)
-
-
-
-
-
-
-
- Gets the tile to the left of the tile coordinates given.
-Mostly used as an internal function by calculateFaces.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
-
-
-
-
-
-
- x
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The x coordinate to get the tile from. In tiles, not pixels.
-
-
-
-
-
-
- y
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The y coordinate to get the tile from. In tiles, not pixels.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getTileRight(layer, x, y)
-
-
-
-
-
-
-
- Gets the tile to the right of the tile coordinates given.
-Mostly used as an internal function by calculateFaces.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
-
-
-
-
-
-
- x
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The x coordinate to get the tile from. In tiles, not pixels.
-
-
-
-
-
-
- y
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
- The y coordinate to get the tile from. In tiles, not pixels.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getTilesetIndex(name) → {number}
-
-
-
-
-
-
-
- Gets the tileset index based on its name.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- name
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
-
- The name of the tileset to get.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Returns:
-
-
-
- The index of the tileset in this tilemap, or null if not found.
-
-
-
-
-
- -
- Type
-
- -
-
-number
-
-
-
-
-
-
-
-
-
@@ -4693,946 +2425,6 @@ Mostly used as an internal function by calculateFaces.
-
-
-
-
-
- setCollision(indexes, collides, layer)
-
-
-
-
-
-
-
- Sets collision the given tile or tiles. 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).
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
- Argument
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- indexes
-
-
-
-
-
-number
-|
-
-array
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Either a single tile index, or an array of tile IDs to be checked for collision.
-
-
-
-
-
-
- collides
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
- If true it will enable collision. If false it will clear collision.
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-|
-
-string
-|
-
-Phaser.TilemapLayer
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The layer to operate on. If not given will default to this.currentLayer.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- setCollisionBetween(start, stop, collides, layer)
-
-
-
-
-
-
-
- Sets collision on a range of tiles where the tile IDs increment sequentially.
-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).
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
- Argument
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- start
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The first index of the tile to be set for collision.
-
-
-
-
-
-
- stop
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The last index of the tile to be set for collision.
-
-
-
-
-
-
- collides
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
- If true it will enable collision. If false it will clear collision.
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-|
-
-string
-|
-
-Phaser.TilemapLayer
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The layer to operate on. If not given will default to this.currentLayer.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- setCollisionByExclusion(indexes, collides, layer)
-
-
-
-
-
-
-
- Sets collision on all tiles in the given layer, except for the IDs of those in the given array.
-The collides parameter controls if collision will be enabled (true) or disabled (false).
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
- Argument
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- indexes
-
-
-
-
-
-array
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- An array of the tile IDs to not be counted for collision.
-
-
-
-
-
-
- collides
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
- If true it will enable collision. If false it will clear collision.
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-|
-
-string
-|
-
-Phaser.TilemapLayer
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The layer to operate on. If not given will default to this.currentLayer.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <protected> setCollisionByIndex(index, collides, layer, recalculate)
-
-
-
-
-
-
-
- Sets collision values on a tile in the set.
-You shouldn't usually call this method directly, instead use setCollision, setCollisionBetween or setCollisionByExclusion.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
- Argument
-
-
-
- Default
-
-
- Description
-
-
-
-
-
-
-
-
- index
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The index of the tile on the layer.
-
-
-
-
-
-
- collides
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
- If true it will enable collision on the tile. If false it will clear collision values from the tile.
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The layer to operate on. If not given will default to this.currentLayer.
-
-
-
-
-
-
- recalculate
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
- Recalculates the tile faces after the update.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5796,564 +2588,6 @@ You shouldn't usually call this method directly, instead use setCollision, setCo
-
-
-
-
-
- setTileIndexCallback(indexes, callback, callbackContext, layer)
-
-
-
-
-
-
-
- Sets a global collision callback for the given tile index within the layer. This will affect all tiles on this layer that have the same index.
-If a callback is already set for the tile index it will be replaced. Set the callback to null to remove it.
-If you want to set a callback for a tile at a specific location on the map then see setTileLocationCallback.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
- Argument
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- indexes
-
-
-
-
-
-number
-|
-
-array
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Either a single tile index, or an array of tile indexes to have a collision callback set for.
-
-
-
-
-
-
- callback
-
-
-
-
-
-function
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The callback that will be invoked when the tile is collided with.
-
-
-
-
-
-
- callbackContext
-
-
-
-
-
-object
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The context under which the callback is called.
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-|
-
-string
-|
-
-Phaser.TilemapLayer
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
- The layer to operate on. If not given will default to this.currentLayer.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- setTileLocationCallback(x, y, width, height, callback, callbackContext, layer)
-
-
-
-
-
-
-
- Sets a global collision callback for the given tile index within the layer. This will affect all tiles on this layer that have the same index.
-If a callback is already set for the tile index it will be replaced. Set the callback to null to remove it.
-If you want to set a callback for a tile at a specific location on the map then see setTileLocationCallback.
-
-
-
-
-
-
-
-
- Parameters:
-
-
-
-
-
-
- Name
-
-
- Type
-
-
- Argument
-
-
-
-
- Description
-
-
-
-
-
-
-
-
- x
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- X position of the top left of the area to copy (given in tiles, not pixels)
-
-
-
-
-
-
- y
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Y position of the top left of the area to copy (given in tiles, not pixels)
-
-
-
-
-
-
- width
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The width of the area to copy (given in tiles, not pixels)
-
-
-
-
-
-
- height
-
-
-
-
-
-number
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The height of the area to copy (given in tiles, not pixels)
-
-
-
-
-
-
- callback
-
-
-
-
-
-function
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The callback that will be invoked when the tile is collided with.
-
-
-
-
-
-
- callbackContext
-
-
-
-
-
-object
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The context under which the callback is called.
-
-
-
-
-
-
- layer
-
-
-
-
-
-number
-|
-
-string
-|
-
-Phaser.TilemapLayer
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
- The layer to operate on. If not given will default to this.currentLayer.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - Source:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -6382,7 +2616,7 @@ If you want to set a callback for a tile at a specific location on the map then
diff --git a/docs/Phaser.Time.html b/docs/Phaser.Time.html
index 9de6001b..0e6d2557 100644
--- a/docs/Phaser.Time.html
+++ b/docs/Phaser.Time.html
@@ -3096,7 +3096,7 @@
diff --git a/docs/Phaser.Timer.html b/docs/Phaser.Timer.html
index f46ff4f8..3e878384 100644
--- a/docs/Phaser.Timer.html
+++ b/docs/Phaser.Timer.html
@@ -3760,7 +3760,7 @@ If the Timer is already running the delay will be calculated based on the timers
diff --git a/docs/Phaser.TimerEvent.html b/docs/Phaser.TimerEvent.html
index ba802973..3227c74f 100644
--- a/docs/Phaser.TimerEvent.html
+++ b/docs/Phaser.TimerEvent.html
@@ -1685,7 +1685,7 @@ It can call a specific callback, passing in optional parameters.
diff --git a/docs/Phaser.Touch.html b/docs/Phaser.Touch.html
index 85a02e2d..f4e03a48 100644
--- a/docs/Phaser.Touch.html
+++ b/docs/Phaser.Touch.html
@@ -2655,7 +2655,7 @@ Doesn't appear to be supported by most browsers on a canvas element yet.
diff --git a/docs/Phaser.Tween.html b/docs/Phaser.Tween.html
index 80083f20..e32693d2 100644
--- a/docs/Phaser.Tween.html
+++ b/docs/Phaser.Tween.html
@@ -3144,7 +3144,7 @@ Used in combination with repeat you can create endless loops.
diff --git a/docs/Phaser.TweenManager.html b/docs/Phaser.TweenManager.html
index d0f8503d..c788503a 100644
--- a/docs/Phaser.TweenManager.html
+++ b/docs/Phaser.TweenManager.html
@@ -1648,7 +1648,7 @@ Please see https://github.com/sole/tw
diff --git a/docs/Phaser.Utils.Debug.html b/docs/Phaser.Utils.Debug.html
index 50b2d0d3..a6f2dc12 100644
--- a/docs/Phaser.Utils.Debug.html
+++ b/docs/Phaser.Utils.Debug.html
@@ -6870,7 +6870,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
diff --git a/docs/Phaser.Utils.html b/docs/Phaser.Utils.html
index a59f9f41..de772d78 100644
--- a/docs/Phaser.Utils.html
+++ b/docs/Phaser.Utils.html
@@ -1273,7 +1273,7 @@ dir = 1 (left), 2 (right), 3 (both)
diff --git a/docs/Phaser.World.html b/docs/Phaser.World.html
index ba727649..5d33b67c 100644
--- a/docs/Phaser.World.html
+++ b/docs/Phaser.World.html
@@ -10272,7 +10272,7 @@ Most objects won't have an update method set unless explicitly given one.
diff --git a/docs/Phaser.html b/docs/Phaser.html
index 86e365d9..1f432772 100644
--- a/docs/Phaser.html
+++ b/docs/Phaser.html
@@ -738,7 +738,7 @@
diff --git a/docs/Phaser.js.html b/docs/Phaser.js.html
index 0e8d10a6..1c166445 100644
--- a/docs/Phaser.js.html
+++ b/docs/Phaser.js.html
@@ -502,7 +502,7 @@ PIXI.InteractionManager = function (dummy) {
diff --git a/docs/Plugin.js.html b/docs/Plugin.js.html
index 89b47326..8e3b09a8 100644
--- a/docs/Plugin.js.html
+++ b/docs/Plugin.js.html
@@ -573,7 +573,7 @@ Phaser.Plugin.prototype.constructor = Phaser.Plugin;
diff --git a/docs/PluginManager.js.html b/docs/PluginManager.js.html
index 04fd0f73..42c45cfe 100644
--- a/docs/PluginManager.js.html
+++ b/docs/PluginManager.js.html
@@ -749,7 +749,7 @@ Phaser.PluginManager.prototype.constructor = Phaser.PluginManager;
diff --git a/docs/Point.js.html b/docs/Point.js.html
index cef3ca7e..1a3a3bea 100644
--- a/docs/Point.js.html
+++ b/docs/Point.js.html
@@ -882,7 +882,7 @@ Phaser.Point.rotate = function (a, x, y, angle, asDegrees, distance) {
diff --git a/docs/Pointer.js.html b/docs/Pointer.js.html
index b8f70557..82010aee 100644
--- a/docs/Pointer.js.html
+++ b/docs/Pointer.js.html
@@ -1094,7 +1094,7 @@ Object.defineProperty(Phaser.Pointer.prototype, "worldY", {
diff --git a/docs/Polygon.js.html b/docs/Polygon.js.html
index dbe1fdb6..20edf759 100644
--- a/docs/Polygon.js.html
+++ b/docs/Polygon.js.html
@@ -479,7 +479,7 @@ Phaser.Polygon.prototype.constructor = Phaser.Polygon;
diff --git a/docs/QuadTree.js.html b/docs/QuadTree.js.html
index c0c3a4fe..d9293ac9 100644
--- a/docs/QuadTree.js.html
+++ b/docs/QuadTree.js.html
@@ -737,7 +737,7 @@ Phaser.QuadTree.prototype.constructor = Phaser.QuadTree;
diff --git a/docs/RandomDataGenerator.js.html b/docs/RandomDataGenerator.js.html
index e86d11b9..0840675b 100644
--- a/docs/RandomDataGenerator.js.html
+++ b/docs/RandomDataGenerator.js.html
@@ -699,7 +699,7 @@ Phaser.RandomDataGenerator.prototype.constructor = Phaser.RandomDataGenerator;
diff --git a/docs/Rectangle.js.html b/docs/Rectangle.js.html
index 7e06e39a..3cb911c0 100644
--- a/docs/Rectangle.js.html
+++ b/docs/Rectangle.js.html
@@ -1140,7 +1140,7 @@ Phaser.Rectangle.union = function (a, b, out) {
diff --git a/docs/RenderTexture.js.html b/docs/RenderTexture.js.html
index b694dc4a..fb3a4ce9 100644
--- a/docs/RenderTexture.js.html
+++ b/docs/RenderTexture.js.html
@@ -782,7 +782,7 @@ Phaser.RenderTexture.prototype.renderCanvas = function(displayObject, position,
diff --git a/docs/RequestAnimationFrame.js.html b/docs/RequestAnimationFrame.js.html
index 1b7e0e24..5f65a26d 100644
--- a/docs/RequestAnimationFrame.js.html
+++ b/docs/RequestAnimationFrame.js.html
@@ -609,7 +609,7 @@ Phaser.RequestAnimationFrame.prototype.constructor = Phaser.RequestAnimationFram
diff --git a/docs/SAT.js.html b/docs/SAT.js.html
index 34e90c31..46317e91 100644
--- a/docs/SAT.js.html
+++ b/docs/SAT.js.html
@@ -1286,7 +1286,7 @@ var SAT = (function () {
diff --git a/docs/Signal.js.html b/docs/Signal.js.html
index 57addc32..f4600ae6 100644
--- a/docs/Signal.js.html
+++ b/docs/Signal.js.html
@@ -754,7 +754,7 @@ Phaser.Signal.prototype.constructor = Phaser.Signal;
diff --git a/docs/SignalBinding.html b/docs/SignalBinding.html
index 6c955d8b..9723992f 100644
--- a/docs/SignalBinding.html
+++ b/docs/SignalBinding.html
@@ -747,7 +747,7 @@ Inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.
diff --git a/docs/SignalBinding.js.html b/docs/SignalBinding.js.html
index 14dc3c35..b4f72e8d 100644
--- a/docs/SignalBinding.js.html
+++ b/docs/SignalBinding.js.html
@@ -614,7 +614,7 @@ Phaser.SignalBinding.prototype.constructor = Phaser.SignalBinding;
diff --git a/docs/SinglePad.js.html b/docs/SinglePad.js.html
index 0ac1b770..77fe5c4f 100644
--- a/docs/SinglePad.js.html
+++ b/docs/SinglePad.js.html
@@ -1019,7 +1019,7 @@ Object.defineProperty(Phaser.SinglePad.prototype, "index", {
diff --git a/docs/Sound.js.html b/docs/Sound.js.html
index d0ced835..960c623b 100644
--- a/docs/Sound.js.html
+++ b/docs/Sound.js.html
@@ -1275,7 +1275,7 @@ Object.defineProperty(Phaser.Sound.prototype, "volume", {
diff --git a/docs/SoundManager.js.html b/docs/SoundManager.js.html
index 6ec0c4a6..a2100b5d 100644
--- a/docs/SoundManager.js.html
+++ b/docs/SoundManager.js.html
@@ -932,7 +932,7 @@ Object.defineProperty(Phaser.SoundManager.prototype, "volume", {
diff --git a/docs/Sprite.js.html b/docs/Sprite.js.html
index c41d9864..98cf72ba 100644
--- a/docs/Sprite.js.html
+++ b/docs/Sprite.js.html
@@ -1662,7 +1662,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", {
diff --git a/docs/Stage.js.html b/docs/Stage.js.html
index 90c80344..4b29e7f7 100644
--- a/docs/Stage.js.html
+++ b/docs/Stage.js.html
@@ -720,7 +720,7 @@ Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", {
diff --git a/docs/StageScaleMode.js.html b/docs/StageScaleMode.js.html
index 1a9b1cbd..615eb702 100644
--- a/docs/StageScaleMode.js.html
+++ b/docs/StageScaleMode.js.html
@@ -1226,7 +1226,7 @@ Object.defineProperty(Phaser.StageScaleMode.prototype, "isLandscape", {
diff --git a/docs/State.js.html b/docs/State.js.html
index 023f223d..faa13d05 100644
--- a/docs/State.js.html
+++ b/docs/State.js.html
@@ -621,7 +621,7 @@ Phaser.State.prototype.constructor = Phaser.State;
diff --git a/docs/StateManager.js.html b/docs/StateManager.js.html
index 581e15d3..235ff79c 100644
--- a/docs/StateManager.js.html
+++ b/docs/StateManager.js.html
@@ -978,7 +978,7 @@ Phaser.StateManager.prototype.constructor = Phaser.StateManager;
diff --git a/docs/Text.js.html b/docs/Text.js.html
index 37796f74..065254e7 100644
--- a/docs/Text.js.html
+++ b/docs/Text.js.html
@@ -751,7 +751,7 @@ Object.defineProperty(Phaser.Text.prototype, 'font', {
diff --git a/docs/Tile.js.html b/docs/Tile.js.html
index 882d1317..8ad9a00e 100644
--- a/docs/Tile.js.html
+++ b/docs/Tile.js.html
@@ -743,7 +743,7 @@ Object.defineProperty(Phaser.Tile.prototype, "bottom", {
diff --git a/docs/TileSprite.js.html b/docs/TileSprite.js.html
index af432470..0537b842 100644
--- a/docs/TileSprite.js.html
+++ b/docs/TileSprite.js.html
@@ -608,7 +608,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", {
diff --git a/docs/Tilemap.js.html b/docs/Tilemap.js.html
index ab9825f4..a12cc10e 100644
--- a/docs/Tilemap.js.html
+++ b/docs/Tilemap.js.html
@@ -463,14 +463,49 @@ Phaser.Tilemap = function (game, key) {
return;
}
+ /**
+ * @property {number} width - The width of the map (in tiles).
+ */
this.width = data.width;
+
+ /**
+ * @property {number} height - The height of the map (in tiles).
+ */
this.height = data.height;
+
+ /**
+ * @property {number} tileWidth - The base width of the tiles in the map (in pixels).
+ */
this.tileWidth = data.tileWidth;
+
+ /**
+ * @property {number} tileHeight - The base height of the tiles in the map (in pixels).
+ */
this.tileHeight = data.tileHeight;
+
+ /**
+ * @property {string} orientation - The orientation of the map data (as specified in Tiled), usually 'orthogonal'.
+ */
this.orientation = data.orientation;
+
+ /**
+ * @property {number} version - The version of the map data (as specified in Tiled, usually 1).
+ */
this.version = data.version;
+
+ /**
+ * @property {object} properties - Map specific properties as specified in Tiled.
+ */
this.properties = data.properties;
+
+ /**
+ * @property {number} widthInPixels - The width of the map in pixels based on width * tileWidth.
+ */
this.widthInPixels = data.widthInPixels;
+
+ /**
+ * @property {number} heightInPixels - The height of the map in pixels based on height * tileHeight.
+ */
this.heightInPixels = data.heightInPixels;
/**
@@ -515,13 +550,13 @@ Phaser.Tilemap = function (game, key) {
this._results = [];
/**
- * @property {number} _tempA - Internal var.
+ * @property {number} _tempA - Internal cache var.
* @private
*/
this._tempA = 0;
/**
- * @property {number} _tempB - Internal var.
+ * @property {number} _tempB - Internal cache var.
* @private
*/
this._tempB = 0;
@@ -576,7 +611,7 @@ Phaser.Tilemap.prototype = {
format: Phaser.Tilemap.CSV,
data: data,
indexes: [],
- dirty: true
+ dirty: true
});
@@ -622,12 +657,13 @@ Phaser.Tilemap.prototype = {
},
- // Region? Remove tile from map data?
+ /*
createFromTiles: function (layer, tileIndex, key, frame, group) {
if (typeof group === 'undefined') { group = this.game.world; }
},
+ */
/**
* Creates a Sprite for every object matching the given gid in the map data. You can optionally specify the group that the Sprite will be created in. If none is
@@ -635,7 +671,7 @@ Phaser.Tilemap.prototype = {
* configure Sprite properties from within the map editor. For example giving an object a property if alpha: 0.5 in the map editor will duplicate that when the
* Sprite is created. You could also give it a value like: body.velocity.x: 100 to set it moving automatically.
*
- * @method Phaser.Tileset#createFromObjects
+ * @method Phaser.Tilemap#createFromObjects
* @param {string} name - The name of the Object Group to create Sprites from.
* @param {number} gid - The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
* @param {string} key - The Game.cache key of the image that this Sprite will use.
@@ -680,8 +716,10 @@ Phaser.Tilemap.prototype = {
/**
* Creates a new TilemapLayer object. By default TilemapLayers are fixed to the camera.
+ * The `layer` parameter is important. If you've created your map in Tiled then you can get this by looking in Tiled and looking at the Layer name.
+ * Or you can open the JSON file it exports and look at the layers[].name value. Either way it must match.
*
- * @method Phaser.Tileset#createLayer
+ * @method Phaser.Tilemap#createLayer
* @param {number|string} layer - The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
* @param {number} [width] - The rendered width of the layer, should never be wider than Game.width. If not given it will be set to Game.width.
* @param {number} [height] - The rendered height of the layer, should never be wider than Game.height. If not given it will be set to Game.height.
@@ -716,7 +754,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the layer index based on the layers name.
*
- * @method Phaser.Tileset#getIndex
+ * @method Phaser.Tilemap#getIndex
* @protected
* @param {array} location - The local array to search.
* @param {string} name - The name of the array element to get.
@@ -739,7 +777,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the layer index based on its name.
*
- * @method Phaser.Tileset#getLayerIndex
+ * @method Phaser.Tilemap#getLayerIndex
* @param {string} name - The name of the layer to get.
* @return {number} The index of the layer in this tilemap, or null if not found.
*/
@@ -752,7 +790,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the tileset index based on its name.
*
- * @method Phaser.Tileset#getTilesetIndex
+ * @method Phaser.Tilemap#getTilesetIndex
* @param {string} name - The name of the tileset to get.
* @return {number} The index of the tileset in this tilemap, or null if not found.
*/
@@ -765,7 +803,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the image index based on its name.
*
- * @method Phaser.Tileset#getImageIndex
+ * @method Phaser.Tilemap#getImageIndex
* @param {string} name - The name of the image to get.
* @return {number} The index of the image in this tilemap, or null if not found.
*/
@@ -778,7 +816,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the object index based on its name.
*
- * @method Phaser.Tileset#getObjectIndex
+ * @method Phaser.Tilemap#getObjectIndex
* @param {string} name - The name of the object to get.
* @return {number} The index of the object in this tilemap, or null if not found.
*/
@@ -793,7 +831,7 @@ Phaser.Tilemap.prototype = {
* 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.Tileset#setTileIndexCallback
+ * @method Phaser.Tilemap#setTileIndexCallback
* @param {number|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.
@@ -824,7 +862,7 @@ Phaser.Tilemap.prototype = {
* 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.Tileset#setTileLocationCallback
+ * @method Phaser.Tilemap#setTileLocationCallback
* @param {number} x - X position of the top left of the area to copy (given in tiles, not pixels)
* @param {number} y - Y position of the top left of the area to copy (given in tiles, not pixels)
* @param {number} width - The width of the area to copy (given in tiles, not pixels)
@@ -855,7 +893,7 @@ Phaser.Tilemap.prototype = {
* Sets collision the given tile or tiles. 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.Tileset#setCollision
+ * @method Phaser.Tilemap#setCollision
* @param {number|array} indexes - Either a single tile index, or an array of tile IDs to be checked for collision.
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
* @param {number|string|Phaser.TilemapLayer} [layer] - The layer to operate on. If not given will default to this.currentLayer.
@@ -889,7 +927,7 @@ Phaser.Tilemap.prototype = {
* 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.Tileset#setCollisionBetween
+ * @method Phaser.Tilemap#setCollisionBetween
* @param {number} start - The first index of the tile to be set for collision.
* @param {number} 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.
@@ -920,7 +958,7 @@ Phaser.Tilemap.prototype = {
* Sets collision on all tiles in the given layer, except for the IDs of those in the given array.
* The `collides` parameter controls if collision will be enabled (true) or disabled (false).
*
- * @method Phaser.Tileset#setCollisionByExclusion
+ * @method Phaser.Tilemap#setCollisionByExclusion
* @param {array} indexes - An array of the tile IDs to not be counted for collision.
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
* @param {number|string|Phaser.TilemapLayer} [layer] - The layer to operate on. If not given will default to this.currentLayer.
@@ -949,7 +987,7 @@ Phaser.Tilemap.prototype = {
* Sets collision values on a tile in the set.
* You shouldn't usually call this method directly, instead use setCollision, setCollisionBetween or setCollisionByExclusion.
*
- * @method Phaser.Tileset#setCollisionByIndex
+ * @method Phaser.Tilemap#setCollisionByIndex
* @protected
* @param {number} index - The index of the tile on the layer.
* @param {boolean} [collides=true] - If true it will enable collision on the tile. If false it will clear collision values from the tile.
@@ -992,7 +1030,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the TilemapLayer index as used in the setCollision calls.
*
- * @method Phaser.Tileset#getLayer
+ * @method Phaser.Tilemap#getLayer
* @protected
* @param {number|string|Phaser.TilemapLayer} layer - The layer to operate on. If not given will default to this.currentLayer.
* @return {number} The TilemapLayer index.
@@ -1023,7 +1061,7 @@ Phaser.Tilemap.prototype = {
/**
* Internal function.
*
- * @method Phaser.Tileset#calculateFaces
+ * @method Phaser.Tilemap#calculateFaces
* @protected
* @param {number} layer - The index of the TilemapLayer to operate on.
*/
@@ -1080,7 +1118,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile above the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileAbove
+ * @method Phaser.Tilemap#getTileAbove
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -1100,7 +1138,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile below the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileBelow
+ * @method Phaser.Tilemap#getTileBelow
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -1120,7 +1158,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile to the left of the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileLeft
+ * @method Phaser.Tilemap#getTileLeft
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -1140,7 +1178,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile to the right of the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileRight
+ * @method Phaser.Tilemap#getTileRight
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -1197,7 +1235,7 @@ Phaser.Tilemap.prototype = {
this.layers[layer].data[y][x].index = tile;
}
- this.layers[layer].dirty = true;
+ this.layers[layer].dirty = true;
this.calculateFaces(layer);
}
@@ -1357,7 +1395,7 @@ Phaser.Tilemap.prototype = {
this.layers[layer].data[ diffY + tileblock[i].y ][ diffX + tileblock[i].x ].copy(tileblock[i]);
}
- this.layers[layer].dirty = true;
+ this.layers[layer].dirty = true;
this.calculateFaces(layer);
},
@@ -1687,7 +1725,7 @@ Phaser.Tilemap.prototype.constructor = Phaser.Tilemap;
diff --git a/docs/TilemapLayer.js.html b/docs/TilemapLayer.js.html
index 55dbec3d..2307e425 100644
--- a/docs/TilemapLayer.js.html
+++ b/docs/TilemapLayer.js.html
@@ -1330,7 +1330,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionHeight", {
diff --git a/docs/TilemapParser.js.html b/docs/TilemapParser.js.html
index baca8969..450a3bef 100644
--- a/docs/TilemapParser.js.html
+++ b/docs/TilemapParser.js.html
@@ -828,7 +828,7 @@ Phaser.TilemapParser = {
diff --git a/docs/Tileset.js.html b/docs/Tileset.js.html
index b2ed4d1c..7e7a550f 100644
--- a/docs/Tileset.js.html
+++ b/docs/Tileset.js.html
@@ -606,7 +606,7 @@ Phaser.Tileset.prototype.constructor = Phaser.Tileset;
diff --git a/docs/Time.js.html b/docs/Time.js.html
index cabeeb5a..3c99a4be 100644
--- a/docs/Time.js.html
+++ b/docs/Time.js.html
@@ -797,7 +797,7 @@ Phaser.Time.prototype.constructor = Phaser.Time;
diff --git a/docs/Timer.js.html b/docs/Timer.js.html
index e225733f..4a99097c 100644
--- a/docs/Timer.js.html
+++ b/docs/Timer.js.html
@@ -959,7 +959,7 @@ Phaser.Timer.prototype.constructor = Phaser.Timer;
diff --git a/docs/TimerEvent.js.html b/docs/TimerEvent.js.html
index 6d610604..4dce42e1 100644
--- a/docs/TimerEvent.js.html
+++ b/docs/TimerEvent.js.html
@@ -523,7 +523,7 @@ Phaser.TimerEvent.prototype.constructor = Phaser.TimerEvent;
diff --git a/docs/Touch.js.html b/docs/Touch.js.html
index 33e9adef..2090e268 100644
--- a/docs/Touch.js.html
+++ b/docs/Touch.js.html
@@ -821,7 +821,7 @@ Phaser.Touch.prototype.constructor = Phaser.Touch;
diff --git a/docs/Tween.js.html b/docs/Tween.js.html
index fc64b2b7..ba464c91 100644
--- a/docs/Tween.js.html
+++ b/docs/Tween.js.html
@@ -1029,7 +1029,7 @@ Phaser.Tween.prototype.constructor = Phaser.Tween;
diff --git a/docs/TweenManager.js.html b/docs/TweenManager.js.html
index bec02b88..e00c738f 100644
--- a/docs/TweenManager.js.html
+++ b/docs/TweenManager.js.html
@@ -654,7 +654,7 @@ Phaser.TweenManager.prototype.constructor = Phaser.TweenManager;
diff --git a/docs/Utils.js.html b/docs/Utils.js.html
index 28d3ece2..c1f2c9d4 100644
--- a/docs/Utils.js.html
+++ b/docs/Utils.js.html
@@ -703,7 +703,7 @@ if (!Array.isArray) {
diff --git a/docs/World.js.html b/docs/World.js.html
index bbb398a7..558e9499 100644
--- a/docs/World.js.html
+++ b/docs/World.js.html
@@ -794,7 +794,7 @@ Object.defineProperty(Phaser.World.prototype, "visible", {
diff --git a/docs/classes.list.html b/docs/classes.list.html
index 632608d5..92f451b8 100644
--- a/docs/classes.list.html
+++ b/docs/classes.list.html
@@ -788,7 +788,7 @@
diff --git a/docs/global.html b/docs/global.html
index 2f5e07fa..68efab9d 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -567,7 +567,7 @@
diff --git a/docs/index.html b/docs/index.html
index a930ba76..9f99be60 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -499,6 +499,7 @@
Fixed easing tween example case. Issue #379 (thanks wesleywerner)
Removed SAT.js UMD wrapped, fixes issue #361 (thanks luizbills)
Removed inContact check from Body.separate.
+Fixed Tilemap docs (wrongly pointed to Tileset methods)
See the full Change Log for all the 1.1.4 updates and API changes (as there were a lot of them!)
You can view the Change Log for all previous versions at https://github.com/photonstorm/phaser/changelog.md
@@ -636,7 +637,7 @@ Sprites also have full Input support: click them, touch them, drag them around,
diff --git a/docs/namespaces.list.html b/docs/namespaces.list.html
index 473458f5..056b19a4 100644
--- a/docs/namespaces.list.html
+++ b/docs/namespaces.list.html
@@ -788,7 +788,7 @@
diff --git a/src/tilemap/Tilemap.js b/src/tilemap/Tilemap.js
index c227f20d..2f7bc69b 100644
--- a/src/tilemap/Tilemap.js
+++ b/src/tilemap/Tilemap.js
@@ -32,14 +32,49 @@ Phaser.Tilemap = function (game, key) {
return;
}
+ /**
+ * @property {number} width - The width of the map (in tiles).
+ */
this.width = data.width;
+
+ /**
+ * @property {number} height - The height of the map (in tiles).
+ */
this.height = data.height;
+
+ /**
+ * @property {number} tileWidth - The base width of the tiles in the map (in pixels).
+ */
this.tileWidth = data.tileWidth;
+
+ /**
+ * @property {number} tileHeight - The base height of the tiles in the map (in pixels).
+ */
this.tileHeight = data.tileHeight;
+
+ /**
+ * @property {string} orientation - The orientation of the map data (as specified in Tiled), usually 'orthogonal'.
+ */
this.orientation = data.orientation;
+
+ /**
+ * @property {number} version - The version of the map data (as specified in Tiled, usually 1).
+ */
this.version = data.version;
+
+ /**
+ * @property {object} properties - Map specific properties as specified in Tiled.
+ */
this.properties = data.properties;
+
+ /**
+ * @property {number} widthInPixels - The width of the map in pixels based on width * tileWidth.
+ */
this.widthInPixels = data.widthInPixels;
+
+ /**
+ * @property {number} heightInPixels - The height of the map in pixels based on height * tileHeight.
+ */
this.heightInPixels = data.heightInPixels;
/**
@@ -84,13 +119,13 @@ Phaser.Tilemap = function (game, key) {
this._results = [];
/**
- * @property {number} _tempA - Internal var.
+ * @property {number} _tempA - Internal cache var.
* @private
*/
this._tempA = 0;
/**
- * @property {number} _tempB - Internal var.
+ * @property {number} _tempB - Internal cache var.
* @private
*/
this._tempB = 0;
@@ -145,7 +180,7 @@ Phaser.Tilemap.prototype = {
format: Phaser.Tilemap.CSV,
data: data,
indexes: [],
- dirty: true
+ dirty: true
});
@@ -191,12 +226,13 @@ Phaser.Tilemap.prototype = {
},
- // Region? Remove tile from map data?
+ /*
createFromTiles: function (layer, tileIndex, key, frame, group) {
if (typeof group === 'undefined') { group = this.game.world; }
},
+ */
/**
* Creates a Sprite for every object matching the given gid in the map data. You can optionally specify the group that the Sprite will be created in. If none is
@@ -204,7 +240,7 @@ Phaser.Tilemap.prototype = {
* configure Sprite properties from within the map editor. For example giving an object a property if alpha: 0.5 in the map editor will duplicate that when the
* Sprite is created. You could also give it a value like: body.velocity.x: 100 to set it moving automatically.
*
- * @method Phaser.Tileset#createFromObjects
+ * @method Phaser.Tilemap#createFromObjects
* @param {string} name - The name of the Object Group to create Sprites from.
* @param {number} gid - The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
* @param {string} key - The Game.cache key of the image that this Sprite will use.
@@ -249,8 +285,10 @@ Phaser.Tilemap.prototype = {
/**
* Creates a new TilemapLayer object. By default TilemapLayers are fixed to the camera.
+ * The `layer` parameter is important. If you've created your map in Tiled then you can get this by looking in Tiled and looking at the Layer name.
+ * Or you can open the JSON file it exports and look at the layers[].name value. Either way it must match.
*
- * @method Phaser.Tileset#createLayer
+ * @method Phaser.Tilemap#createLayer
* @param {number|string} layer - The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
* @param {number} [width] - The rendered width of the layer, should never be wider than Game.width. If not given it will be set to Game.width.
* @param {number} [height] - The rendered height of the layer, should never be wider than Game.height. If not given it will be set to Game.height.
@@ -285,7 +323,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the layer index based on the layers name.
*
- * @method Phaser.Tileset#getIndex
+ * @method Phaser.Tilemap#getIndex
* @protected
* @param {array} location - The local array to search.
* @param {string} name - The name of the array element to get.
@@ -308,7 +346,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the layer index based on its name.
*
- * @method Phaser.Tileset#getLayerIndex
+ * @method Phaser.Tilemap#getLayerIndex
* @param {string} name - The name of the layer to get.
* @return {number} The index of the layer in this tilemap, or null if not found.
*/
@@ -321,7 +359,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the tileset index based on its name.
*
- * @method Phaser.Tileset#getTilesetIndex
+ * @method Phaser.Tilemap#getTilesetIndex
* @param {string} name - The name of the tileset to get.
* @return {number} The index of the tileset in this tilemap, or null if not found.
*/
@@ -334,7 +372,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the image index based on its name.
*
- * @method Phaser.Tileset#getImageIndex
+ * @method Phaser.Tilemap#getImageIndex
* @param {string} name - The name of the image to get.
* @return {number} The index of the image in this tilemap, or null if not found.
*/
@@ -347,7 +385,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the object index based on its name.
*
- * @method Phaser.Tileset#getObjectIndex
+ * @method Phaser.Tilemap#getObjectIndex
* @param {string} name - The name of the object to get.
* @return {number} The index of the object in this tilemap, or null if not found.
*/
@@ -362,7 +400,7 @@ Phaser.Tilemap.prototype = {
* 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.Tileset#setTileIndexCallback
+ * @method Phaser.Tilemap#setTileIndexCallback
* @param {number|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.
@@ -393,7 +431,7 @@ Phaser.Tilemap.prototype = {
* 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.Tileset#setTileLocationCallback
+ * @method Phaser.Tilemap#setTileLocationCallback
* @param {number} x - X position of the top left of the area to copy (given in tiles, not pixels)
* @param {number} y - Y position of the top left of the area to copy (given in tiles, not pixels)
* @param {number} width - The width of the area to copy (given in tiles, not pixels)
@@ -424,7 +462,7 @@ Phaser.Tilemap.prototype = {
* Sets collision the given tile or tiles. 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.Tileset#setCollision
+ * @method Phaser.Tilemap#setCollision
* @param {number|array} indexes - Either a single tile index, or an array of tile IDs to be checked for collision.
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
* @param {number|string|Phaser.TilemapLayer} [layer] - The layer to operate on. If not given will default to this.currentLayer.
@@ -458,7 +496,7 @@ Phaser.Tilemap.prototype = {
* 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.Tileset#setCollisionBetween
+ * @method Phaser.Tilemap#setCollisionBetween
* @param {number} start - The first index of the tile to be set for collision.
* @param {number} 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.
@@ -489,7 +527,7 @@ Phaser.Tilemap.prototype = {
* Sets collision on all tiles in the given layer, except for the IDs of those in the given array.
* The `collides` parameter controls if collision will be enabled (true) or disabled (false).
*
- * @method Phaser.Tileset#setCollisionByExclusion
+ * @method Phaser.Tilemap#setCollisionByExclusion
* @param {array} indexes - An array of the tile IDs to not be counted for collision.
* @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision.
* @param {number|string|Phaser.TilemapLayer} [layer] - The layer to operate on. If not given will default to this.currentLayer.
@@ -518,7 +556,7 @@ Phaser.Tilemap.prototype = {
* Sets collision values on a tile in the set.
* You shouldn't usually call this method directly, instead use setCollision, setCollisionBetween or setCollisionByExclusion.
*
- * @method Phaser.Tileset#setCollisionByIndex
+ * @method Phaser.Tilemap#setCollisionByIndex
* @protected
* @param {number} index - The index of the tile on the layer.
* @param {boolean} [collides=true] - If true it will enable collision on the tile. If false it will clear collision values from the tile.
@@ -561,7 +599,7 @@ Phaser.Tilemap.prototype = {
/**
* Gets the TilemapLayer index as used in the setCollision calls.
*
- * @method Phaser.Tileset#getLayer
+ * @method Phaser.Tilemap#getLayer
* @protected
* @param {number|string|Phaser.TilemapLayer} layer - The layer to operate on. If not given will default to this.currentLayer.
* @return {number} The TilemapLayer index.
@@ -592,7 +630,7 @@ Phaser.Tilemap.prototype = {
/**
* Internal function.
*
- * @method Phaser.Tileset#calculateFaces
+ * @method Phaser.Tilemap#calculateFaces
* @protected
* @param {number} layer - The index of the TilemapLayer to operate on.
*/
@@ -649,7 +687,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile above the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileAbove
+ * @method Phaser.Tilemap#getTileAbove
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -669,7 +707,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile below the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileBelow
+ * @method Phaser.Tilemap#getTileBelow
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -689,7 +727,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile to the left of the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileLeft
+ * @method Phaser.Tilemap#getTileLeft
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -709,7 +747,7 @@ Phaser.Tilemap.prototype = {
* Gets the tile to the right of the tile coordinates given.
* Mostly used as an internal function by calculateFaces.
*
- * @method Phaser.Tileset#getTileRight
+ * @method Phaser.Tilemap#getTileRight
* @param {number} layer - The local layer index to get the tile from. Can be determined by Tilemap.getLayer().
* @param {number} x - The x coordinate to get the tile from. In tiles, not pixels.
* @param {number} y - The y coordinate to get the tile from. In tiles, not pixels.
@@ -766,7 +804,7 @@ Phaser.Tilemap.prototype = {
this.layers[layer].data[y][x].index = tile;
}
- this.layers[layer].dirty = true;
+ this.layers[layer].dirty = true;
this.calculateFaces(layer);
}
@@ -926,7 +964,7 @@ Phaser.Tilemap.prototype = {
this.layers[layer].data[ diffY + tileblock[i].y ][ diffX + tileblock[i].x ].copy(tileblock[i]);
}
- this.layers[layer].dirty = true;
+ this.layers[layer].dirty = true;
this.calculateFaces(layer);
},