Consistent UMG navigation with mouse, keyboard, or gamepad?

tl;dr:

I just don’t like the button very much.

Indeed, it’s quite a bit of extra upfront work since the button already has useful functionality, and plenty of bells & whistles - like styles, click methods, sound handling, hover states…

But if you do want a UI control that does not steal focus like it’s its job, you cannot use a button as is. I could not.


I needed a layered, flexibile click-through interface, so I settled for something along the lines of:

  • base class
  • specialised children

image

All standard behaviours and shared functionality are scripted in the Base - hover states, sound handling, visual styles, dynamic material creation and so on:

The specialised UI elements inherit from that base:

image

The actual UI control used in the project are reparented to this base and equipped with additional unique functionality - standard inheritance, really.

In the child, do note how the reparented hierarchy is empty:

But the underlaying widgets are actually there and fully functional:

And you can add parent calls as per usual. If half way through the project you need to change something across the entire UI or parts of it, add functionality, touch up the visuals, you can do it in the base classes.

This would allow you to create highly customisable UI controls.

1 Like