Creating a blueprint UMG widget from c++

I have been writing mainly in blueprint and am switching over to code, and as a very simple example, want to use a UMG widget as the HUD. For simplicity’s sake lets say the HUD just has a cross-hair in the center of the screen.

I’ve googled this issue extensively, and the underlying answer seems to be that the intended workflow is to make a UMG widget in code, then make a blueprint widget which extends your code widget, then simply create and add the code widget to the screen.

I don’t quite understand this as if the c++ widget is functionally blank, and you put an image in the center of the screen in the blueprint derived class, when you create and add the c++ widget (the parent) - it won’t have the cross-hair thus defeating the entire purpose.

If anyone has a link to a tutorial or a code snippet for what I need to do to get this working, I’d be most grateful!

If you UMG i recomand you to keep it in blueprint. Whole point of UMG is to expose Slate to blueprint and make it easier to use. But to properly access it your widget, create UUserWidget (i think maybe UWidet)which is UMG base class that widet blueprints use, put varable that you want to access in C++ and makw widget blueprint based from it and make UI utilizing the varables you made in C++

I’m ideally trying to avoid having to make a c++ widget entirely, I’m happy to keep all the HUD functionality in blueprint, the problem is that the player controller where I want to create the HUD is in c++

The setup of the function I want seems to be:
CreateWidget(APlayerController* OwningPlayer, UClass* UserWidgetClass)

I’m not entirely sure what it wants for ‘Typename’ and I don’t know how to get a reference to my HUD class as it’s not a c++ class.