So I found this blueprint template in this tutorial on creating widgets:
I’m wondering if theres anyone to do this in code. I have a pointer to my widget I create, and to the blueprint I create it from. Assigning it to the view port should be something like this:
GEngine->GameViewport->AddViewportWidgetContent(SNew(MyWidget));
Well I managed to spawn it. But yeah I still can’t add it to view port in the code. I created UZeltexWidget by extending UUserWidget class. Theres a button, when you create a widget that lets you reparent it from UserWidget to your custom one.