How to handle HUD and SLATE in C++

Prolog: To avoid redundance answers in the web, please only answer if you really have notion of it. That means no Blueprint or third party plugin solutions. Thanks :smiley:

Hello everyone,

I’ve been studying HUD and SLATE the last three days intensively, but there are still a few questions:

Q1: Why is HUD coupled to SLATE?

Comments: According to the common definitions of HUD and GUI(Slate), these two parts should be handled separately.
The ShooterGame example just uses SLATE. I thought, it might be a good idea to do so too, but almost every tutorial out there uses HUD AND SLATE. The ShooterGame uses APlayerController Class as WeakPointer, but why changing PlayerController in that case? And all the tutorials out there are using AHUD Class as WeakPointer, which makes more sense to me, but still that is not understandable. A WeakPointer to a SlateWidget would be plausible.

Q2: Is a EPIC GAMES exclusive visual editor in work?

Comments: Like Unity3D GUI2, it would be very helpful to have a visual editor with code generating. Is something in work? And if yes, what is the ETA?

Thanks in advance :smiley:

I dunno what definitions what you have read but:

HUD is GUI. Both elements purpose is to display some information in form which can be used by end user. You can use whatever UI toolkit to render in game UI, you can imagine. Assuming you can hook it up to rendering in engine. Slate is just UI Toolkit.

AHUD class is just actor, used hold information about well HUD. It could be just as well be called AFoo. How do choose to draw information into the HUD is entirely up to you.

You need to setup WeakPointer in AHUD, because you might run into circular reference problem, a by that cause memory leak, where objects can be deleted because they hold shared references to each other.

On the other hand you want Shared pointer to Slate Widget, because it might be owned by few elements at the same time. If it was all weak pointer if one of these objects would delete widget it would invalidate it for all objects.

Yes UMG is the graphical GUI editor in the works. In 4.4 it should in Experimental section of editor.

Thank you very much for this answer. That helps a lot. I still have learned and have to say, I’ve asked hastily the first question :smiley:

Now I know much more, but:

There is still one big question:

I do not find the point in the ShooterGameExample where the menu and ingame menu are drawn.
There is a HUD, but no function included that do this task, or did I miss something.

Thanks in advance.