EnumOptions ​
Inherits: RefCounted
Fills the items of an OptionButton from an enum, so a pre-built option button in a scene shows the values of an enum without a list of names to keep up to date.
Methods ​
void | fill( option_button: OptionButton, enum_dictionary: Dictionary ) static |
void | select_value( option_button: OptionButton, value: int ) static |
String | words( enum_name: String ) static |
Method descriptions ​
void fill( option_button: OptionButton, enum_dictionary: Dictionary ) ​
The items are the names of the enum, written as words ("PERCENT_INCREASE" becomes "Percent increase"). The id of an item is the value of the enum. Does nothing when the button already has its items
void select_value( option_button: OptionButton, value: int ) ​
Selects the item of a value
String words( enum_name: String ) ​
"PERCENT_INCREASE" -> "Percent increase"