Drawing a line between two points in UMG is easy enough, but how can I make it interactive afterward?
I need it to accept click and drag events, but there’s no way at all to reference it in the graph.
The draw line node just has no output.
Perhaps I should create the line geometry some other way?
In that case, what would be an alternative method of drawing a line (with thickness) between two points?
You won’t be able to achieve this in blueprints. Your absolutely best bet is to look into Slate, at the very way the editor’s splines are handled.
I need it to accept click and drag
events, but there’s no way at all to
reference it in the graph. The draw
line node just has no output.
While you cannot interact with the line itself, nothing stops you from creating and interacting with anchor points - perhaps you could create helper widgets that allow for drag and drop. And the line is simply drawn between them. You could even have intermediate points if you need the line to be more than A->B.
The HUD class also allows for drawing lines, it’s very efficient at it, too. It allows for thickness as well; it’s somewhat obsolete since UMG’s draw line had Thickness and Antialiasing exposed to blueprints.