- Home /
Enum option into a game menu gui
I have a language enum and want to have this in my game options as a selection, is it possible to have a popup box with the enum options in the game gui, as we see in the inspector?
Answer by japanitrat · Oct 13, 2011 at 09:49 AM
Although you can create a string output for a enum value in C# (you don't even need to cast/convert it to string explicitely, i believe), it might not be the best option to display languages. I suggest you create a dictionary that maps your enum values to custom strings. in your GUI draw function you just iterate over the entry set of the dictionary and check which entry has been clicked. entries are key-value-pairs, so you always have the corresponding enum value at hand when you test against a user click
hmm perhaps i should create a popup box if possible with the language buttons so they don't clutter the screen.