mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 06:30:38 +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 boundsTop;
|
||||||
var boundsBottom;
|
var boundsBottom;
|
||||||
|
|
||||||
if (this.staggerAxis === 'y')
|
if (layer.staggerAxis === 'y')
|
||||||
{
|
{
|
||||||
var rowH = ((tileH - len) / 2 + len);
|
var rowH = ((tileH - len) / 2 + len);
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ var HexagonalGetTileCorners = function (tileX, tileY, camera, layer)
|
||||||
var hexWidth;
|
var hexWidth;
|
||||||
var hexHeight;
|
var hexHeight;
|
||||||
|
|
||||||
if (this.staggerAxis === 'y')
|
if (layer.staggerAxis === 'y')
|
||||||
{
|
{
|
||||||
hexWidth = b0 * tileWidth;
|
hexWidth = b0 * tileWidth;
|
||||||
hexHeight = tileHeight / 2;
|
hexHeight = tileHeight / 2;
|
||||||
|
|
|
@ -53,7 +53,7 @@ var HexagonalTileToWorldXY = function (tileX, tileY, point, camera, layer)
|
||||||
var x;
|
var x;
|
||||||
var y;
|
var y;
|
||||||
|
|
||||||
if (this.staggerAxis === 'y')
|
if (layer.staggerAxis === 'y')
|
||||||
{
|
{
|
||||||
x = worldX + (tileWidth * tileX) + tileWidth;
|
x = worldX + (tileWidth * tileX) + tileWidth;
|
||||||
y = worldY + ((1.5 * tileY) * tileHeightHalf) + tileHeightHalf;
|
y = worldY + ((1.5 * tileY) * tileHeightHalf) + tileHeightHalf;
|
||||||
|
|
Loading…
Reference in a new issue