Get all tiles traversed by line2d

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By AtlantisXY

Hello, is there a way to get all tiles from an isometric tilemap that get traversed by a Line2D node? To illustrate, I want to get the tiles that have an arrow pointing to them because they were traversed by the line. The Line2D node only has 2 points, the first and last points.

I have not found a viable solution so far… thanks

:bust_in_silhouette: Reply From: Aeris130

If you know the start/stop tiles you can treat the tilemap as a regular non-isometric grid and use regular grid traversing algorithms to compute which tiles needs to be crossed, then translate those coordinates back to the isometric grid.
Line drawing on a grid (see section 2)

This is really helpful, I’ll take a look into it. Thanks a lot!

AtlantisXY | 2023-03-03 10:13