Skip to content

Commit b1f294e

Browse files
committed
Merge pull request #1722 from GGAlanSmithee/dev
Minor change to Tilemap class
2 parents daea4e8 + d2e3a69 commit b1f294e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tilemap/Tilemap.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,9 +1455,10 @@ Phaser.Tilemap.prototype = {
14551455
* @param {number} [tileWidth] - The width of the tiles. If not given the map default is used.
14561456
* @param {number} [tileHeight] - The height of the tiles. If not given the map default is used.
14571457
* @param {number|string|Phaser.TilemapLayer} [layer] - The layer to get the tile from.
1458+
* @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1.
14581459
* @return {Phaser.Tile} The tile at the given coordinates.
14591460
*/
1460-
getTileWorldXY: function (x, y, tileWidth, tileHeight, layer) {
1461+
getTileWorldXY: function (x, y, tileWidth, tileHeight, layer, nonNull) {
14611462

14621463
if (typeof tileWidth === 'undefined') { tileWidth = this.tileWidth; }
14631464
if (typeof tileHeight === 'undefined') { tileHeight = this.tileHeight; }
@@ -1467,7 +1468,7 @@ Phaser.Tilemap.prototype = {
14671468
x = this.game.math.snapToFloor(x, tileWidth) / tileWidth;
14681469
y = this.game.math.snapToFloor(y, tileHeight) / tileHeight;
14691470

1470-
return this.getTile(x, y, layer);
1471+
return this.getTile(x, y, layer, nonNull);
14711472

14721473
},
14731474

0 commit comments

Comments
 (0)