MenuButton

Inherits: Button < BaseButton < Control < CanvasItem < Node < Object

Category: Core

Brief Description

Special button that brings up a PopupMenu when clicked.

Properties

boolswitch_on_hover

Methods

PopupMenuget_popup ( ) const
voidset_disable_shortcuts ( bool disabled )

Theme Properties

StyleBoxdisabled
StyleBoxfocus
Fontfont
Colorfont_color
Colorfont_color_disabled
Colorfont_color_hover
Colorfont_color_pressed
StyleBoxhover
inthseparation
StyleBoxnormal
StyleBoxpressed

Signals

  • about_to_show ( )

Emitted when PopupMenu of this MenuButton is about to show.

Description

Special button that brings up a PopupMenu when clicked. That’s pretty much all it does, as it’s just a helper class when building GUIs.

Property Descriptions

  • bool switch_on_hover
Setterset_switch_on_hover(value)
Getteris_switch_on_hover()

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.

Method Descriptions

Returns the PopupMenu contained in this button.


  • void set_disable_shortcuts ( bool disabled )