UMG Combobox options

Hi,

I am new to game development and Unreal Engine 4. I am using version 4.6.1

I am trying to work in Combobox for some days but still I couldnt find proper tutorials or blueprints. Is there any example events to happen when I select different options in Combobox?

Can somebody please help me to find the solution for this issue.

Thanks in advance!

Welcome to UMG, purmo037.

Whenever you drag a widget to the design interface, you will notice in the detail panel that events are at the bottom.

Combo Box has 2 events you can use, OnSelectionChanged and OnOpening. Clicking on them will add those event triggers in your Event Graph.

Hope it helps :slight_smile:

I know there are 2 events for Combo-box. But I am looking for some examples for it. And also how to connect UMG with Event Graph?

May be some tutorials or blueprints might help! Thanks!

I’m not sure I understand your question of how to connect UMG with Event Graph, a UMG widget has its own Event Graph.

Here’s a quick example of creating a combo box, populating it with default options and using events on it.

After you make a combo box (String), in the details panel on the right you will have access to setting its contents. You can use a combo box for something like picking which map to load. In the default options, populate it with all the maps you want to give as choices. The selected option represents which of those you want that combo box to have as default when the widget is loaded. In my example I’m using “Option One” and “Option Two”, with the latter being my default one, you can see it working when you compile the blueprint, because your combo box will represent your changes!

When you’re happy with the options in your combo box you can add the two events I mentioned earlier (or just one, it’s really up to you and what you would use them for). OnOpening is going to trigger every time you activate the combo box. OnSelectionChanged will fire when an option (from the ones available in step 1) was selected. You will receive an enum with the selection type (usually on mouse click) along with the string value of the selection.

From here you can use this example to do anything you would have liked! If you populate it with a list of maps, you can make OnSelectionChanged set a variable “MapToLoad” with the selected option and have a button who’s “OnClick” event fires the “OpenLevel” function with your “MapToLoad”!

Hope it helps :slight_smile:

i don’t want to hi jack this thread but since this is on topic of the thread and want to save on creating a thread since this is already existing,

is it possible to use the combobox for game settings like PostProcessing in blueprints or will i have to do this through actual buttons,

I made strings Off Low Mid High, to onopening and when it comes to onselected, iv tried using conditions but there is no conversion from String to Boolean, so how would i go about this?

Yes it is possible to use the combo box for game settings, the way I’ve used it was with “Switch on String”.

Just pass it cases for each of your settings and set your setting on the appropriate switch.