0

Change Langauge via UI Dropdown

Phazorknight 4 weeks ago in Game Creator updated by ProfPivec 4 weeks ago 3

Hey everyone,

I try to have a language selector in my pause menu.

How do I get to change the active language using a Dropdown on my UI?

It has an "on value changed" event, so I should be able to use that / get the string out of it, but how can I use that to trigger an action to change the language to what was selected?

Any help would be greatly appreciated.

Thanks!

Unity version:
2019.4
Game Creator version:
+1

Hi Phazorknight

As GC does not have a DropDown as yet (we do have one in the UI Components that you could perhaps modify), this is not really easy.

You will need to populate the dropdown with available languages. Then on value change execute the Change Language Action. While this is easy to do with code, I am not sure how that it is possible without. Yes, you can call the change Language Action on Value changed, but how to get the index of the correct selection is not really possible with a script.

I could add this to the next UI Components ts Update if you have that Module, and can wait a week to two.

Regards

Hey ProfPivec,
Thanks for the reply and looking into this. I figured I might have to do a small little script myself.

Unfortunately I couldn't find any documentation on the code of the change language action (method/class names and parameters), so I'd appreciate any pointers in that regard.

Otherwise, I might just have to do a conditional script that checks the string value of my dropdown on value change and then calls a separate Change Language action for each possibility, but it's not very elegant.

There isn't any Docs on this. however, if I get time I will add this feature to the next UI Components update.