Topic was automatically imported from the old Question2Answer platform.
Asked By
beaverusiv
I am making a 3D isometric game and I want the tile underneath the mouse to have a border highlight on it, like this: Pasteboard - Uploaded Image
The solution needs to work no matter the location or scale of the tile as the camera can pan and zoom. I previously had a rectangle poly I moved over the tile the mouse was over but there must be a nicer way like a shader or 2D UI drawing
which is the easiest method. Ensure to enable Transparency
I already have the code to intersect a ray, but thanks for mentioning it. I think I will go with a line2D as then I can guarantee visibility and consistent look no matter zoom levels. I will just have to unproject 4 points at each of the corners to calc size (and it’s isometric)
beaverusiv | 2021-04-04 20:02
That part is actually easy, from the world_to_map() position draw each point diagonally based on GridMap’s cell_size
Wakatta | 2021-04-04 20:19
Yup, that was generally my thoughts. From my existing code I already have the centre of the tile in world coords so easy to calc corners from that