Handle&Draw UI (Slate)

Hey,

I’m kinda confused and have no idea where from where i should handle & draw my UI.
I saw examples, like the(it think shootergame) where everything is handled in the HUD class.

I used to to use the HUD class and create static functions which are called inside my actor for example.

Character::BeginPlay()
{
 AMyHUD::DrawSometh():
}

I’ve also seen examples where everything is done directly inside the character class, or in the player controller, but what is the best solution?

For example I want to create a skillbar like in WoW or other MMO games, a Health/Mana bar, Party Window, Chat windows etc. , where should the UI elements be handled and from where shout they be drawn/displayed?

Can anyone help?

In order to draw slate elements (I assume you want to use slate widgets) you have to add them to the viewport.

Call this function:

GEngine->GameViewport->AddViewportWidgetContent( YOUR_WIDGET_HERE);

in your character class or HUD class and you should be ready to go.

You dont have to call any draw functions manually.

Yeah i know, but I’m not sure where i should do this, it’s more a design question

Right know I have my slate and handle Button Presses inside the SlateWidget class

ChildSlot
	[
		SAssignNew(refresh_button_, SButton)
		.ButtonStyle(FCoreStyle::Get(), "NoBorder")	
		.OnClicked(this, &STBSButton::RefreshButtonPressed)
.
.
:

But it would be much better to point to a function straight from
my player controller or character i think?