Widget Draw Line and Draw Text

How can I get the Draw Line function on a widget to work? It is asking me for a Paint Context Structure and I have no idea what that is or whether I have to create one by myself.

DrawLine.jpg

The Draw Text function asks for the same thing. After googling a bit it seems like there used to be an older node that didn’t ask for this context so I suppose there’s a reason for this change but I just can’t figure it out.

Looks like you’re doing this inside the level blueprint. For some reason you need to remove the context sensitive flag to find the Draw Debug Line and related nodes in that blueprint alone:

It’s always been this way as far as I can make out!

As for the ‘Draw Line’ node it appears to be for Widget blueprints (UMG), the vector attributes are also 2-D vectors I believe.

This is not the way to render lines in widget blueprints, this is a debug line.** To render a line in widget you need to override the onPaint function.** There you will be able to connect the context pin. If you do not use widgets and still want to draw on screen in 2D,** you can also use Draw Line or other drawing functions available in HUD** (not Widget) blueprint. These functions do not need context (contrary to widget drawing functions). I mostly use debug drawing when I want to draw in 3D to test and visualize the functionality of my blueprints. :slight_smile:
Cheers