mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 11:33:28 +00:00
commented
This commit is contained in:
parent
1573e25214
commit
9b86c5e6ed
1 changed files with 2 additions and 0 deletions
|
@ -71,6 +71,8 @@ var CullTiles = function (layer, camera, outputArray, renderOrder)
|
||||||
{
|
{
|
||||||
var cullDistances = tilemapLayer.isoCullDistances;
|
var cullDistances = tilemapLayer.isoCullDistances;
|
||||||
var pos = tilemapLayer.tileToWorldXY(x,y,undefined,camera);
|
var pos = tilemapLayer.tileToWorldXY(x,y,undefined,camera);
|
||||||
|
|
||||||
|
// we always subtract 1/2 of the tile's height/width to make the culling distance start from the center of the tiles.
|
||||||
return pos.x > camera.worldView.x + tilemapLayer.scaleX * layer.tileWidth * (- cullDistances.x - 1 / 2)
|
return pos.x > camera.worldView.x + tilemapLayer.scaleX * layer.tileWidth * (- cullDistances.x - 1 / 2)
|
||||||
&& pos.x < camera.worldView.right + tilemapLayer.scaleX * layer.tileWidth * (cullDistances.x - 1 / 2)
|
&& pos.x < camera.worldView.right + tilemapLayer.scaleX * layer.tileWidth * (cullDistances.x - 1 / 2)
|
||||||
&& pos.y > camera.worldView.y + tilemapLayer.scaleY * layer.tileHeight * (- cullDistances.y - 1 / 2)
|
&& pos.y > camera.worldView.y + tilemapLayer.scaleY * layer.tileHeight * (- cullDistances.y - 1 / 2)
|
||||||
|
|
Loading…
Reference in a new issue