Custom UWidget drawing?

I’m trying to make some interactive debug UI to show over the game and game UI (so can’t use HUD which is always under game UI).

Wondering how I would go about creating a custom widget with custom drawing for simple boxes and text?

You’ve got a few options, the best one is probably to just use a UMG Widget. Create your debug widget class and inherit from UUserWidget. You will then be able to make a UMG widget in the content browser which inherits that, and from that point it pretty much behaves like any other class.

Unreal have several static DrawDebugXX functions such as DrawDebugLine(), DrawDebugText(), etc.

Once I have my widget, how do actually add the draw functionality?

I can see the OnPaint function, override that? Then how would I get a canvas or something else to perform the actual draws?

If you want complex debug widgets you have to use Slate widgets on overridden Viewport canvas.

I have done this before, but I don’t remember anymore the name of the class to override in project settings.

You can use OnPaint to do drawing if you like, just be aware that the Blueprint implementations are horrendously unperformant.