Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
MenuButton¶
Inherits: Button < BaseButton < Control < CanvasItem < Node < Object
Botón especial que hace aparecer un PopupMenu cuando se hace clic.
Descripción¶
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.
Propiedades¶
action_mode |
|
|
flat |
|
|
focus_mode |
|
|
|
||
toggle_mode |
|
Métodos¶
get_popup ( ) const |
|
void |
set_disable_shortcuts ( bool disabled ) |
Propiedades del Theme¶
|
||
|
||
|
||
|
||
|
||
|
||
Señales¶
about_to_show ( )
Emitted when PopupMenu of this MenuButton is about to show.
Descripciones de Propiedades¶
bool switch_on_hover
Default |
|
Setter |
set_switch_on_hover(value) |
Getter |
is_switch_on_hover() |
Si true
, cuando el cursor se sitúe sobre otro MenuButton
dentro del mismo padre que también tenga activado switch_on_hover
, cerrará el MenuButton
actual y abrirá el otro.
Descripciones de Métodos¶
PopupMenu get_popup ( ) const
Returns the 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.
void set_disable_shortcuts ( bool disabled )
Si true
, los atajos están desactivados y no se pueden utilizar para activar el botón.
Theme Property Descriptions¶
Color font_color
Default |
|
Color del Texto predeterminado del MenuButton
.
Color font_color_disabled
Default |
|
Color del texto utilizado cuando el MenuButton
está desactivado.
Color font_color_focus
Default |
|
Text Color used when the MenuButton
is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.
Color font_color_hover
Default |
|
Color del texto usado cuando el puntero esta sobre el MenuButton
.
Color font_color_pressed
Default |
|
Color del texto utilizado cuando se pulsa el MenuButton
.
int hseparation
Default |
|
El espacio horizontal entre el icono y el texto de MenuButton
.
Font font
Font del texto del MenuButton
.
StyleBox disabled
StyleBox utilizado cuando el MenuButton
está desactivado.
StyleBox focus
StyleBox usado cuando el MenuButton
está enfocado. Se muestra sobre el StyleBox actual, por lo que al usar StyleBoxEmpty sólo se desactivará el efecto visual de enfoque.
StyleBox hover
StyleBox usado cuando el puntero del ratón esta sobre el MenuButton
.
StyleBox normal
StyleBox por defecto para el MenuButton
.
StyleBox pressed
StyleBox que se utiliza cuando se pulsa el MenuButton
.