Scaling color/message variables across many buttons is there a parameter equivalent?

I’m building a UI widget with a fair number of buttons and I’ve hit a scaling problem I can’t find a clean answer to.

For events this works nicely: instead of one event variable per button, I use a single event variable and pass a parameter equal to the button index. Four buttons, one handler, no duplication.

Color and message variables don’t seem to support that. As far as I can tell I can’t attach a parameter to them in the widget, which means one color variable and one message variable per button. With four buttons that’s already 8 variables, and on a larger UI it becomes unmanageable.

So my question: is there a clean pattern for this, that is similar to using parameters?

Thanks.

Hello @Nero7 ,
If I understood correctly, I think the best approach to building a scalable UI system is to use UI Widgets combined with Verse.
I’m sharing this video that explains how to combine UI Widgets with Verse

As well as another one from Unreal Fest Orlando where they showcase new techniques for building UI in UEFN.

Hope it helps!

An event binding can take a parameter. A message binding and a color binding cannot. There is no parameter slot to add on those, so one widget that owns every button will always be one message and one color per button.

Make a button widget with a single message, a single color, and a single event. Keep the button data (index, text, color) in an array. For each entry, create one instance of that widget, set the message and the color on that instance, and subscribe to its event. The index is whichever instance fired. Four buttons is four instances with two bindings each, not eight bindings on one widget. The parameter lives on the instance, not on the binding.

That is the same shape the Verse videos are pointing at, just without the extra machinery. If this is UMG rather than UEFN, do the same thing there: one button widget with a Text and a Color variable, created in a loop or as a List View entry. The list item is the parameter. A List View plus an entry widget is the built-in version of one handler for many buttons.