Custom Combo Boxes
- 50541507
- Mar 28, 2022
- 2 min read
UE4's default Combo Boxes make it very hard to customise and animate them without making one yourself from scratch. I tried this, but couldn't work out how to get the selected item from an array and use it to set text, so instead decided on a simpler approach. I used the default Combo Box, but used the Event On Mouse Enter and Event On Mouse Leave like with the Text Entry Box I made. I made the default images of the Combo Box nothing and animated a background and line at the bottom the same as the Text Entry to keep consistency. Changing the images instead of the Render Opacity of Visibility means I can keep using it and seeing the contents whilst having my own animations behind it. I customised the contents menu a bit, but there's only so much you can do with the default contents menu, and animating something like that is more hassle than it's worth. Maybe that's why Valorant decided to just go with UE4's default Combo Box, because they didn't want to spend so long on something that, ultimately, not many players will care about, which is understandable.
After creating these animations, I needed to create functions for adding options, clearing options, and setting the selected option so that I could replace the Combo Boxes I'm using with it, as those functions are in use, especially in the settings screen (which I redesigned). These functions consist of getting the Combo Box I use in my custom one, and calling those functions from it, and setting its parameters in the new function:


You can see that the target of the Add Option event is the WBP Combo Box, which my custom widget. This makes it work the same way as the default Combo Box in the widget.
To get the events from the default Combo Box into my custom widget, I used Event Dispatchers, and just parsed the same information through them:

This looks like so in use:

The only problems I see with my Combo Box are:
No contents animations (unable to be consistent with the rest of the UI)
The unhover animation doesn't play when it loses focus (user clicks away from it to close it, which is very common, and so will be something I will look into further)



Comments