Skip to content

Add a HUD element

Designer · 20 min · No code

Result: your own widget (here, an in-game clock) on the HUD in play, placed in one of the HUD's named slots, without editing W_XenoCore_HUDLayout or any other XenoCore asset.

Before you start

  • UI shell and HUD: layers, HUD plates, and why a HUD element hides by opacity.
  • Glossary: Experience, Game Feature plugin.

How it works

The HUD layout, UserInterface/HUD/W_XenoCore_HUDLayout, carries five empty extension points: Lyra's UIExtensionPointWidget, each named by a gameplay tag. Lyra's Add Widgets action puts a widget into the point whose tag matches. The points are empty and do not take clicks until something is added.

Slot tag Where on screen How several widgets stack
HUD.Slot.XenoCore.TopCenter Top centre, 48 px down In a column, centred
HUD.Slot.XenoCore.TopRight Top right, 48 px in, 330 px down (below the minimap and its prompt) In a column, right-aligned
HUD.Slot.XenoCore.Center Screen centre On top of each other
HUD.Slot.XenoCore.BottomCenter Bottom centre, 48 px up In a column, centred
HUD.Slot.XenoCore.FullScreen Fills the screen, behind the rest of the HUD On top of each other

All five tags come with XenoCore, so they appear in every tag picker.

Steps

1. Make the widget

  1. In Content/MyGame/UI, right-click and choose User Interface › Widget Blueprint, parent User Widget. Name it W_MyGame_Clock.
  2. Lay it out small: the slot sizes itself to your widget (except FullScreen).
  3. Set anything that must not catch clicks to Hit Test Invisible.

For a widget that fades in and out

Parent it to XenoCoreHudPlateBase instead. It then has Set Shown (fade in or out without removing it), Set Shown Immediate, Set Show Delay and, from its own graph, Begin Hidden and Skip Intro, all callable from Blueprint. Never hide a HUD element by collapsing it: a collapsed widget stops ticking and cannot notice when to come back.

2. Add it with an action set

Keep the addition in your own asset, so a template update cannot remove it.

  1. In Content/MyGame/Experiences, right-click and choose Data › Data Asset, class LyraExperienceActionSet. Name it LAS_MyGame_HUD.
  2. Open it. Under Actions to Perform, add an entry and choose Add Widgets.
  3. Under Widgets, add a row:
    • Widget Class: W_MyGame_Clock
    • Slot ID: HUD.Slot.XenoCore.TopCenter
  4. Leave Layout empty. That list is for whole HUD layouts, such as the one Experiences/LAS_XenoCore_HUD adds.
  5. Save.

3. Use the action set in your experience

An Experience decides what a map loads, HUD included.

  1. In Plugins › XenoCore Content › Experiences, duplicate B_XenoCore_Experience into Content/MyGame/Experiences if you have not already, and point your maps' World Settings › Default Gameplay Experience at the copy.
  2. Open the copy, click Class Defaults, and add LAS_MyGame_HUD to Action Sets, beside LAS_XenoCore_HUD.
  3. Save.

From your own Game Feature plugin instead

If your content lives in its own Game Feature plugin, you can put the same Add Widgets action in that plugin's Game Feature Data (Actions). It applies whenever that feature is active.

Test it

  1. Open a map that uses your experience and press Play.
  2. The clock appears at the top centre when the HUD appears.
  3. Open the menu: the HUD, clock included, stays under the menu; close it and the clock is still there.
  4. Stop and remove the row: nothing else on the HUD changed.

If it doesn't work

Fails silently: the widget never appears

Nothing is logged when a widget goes to a slot tag no extension point carries. Check, in order: the Slot ID is one of the five HUD.Slot.XenoCore.* tags exactly; the action set is in the Action Sets of the experience the map actually uses (Window › World Settings › Default Gameplay Experience); Widget Class is set. An ExperienceOverride line in your project's Saved/Config files also outranks World Settings; delete it if you find one.

The widget appears behind everything

FullScreen is deliberately behind the rest of the HUD. Use Center for an overlay that must be on top.

The widget blocks clicks on a menu

It cannot: the HUD is on the game layer, under the menus. If it blocks clicks in play, a child widget is Visible; set it to Hit Test Invisible.

Going further