mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5f21646e6c
2 changed files with 6 additions and 5 deletions
|
@ -306,7 +306,8 @@ var Tilemap = new Class({
|
||||||
row = [];
|
row = [];
|
||||||
for (var tileX = 0; tileX < width; tileX++)
|
for (var tileX = 0; tileX < width; tileX++)
|
||||||
{
|
{
|
||||||
row.push(new Tile(layerData, -1, tileX, tileY, tileWidth, tileHeight));
|
row.push(new Tile(layerData, -1, tileX, tileY, tileWidth, tileHeight,
|
||||||
|
this.tileWidth, this.tileHeight));
|
||||||
}
|
}
|
||||||
layerData.data.push(row);
|
layerData.data.push(row);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,10 +30,10 @@ var CullTiles = function (layer, camera, outputArray)
|
||||||
|
|
||||||
if (tile === null || (tile.index <= 0 && tilemapLayer.skipIndexZero)) { continue; }
|
if (tile === null || (tile.index <= 0 && tilemapLayer.skipIndexZero)) { continue; }
|
||||||
|
|
||||||
var tileX = tile.x * tileWidth - left;
|
var tileX = tile.worldX - left;
|
||||||
var tileY = tile.y * tileHeight - top;
|
var tileY = tile.worldY - top;
|
||||||
var cullW = camera.width + tileWidth;
|
var cullW = camera.width + tile.width;
|
||||||
var cullH = camera.height + tileHeight;
|
var cullH = camera.height + tile.height;
|
||||||
|
|
||||||
if (tile.visible &&
|
if (tile.visible &&
|
||||||
tileX > -tileWidth && tileY > -tileHeight &&
|
tileX > -tileWidth && tileY > -tileHeight &&
|
||||||
|
|
Loading…
Reference in a new issue