A button that brings up a [PopupMenu] when clicked.
A button that brings up a [PopupMenu] when clicked. To create new items inside this [PopupMenu], use [code]get_popup().add_item("My Item Name")[/code]. You can also create them directly from Godot editor's inspector. See also [BaseButton] which contains common properties and methods associated with this node.
Returns the [PopupMenu] contained in this button. [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
If [code]true[/code], shortcuts are disabled and cannot be used to trigger the button.
Adjusts popup position and sizing for the [MenuButton], then shows the [PopupMenu]. Prefer this over using [code]get_popup().popup()[/code].
- The number of items currently in the list.
- If [code]true[/code], when the cursor hovers above another [MenuButton] within the same parent which also has [member switch_on_hover] enabled, it will close the current [MenuButton] and open the other one.
Emitted when the [PopupMenu] of this MenuButton is about to show.