Merge pull request #6487 from DaliborTrampota/master

Fixes drawing hexagonal tilemaps
This commit is contained in:
Richard Davey 2023-07-21 16:35:28 +01:00 committed by GitHub
commit 1217464a0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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;