-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WorldToTileX not working for Hex Tilesets (TileY and TileXY works) #5608
Comments
I'm also experiencing this, but while the XY function works better than the X function, but still doesn't work for me (seems to have square detection area?). I wonder why it doesn't work for me? Were you using arcade or matter physics? Would that matter? Here's my explanation/repro on the forums. https://phaser.discourse.group/t/gettileatworldxy-selects-wrong-tile-on-hex-maps-from-tiled/11643/2 |
I'll patch this so it doesn't error, but it's correct that there is no |
Damn, this took a complete rewrite of the function (it was totally wrong!), and it now supports any size hexagon (with varying widths / heights) and layer scales without error. Phew, was quite a bit of learning and optimizing. Video showing it: hex-clicks.mp4Demo here: https://labs.phaser.io/view.html?src=src/bugs/5608%20hex%20tile.js&v=dev I've no doubt that the opposite function, |
Wow it took me a long time to find this. Great work thanks. |
Version
Description
Tilemaplayer.worldToTileX gives undefined in the code below. Expected behavior is to get the X pos
However, both ..ToTileXY and ... ToTileY works
It seems that the GetWorldToTileXFunction (Phaser.Tilemaps.Components.GetWorldToTileXFunction) is not updated in the same way as GetWorldToTileYFunction is.
Example Test Code
Additional Information
The text was updated successfully, but these errors were encountered: