Archive 17/01/2023.

How to use dropdownlist?

rogerdv

Im trying to use a couple of DropDownList widgets, but in the actual game they look different from UI editor. In editor, I can click and they deploy a list, empty and short, but a list. In the code, I tried to add an item

race = step1.GetChild("race", true); Text@ glist = Text(); glist.text = "Male"; race.AddItem(glist);

But it doesnt responds to clicks.

Mike

You have to subscribe race to the “ItemSelected” event.

Also set size, style, resize popup…

rogerdv

nop, that didnt solved the problem. The dropdowns are just boxes that doesnt do anything.

weitjong

You can see how it is done in C++ code in the engine’s Console class. Hope this help.

rogerdv

I switched to default style and now they work. I was trying to implement my own look for UI, but seems that it needed fixes to work.