MenuButton

Special button that brings up a PopupMenu when clicked.

New items can be created inside this PopupMenu using get_popup().add_item("My Item Name"). You can also create them directly from the editor. To do so, select the MenuButton node, then in the toolbar at the top of the 2D editor, click Items then click Add in the popup. You will be able to give each item new properties. See also BaseButton which contains common properties and methods associated with this node.

Members

Aliases

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

Functions

_getItems
Array _getItems()
_setItems
void _setItems(Array arg0)
_unhandledKeyInput
void _unhandledKeyInput(InputEvent arg0)
getPopup
PopupMenu getPopup()

Returns the PopupMenu contained in this button.

isSwitchOnHover
bool isSwitchOnHover()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(MenuButton other)
opEquals
bool opEquals(typeof(null) n)
setDisableShortcuts
void setDisableShortcuts(bool disabled)

If true, shortcuts are disabled and cannot be used to trigger the button.

setSwitchOnHover
void setSwitchOnHover(bool enable)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

items
Array items [@property getter]
Array items [@property setter]
switchOnHover
bool switchOnHover [@property getter]
bool switchOnHover [@property setter]

If true, when the cursor hovers above another MenuButton within the same parent which also has switch_on_hover enabled, it will close the current MenuButton and open the other one.

Static functions

_new
MenuButton _new()

Construct a new instance of MenuButton. Note: use memnew!MenuButton instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
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
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(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