Draw a Line between two widgets

Ensure the Skill Icons are parented to a Canvas so you can get their positions:

The parent widget can draw lines using those coordinates. That’s the gist. The actual implementation would depend on whether this needs to be dynamic. Perhaps you can just draw lines in Gimp / Photoshop / Paint and slap icons on top in the UMG.

2 Likes

Draw a Line between two widgets

To literally answer it; this assumes we’re drawing from centre to centre:

342810-items.png

Image from Gyazo

Do note that lines render last (on top) so either draw from the edges / corners. Or have a separate background with lower Z order and draw there.

5 Likes

Hello, does anyone know how can i draw a line between 2 widgets ? so i can make a skill tree.

Thank you so much!!

I´ve tried that but the position b doesnt seem to be right.
Thanks for the quick response.

I’ll just add that for this to work (better) the widgets must have a Desired Size:

342818-screenshot-4.png

And the easiest way to have it reported correctly in the editor is via Size Box. It should work run-time one way or another since the layout will be pre-passed.

1 Like

Thanks!!!