diff --git a/v3/src/gameobjects/tilemap/Tilemap.js b/v3/src/gameobjects/tilemap/Tilemap.js index 05d49a464..e791c4652 100644 --- a/v3/src/gameobjects/tilemap/Tilemap.js +++ b/v3/src/gameobjects/tilemap/Tilemap.js @@ -306,7 +306,8 @@ var Tilemap = new Class({ row = []; 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); } diff --git a/v3/src/gameobjects/tilemap/components/CullTiles.js b/v3/src/gameobjects/tilemap/components/CullTiles.js index 38c2ef4bb..f447a1f01 100644 --- a/v3/src/gameobjects/tilemap/components/CullTiles.js +++ b/v3/src/gameobjects/tilemap/components/CullTiles.js @@ -30,10 +30,10 @@ var CullTiles = function (layer, camera, outputArray) if (tile === null || (tile.index <= 0 && tilemapLayer.skipIndexZero)) { continue; } - var tileX = tile.x * tileWidth - left; - var tileY = tile.y * tileHeight - top; - var cullW = camera.width + tileWidth; - var cullH = camera.height + tileHeight; + var tileX = tile.worldX - left; + var tileY = tile.worldY - top; + var cullW = camera.width + tile.width; + var cullH = camera.height + tile.height; if (tile.visible && tileX > -tileWidth && tileY > -tileHeight &&