Skip to content

Commit a3f6797

Browse files
committed
Corrected documentation and tidied up phaserjs#4992
1 parent ffb49bd commit a3f6797

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/tilemaps/components/CheckIsoBounds.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,24 @@
55
*/
66

77
/**
8-
* Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the
9-
* specified index. Tiles will be set to collide if the given index is a colliding index.
10-
* Collision information in the region will be recalculated.
8+
* Checks if the given tile coordinate is within the isometric layer bounds, or not.
119
*
1210
* @function Phaser.Tilemaps.Components.CheckIsoBounds
13-
* @private
14-
* @since 3.50.iso
11+
* @since 3.50.0
1512
*
1613
* @param {integer} tileX - The x coordinate, in tiles, not pixels.
1714
* @param {integer} tileY - The y coordinate, in tiles, not pixels.
1815
* @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to check against.
1916
* @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against.
17+
*
18+
* @return {boolean} Returns `true` if the coordinates are within the iso bounds.
2019
*/
21-
var CheckIsoBounds = function (tileX,tileY,layer,camera)
20+
var CheckIsoBounds = function (tileX, tileY, layer, camera)
2221
{
2322
var tilemapLayer = layer.tilemapLayer;
2423
var cullDistances = tilemapLayer.isoCullDistances;
2524
var pos = tilemapLayer.tileToWorldXY(tileX,tileY,undefined,camera);
26-
25+
2726
// we always subtract 1/2 of the tile's height/width to make the culling distance start from the center of the tiles.
2827
return pos.x > camera.worldView.x + tilemapLayer.scaleX * layer.tileWidth * (- cullDistances.x - 1 / 2)
2928
&& pos.x < camera.worldView.right + tilemapLayer.scaleX * layer.tileWidth * (cullDistances.x - 1 / 2)

0 commit comments

Comments
 (0)