How to use Widget Draw Line Context input?

Good afternoon and thank you for reading.

I am trying to implement an in-game drawing functionality that allows users to draw onto a surface. From my searching, it appears that a widget is an appropriate tool for the job. However, When using the Draw Line node, it requires a context input (Paint Context Structure). A previous similar question found an answer in overriding the On Paint function, but alas, I see no On Paint function to override in my editor (perhaps it’s gone now?).

Any help would be greatly appreciated.


I would also like to know how to use the drawLines function and what the context means.

you need to override OnDraw function in your widget blueprint. The onDraw function gets the context as parameter that you can pass to draw line or any other draw calls in the widget.

Please note all draw calls should be done in the onDraw function and not outside it