SFML community forums
Help => General => Topic started by: Futochu on February 10, 2015, 07:14:48 am
-
Is there an accepted way of determining the tile your mouse cursor is hovering over in an isometric map with varying heights? It's trivial to map the position of a mouse cursor to a tile if all heights were zero, but I can't for the life of me figure out how to get a tile that has an unknown height. This is what my map currently looks like (excuse the placeholder graphics).
http://i.imgur.com/nOLvK37.png (http://i.imgur.com/nOLvK37.png)
I've read about things such as image maps to determine relative positions, but does this work when heights can vary by +/- 512?
Thanks.
-
Well you're drawing tiles somehow and when drawing you have to know their position, as such it shouldn't be hard to map the mouse's position to the tile position.
A useful function for you might also be: window.mapPixelToCoords()
-
I was afraid that would be the best answer. Thanks though