Time for action – making the HUD work
Follow the given steps:
First of all, we need to load a level. Once this is done, we will disable the old HUD via the
g_showHud 0
CVAR.Because we will use a new UI Action Flow Graph for the HUD, we need to open the Flow Graph. Go to View | Open View Pane | Flow Graph. Under File, we can select New UI Action.... In the file dialog, navigate to
Game\Libs\UI\UIActions
.Name it something like
NewHUD
, and click Save. The Flow Graph should be automatically displayed in the Flow Graph Editor. All UI Actions will be found in theUIActions
folder of the Flow Graph list.Note
The final Flow Graph will be shown at the end of this section.
We start with a Start node. Right-click into the Flow Graph, and select Add Start Node. Because we want to display our HUD on level startup, we need to add a UI:Display:Display node. In the Element port of this node, you can select your
NewHUD
UIElement (select the Element port and click on the little browse button to select your UIElement...