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
Hereda: Button < BaseButton < Control < CanvasItem < Node < Object
Un botón que abre un PopupMenu cuando se hace clic en él.
Descripción
A button that brings up a PopupMenu when clicked. To create new items inside this PopupMenu, use get_popup().add_item("My Item Name"). You can also create them directly from Godot editor's inspector.
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(disabled: bool) |
void |
Señales
about_to_popup() 🔗
Emitida cuando el PopupMenu de este MenuButton está a punto de aparecer.
Descripciones de Propiedades
El número de elementos que hay actualmente en la lista.
int popup/item_{index}/checkable = 0 🔗
The checkable item type of the item at index.
Note: index is a value in the 0 .. item_count - 1 range.
bool popup/item_{index}/checked = false 🔗
If true, the item at index is checked.
Note: index is a value in the 0 .. item_count - 1 range.
bool popup/item_{index}/disabled = false 🔗
If true, the item at index is disabled.
Note: index is a value in the 0 .. item_count - 1 range.
Texture2D popup/item_{index}/icon 🔗
The icon of the item at index.
Note: index is a value in the 0 .. item_count - 1 range.
int popup/item_{index}/id = 0 🔗
The ID of the item at index.
Note: index is a value in the 0 .. item_count - 1 range.
bool popup/item_{index}/separator = false 🔗
If true, the item at index is a separator.
Note: index is a value in the 0 .. item_count - 1 range.
String popup/item_{index}/text = "" 🔗
The text of the item at index.
Note: index is a value in the 0 .. item_count - 1 range.
bool switch_on_hover = false 🔗
Si es true, cuando el cursor se sitúa sobre otro MenuButton dentro del mismo padre que también tenga switch_on_hover activado, cerrará el MenuButton actual y abrirá el otro.
Descripciones de Métodos
Devuelve el PopupMenu contenido en este botón.
Advertencia: Este es un nodo interno requerido, eliminarlo y liberarlo puede causar un fallo. Si deseas ocultarlo o alguno de sus hijos, usa su propiedad Window.visible.
void set_disable_shortcuts(disabled: bool) 🔗
Si es true, los atajos están desactivados y no se pueden utilizar para activar el botón.
void show_popup() 🔗
Ajusta la posición y el tamaño del popup para el MenuButton, luego muestra el PopupMenu. Es preferible usar esto en lugar de get_popup().popup().