OptionButton

Button control that provides selectable options when pressed.

OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_focused
void _focused(long arg0)
_getItems
Array _getItems()
_selectInt
void _selectInt(long arg0)
_selected
void _selected(long arg0)
_setItems
void _setItems(Array arg0)
addIconItem
void addIconItem(Texture texture, StringArg1 label, long id)

Add an item, with a "texture" icon, text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end.

addItem
void addItem(StringArg0 label, long id)

Add an item, with text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end.

addSeparator
void addSeparator()

Add a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end.

clear
void clear()

Clear all the items in the OptionButton.

getItemCount
long getItemCount()

Return the amount of items in the OptionButton.

getItemIcon
Ref!Texture getItemIcon(long idx)

Return the icon of the item at index "idx".

getItemId
long getItemId(long idx)

Return the ID of the item at index "idx".

getItemMetadata
Variant getItemMetadata(long idx)
getItemText
String getItemText(long idx)

Return the text of the item at index "idx".

getPopup
PopupMenu getPopup()

Return the PopupMenu contained in this button.

getSelected
long getSelected()
getSelectedId
long getSelectedId()
getSelectedMetadata
Variant getSelectedMetadata()
isItemDisabled
bool isItemDisabled(long idx)
opAssign
OptionButton opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(OptionButton other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
removeItem
void removeItem(long idx)
select
void select(long idx)

Select an item by index and make it the current item.

setItemDisabled
void setItemDisabled(long idx, bool disabled)
setItemIcon
void setItemIcon(long idx, Texture texture)

Set the icon of an item at index "idx".

setItemId
void setItemId(long idx, long id)

Set the ID of an item at index "idx".

setItemMetadata
void setItemMetadata(long idx, VariantArg1 metadata)
setItemText
void setItemText(long idx, StringArg1 text)

Set the text of an item at index "idx".

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

items
Array items [@property getter]
Array items [@property setter]
selected
long selected [@property getter]
long selected [@property setter]

Static functions

_new
OptionButton _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta