You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a tilemap with orientation="hexagonal", each pair of adjacent hexagonal tiles partially overlaps, reducing the overall width and height of the tilemap compared to a rectangular grid.
However, the current calculation for widthInPixels and heightInPixels simply multiplies the number of tiles by their width or height, without accounting for the hexagonal overlap. This results in incorrect dimensions for hexagonal tilemaps, causing layout and rendering inconsistencies.
Version
Description
When using a tilemap with orientation="hexagonal", each pair of adjacent hexagonal tiles partially overlaps, reducing the overall width and height of the tilemap compared to a rectangular grid.
However, the current calculation for widthInPixels and heightInPixels simply multiplies the number of tiles by their width or height, without accounting for the hexagonal overlap. This results in incorrect dimensions for hexagonal tilemaps, causing layout and rendering inconsistencies.
Example Test Code
Example Code & Suggestion: https://phaser.io/sandbox/8BSZFoKz
Additional Information
The red rectangle uses
widthInPixels
andheightInPixels
.The green rectangle is what they should be.
I think the issue comes from
phaser/src/tilemaps/mapdata/MapData.js
Line 93 in 97e3e67
phaser/src/tilemaps/mapdata/MapData.js
Line 102 in 97e3e67
and my suggested calculation is in the example code above.
The text was updated successfully, but these errors were encountered: