UMG UI style consistency?

Starting on UI and figuring out UMG. One question I have is…

How do I keep the UI consistent across the whole game?

If I want to change the font for a button, or background color, or button size, how do I maintain dozens/hundreds of buttons without manually modifying each individual instance? Equivalent to CSS style sheets I guess.

You can create widgets as buttons. Not sure how it works with “when button clicked.” Then if you put 100 buttons into one menu, all you need to do is to change the master button.

As above, user widgets. Wrap the button in a widget, expose what you need. Now you have a fully customizable, configurable and reusable button.

It works fine. Either get to the button and bind its event or create your own dispatcher for the above-mentioned user widget.

Sweet! I think this is the right path. I setup a widget and was able to put it into my UI.

How do I expose the values to change the text and respond to clicked events?

Variables can be flagged as Instance Editable, this will expose them once the widget becomes a child. A *text type *variable can be bound to a text block field, for example - directly editable by the parent.

When it comes to click events, it kind of depends on what the goal is. Some widgets already have click events (buttons), some allow you to bind a function and return a value (borders) - telling other widgets how you handled input, some widgets do not have events default (text block). But User Widget can override a lot of methods. So even though you’re not really supposed to double click a text block, nothing stops you from wrapping one in a widget and override double click there.

Communicating with the child is pretty straightforward since the parent already has a direct reference and can call custom events, edit variables, access pretty much anything directly; sending data back to the parent is where Event Dispatchers shine as their events are directly available on the parent.

When building the button, so I build everything into one Blueprint (button and text) or do I need to have separate button and text blueprints?

That should be fine in most cases. Unless you want something somewhat unique - as in: the text is the button.