|
5 | 5 | */ |
6 | 6 |
|
7 | 7 | /** |
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. |
11 | 9 | * |
12 | 10 | * @function Phaser.Tilemaps.Components.CheckIsoBounds |
13 | | - * @private |
14 | | - * @since 3.50.iso |
| 11 | + * @since 3.50.0 |
15 | 12 | * |
16 | 13 | * @param {integer} tileX - The x coordinate, in tiles, not pixels. |
17 | 14 | * @param {integer} tileY - The y coordinate, in tiles, not pixels. |
18 | 15 | * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to check against. |
19 | 16 | * @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. |
20 | 19 | */ |
21 | | -var CheckIsoBounds = function (tileX,tileY,layer,camera) |
| 20 | +var CheckIsoBounds = function (tileX, tileY, layer, camera) |
22 | 21 | { |
23 | 22 | var tilemapLayer = layer.tilemapLayer; |
24 | 23 | var cullDistances = tilemapLayer.isoCullDistances; |
25 | 24 | var pos = tilemapLayer.tileToWorldXY(tileX,tileY,undefined,camera); |
26 | | - |
| 25 | + |
27 | 26 | // we always subtract 1/2 of the tile's height/width to make the culling distance start from the center of the tiles. |
28 | 27 | return pos.x > camera.worldView.x + tilemapLayer.scaleX * layer.tileWidth * (- cullDistances.x - 1 / 2) |
29 | 28 | && pos.x < camera.worldView.right + tilemapLayer.scaleX * layer.tileWidth * (cullDistances.x - 1 / 2) |
|
0 commit comments