Skip to content

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 ​

voidfill( option_button: OptionButton, enum_dictionary: Dictionary ) static
voidselect_value( option_button: OptionButton, value: int ) static
Stringwords( 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"