MenuButton
Inherits: Button < BaseButton < Control < CanvasItem < Node < Object PopupMenu when clicked.
Description
PopupMenu when clicked.
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.
BaseButton which contains common properties and methods associated with this node.
Properties
Methods
Theme Properties
Signals
- about_to_show ( )
PopupMenu of this MenuButton is about to show.
Property Descriptions
- bool switch_on_hover
true, when the cursor hovers above anotherMenuButtonwithin the same parent which also hasswitch_on_hoverenabled, it will close the currentMenuButtonand open the other one.Method Descriptions
- PopupMenu get_popup ( ) const PopupMenu contained in this button. Warning: 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 CanvasItem.visible property.
- set_disable_shortcuts ( bool disabled )
true, shortcuts are disabled and cannot be used to trigger the button.Theme Property Descriptions
- Color font_color
Color of the
MenuButton.
- Color font_color_disabled
Color used when the
MenuButtonis disabled.
- Color font_color_focus
Color used when the
MenuButtonis focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.
- Color font_color_hover
Color used when the
MenuButtonis being hovered.
- Color font_color_pressed
Color used when the
MenuButtonis being pressed.
- int hseparation
MenuButton‘s icon and text.
- Font font
Font of the
MenuButton‘s text.
- StyleBox disabled
StyleBox used when the
MenuButtonis disabled.
- StyleBox focus
StyleBox used when the
MenuButtonis focused. It is displayed over the current StyleBox, so using StyleBoxEmpty will just disable the focus visual effect.
- StyleBox hover
StyleBox used when the
MenuButtonis being hovered.
- StyleBox normal
StyleBox for the
MenuButton.
- StyleBox pressed
StyleBox used when the
MenuButtonis being pressed.
