mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 12:43:26 +00:00
Merge pull request #6487 from DaliborTrampota/master
Fixes drawing hexagonal tilemaps
This commit is contained in:
commit
1217464a0b
3 changed files with 3 additions and 3 deletions
|
@ -37,7 +37,7 @@ var HexagonalCullBounds = function (layer, camera)
|
|||
var boundsTop;
|
||||
var boundsBottom;
|
||||
|
||||
if (this.staggerAxis === 'y')
|
||||
if (layer.staggerAxis === 'y')
|
||||
{
|
||||
var rowH = ((tileH - len) / 2 + len);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ var HexagonalGetTileCorners = function (tileX, tileY, camera, layer)
|
|||
var hexWidth;
|
||||
var hexHeight;
|
||||
|
||||
if (this.staggerAxis === 'y')
|
||||
if (layer.staggerAxis === 'y')
|
||||
{
|
||||
hexWidth = b0 * tileWidth;
|
||||
hexHeight = tileHeight / 2;
|
||||
|
|
|
@ -53,7 +53,7 @@ var HexagonalTileToWorldXY = function (tileX, tileY, point, camera, layer)
|
|||
var x;
|
||||
var y;
|
||||
|
||||
if (this.staggerAxis === 'y')
|
||||
if (layer.staggerAxis === 'y')
|
||||
{
|
||||
x = worldX + (tileWidth * tileX) + tileWidth;
|
||||
y = worldY + ((1.5 * tileY) * tileHeightHalf) + tileHeightHalf;
|
||||
|
|
Loading…
Reference in a new issue