PopupMenu
Hereda: Popup < Window < Viewport < Node < Object
Una ventana modal utilizada para mostrar una lista de opciones.
Descripción
PopupMenu is a modal window used to display a list of options. Useful for toolbars and context menus.
The size of a PopupMenu can be limited by using Window.max_size. If the height of the list of items is larger than the maximum height of the PopupMenu, a ScrollContainer within the popup will allow the user to scroll the contents. If no maximum size is set, or if it is set to 0, the PopupMenu height will be limited by its parent rect.
All set_* methods allow negative item indices, i.e. -1 to access the last item, -2 to select the second-to-last item, and so on.
Incremental search: Like ItemList and Tree, PopupMenu supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing ProjectSettings.gui/timers/incremental_search_max_interval_msec.
Note: PopupMenu is invisible by default. To make it visible, call one of the popup_* methods from Window on the node, such as Window.popup_centered_clamped().
Note: The ID values used for items are limited to 32 bits, not full 64 bits of int. This has a range of -2^32 to 2^32 - 1, i.e. -2147483648 to 2147483647.
Propiedades
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
transparent |
|
|
transparent_bg |
|
Métodos
activate_item_by_event(event: InputEvent, for_global_only: bool = false) |
|
void |
add_check_item(label: String, id: int = -1, accel: Key = 0) |
void |
add_check_shortcut(shortcut: Shortcut, id: int = -1, global: bool = false) |
void |
add_icon_check_item(texture: Texture2D, label: String, id: int = -1, accel: Key = 0) |
void |
add_icon_check_shortcut(texture: Texture2D, shortcut: Shortcut, id: int = -1, global: bool = false) |
void |
add_icon_item(texture: Texture2D, label: String, id: int = -1, accel: Key = 0) |
void |
add_icon_radio_check_item(texture: Texture2D, label: String, id: int = -1, accel: Key = 0) |
void |
add_icon_radio_check_shortcut(texture: Texture2D, shortcut: Shortcut, id: int = -1, global: bool = false) |
void |
add_icon_shortcut(texture: Texture2D, shortcut: Shortcut, id: int = -1, global: bool = false, allow_echo: bool = false) |
void |
|
void |
add_multistate_item(label: String, max_states: int, default_state: int = 0, id: int = -1, accel: Key = 0) |
void |
add_radio_check_item(label: String, id: int = -1, accel: Key = 0) |
void |
add_radio_check_shortcut(shortcut: Shortcut, id: int = -1, global: bool = false) |
void |
add_separator(label: String = "", id: int = -1) |
void |
add_shortcut(shortcut: Shortcut, id: int = -1, global: bool = false, allow_echo: bool = false) |
void |
add_submenu_item(label: String, submenu: String, id: int = -1) |
void |
add_submenu_node_item(label: String, submenu: PopupMenu, id: int = -1) |
void |
|
get_focused_item() const |
|
get_item_accelerator(index: int) const |
|
get_item_auto_translate_mode(index: int) const |
|
get_item_icon(index: int) const |
|
get_item_icon_max_width(index: int) const |
|
get_item_icon_modulate(index: int) const |
|
get_item_id(index: int) const |
|
get_item_indent(index: int) const |
|
get_item_index(id: int) const |
|
get_item_language(index: int) const |
|
get_item_metadata(index: int) const |
|
get_item_multistate(index: int) const |
|
get_item_multistate_max(index: int) const |
|
get_item_shortcut(index: int) const |
|
get_item_submenu(index: int) const |
|
get_item_submenu_node(index: int) const |
|
get_item_text(index: int) const |
|
get_item_text_direction(index: int) const |
|
get_item_tooltip(index: int) const |
|
is_item_checkable(index: int) const |
|
is_item_checked(index: int) const |
|
is_item_disabled(index: int) const |
|
is_item_radio_checkable(index: int) const |
|
is_item_separator(index: int) const |
|
is_item_shortcut_disabled(index: int) const |
|
is_native_menu() const |
|
is_system_menu() const |
|
void |
remove_item(index: int) |
void |
scroll_to_item(index: int) |
void |
set_focused_item(index: int) |
void |
set_item_accelerator(index: int, accel: Key) |
void |
set_item_as_checkable(index: int, enable: bool) |
void |
set_item_as_radio_checkable(index: int, enable: bool) |
void |
set_item_as_separator(index: int, enable: bool) |
void |
set_item_auto_translate_mode(index: int, mode: AutoTranslateMode) |
void |
set_item_checked(index: int, checked: bool) |
void |
set_item_disabled(index: int, disabled: bool) |
void |
set_item_icon(index: int, icon: Texture2D) |
void |
set_item_icon_max_width(index: int, width: int) |
void |
set_item_icon_modulate(index: int, modulate: Color) |
void |
set_item_id(index: int, id: int) |
void |
set_item_indent(index: int, indent: int) |
void |
set_item_language(index: int, language: String) |
void |
set_item_metadata(index: int, metadata: Variant) |
void |
set_item_multistate(index: int, state: int) |
void |
set_item_multistate_max(index: int, max_states: int) |
void |
set_item_shortcut(index: int, shortcut: Shortcut, global: bool = false) |
void |
set_item_shortcut_disabled(index: int, disabled: bool) |
void |
set_item_submenu(index: int, submenu: String) |
void |
set_item_submenu_node(index: int, submenu: PopupMenu) |
void |
set_item_text(index: int, text: String) |
void |
set_item_text_direction(index: int, direction: TextDirection) |
void |
set_item_tooltip(index: int, tooltip: String) |
void |
toggle_item_checked(index: int) |
void |
toggle_item_multistate(index: int) |
Propiedades del Tema
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Señales
Emitida cuando el usuario navega a un elemento de algún id utilizando la acción de entrada ProjectSettings.input/ui_up o ProjectSettings.input/ui_down.
Emitted when an item of some id is pressed. Also emitted when its accelerator is activated on macOS.
Note: If id is negative (either explicitly or due to overflow), this will return the corresponding index instead.
Emitted when an item of some index is pressed. Also emitted when its accelerator is activated on macOS.
menu_changed() 🔗
Emitida cuando se agrega, modifica o elimina cualquier elemento.
Descripciones de Propiedades
Si es true, permite navegar por el PopupMenu con las teclas de letras.
bool hide_on_checkable_item_selection = true 🔗
Si es true, oculta el PopupMenu cuando se selecciona una casilla de verificación o un botón de radio.
bool hide_on_item_selection = true 🔗
Si es true, oculta el PopupMenu cuando se selecciona un elemento.
bool hide_on_state_item_selection = false 🔗
Si es true, oculta el PopupMenu cuando se selecciona un elemento de estado.
El número de elementos que hay actualmente en la lista.
bool prefer_native_menu = false 🔗
Si es true, MenuBar usará el menú nativo cuando sea compatible.
Nota: Si PopupMenu está enlazado a StatusIndicator, MenuBar, u otro elemento PopupMenu puede usar el menú nativo independientemente de esta propiedad, usa is_native_menu() para comprobarlo.
If true, shrinks PopupMenu to minimum height when it's shown.
If true, shrinks PopupMenu to minimum width when it's shown.
float submenu_popup_delay = 0.2 🔗
Sets the delay time in seconds for the submenu item to popup on mouse hovering. If the popup menu is added as a child of another (acting as a submenu), it will inherit the delay time of the parent menu item.
Note: If the mouse is exiting a submenu item with an open submenu and enters a different submenu item, the submenu popup delay time is affected by the direction of the mouse movement toward the open submenu. If the mouse is moving toward the submenu, the open submenu will wait approximately 0.5 seconds before closing, which then allows the hovered submenu item to open. This additional delay allows the mouse time to move to the open submenu across other menu items without prematurely closing. If the mouse is not moving toward the open submenu, for example in a downward direction, the open submenu will close immediately.
SystemMenus system_menu_id = 0 🔗
void set_system_menu(value: SystemMenus)
SystemMenus get_system_menu()
Si se establece en uno de los valores de SystemMenus, este PopupMenu está vinculado al menú especial del sistema. Solo un PopupMenu puede estar vinculado a cada menú especial a la vez.
Descripciones de Métodos
bool activate_item_by_event(event: InputEvent, for_global_only: bool = false) 🔗
Comprueba el event proporcionado con los atajos y aceleradores del PopupMenu, y activa el primer elemento con eventos coincidentes. Si for_global_only es true, solo se llamarán a los atajos y aceleradores con global establecido en true.
Devuelve true si un elemento se activó correctamente.
Nota: Ciertos Controls, como MenuButton, llamarán a este método automáticamente.
void add_check_item(label: String, id: int = -1, accel: Key = 0) 🔗
Adds a new checkable item with text label.
An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided, then the default value of 0 (corresponding to @GlobalScope.KEY_NONE) will be assigned to the item (which means it won't have any accelerator). See get_item_accelerator() for more info on accelerators.
Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See set_item_checked() for more info on how to control it.
void add_check_shortcut(shortcut: Shortcut, id: int = -1, global: bool = false) 🔗
Adds a new checkable item and assigns the specified Shortcut to it. Sets the label of the checkbox to the Shortcut's name.
An id can optionally be provided. If no id is provided, one will be created from the index.
Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See set_item_checked() for more info on how to control it.
void add_icon_check_item(texture: Texture2D, label: String, id: int = -1, accel: Key = 0) 🔗
Adds a new checkable item with text label and icon texture.
An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided, then the default value of 0 (corresponding to @GlobalScope.KEY_NONE) will be assigned to the item (which means it won't have any accelerator). See get_item_accelerator() for more info on accelerators.
Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See set_item_checked() for more info on how to control it.
void add_icon_check_shortcut(texture: Texture2D, shortcut: Shortcut, id: int = -1, global: bool = false) 🔗
Adds a new checkable item and assigns the specified Shortcut and icon texture to it. Sets the label of the checkbox to the Shortcut's name.
An id can optionally be provided. If no id is provided, one will be created from the index.
Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See set_item_checked() for more info on how to control it.
void add_icon_item(texture: Texture2D, label: String, id: int = -1, accel: Key = 0) 🔗
Adds a new item with text label and icon texture.
An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided, then the default value of 0 (corresponding to @GlobalScope.KEY_NONE) will be assigned to the item (which means it won't have any accelerator). See get_item_accelerator() for more info on accelerators.
void add_icon_radio_check_item(texture: Texture2D, label: String, id: int = -1, accel: Key = 0) 🔗
Igual que add_icon_check_item(), pero utiliza un botón de comprobación de radio.
void add_icon_radio_check_shortcut(texture: Texture2D, shortcut: Shortcut, id: int = -1, global: bool = false) 🔗
Igual que add_icon_check_shortcut(), pero utiliza un botón de comprobación de radio.
void add_icon_shortcut(texture: Texture2D, shortcut: Shortcut, id: int = -1, global: bool = false, allow_echo: bool = false) 🔗
Adds a new item and assigns the specified Shortcut and icon texture to it. Sets the label of the checkbox to the Shortcut's name.
An id can optionally be provided. If no id is provided, one will be created from the index.
If allow_echo is true, the shortcut can be activated with echo events.
void add_item(label: String, id: int = -1, accel: Key = 0) 🔗
Adds a new item with text label.
An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided, then the default value of 0 (corresponding to @GlobalScope.KEY_NONE) will be assigned to the item (which means it won't have any accelerator). See get_item_accelerator() for more info on accelerators.
Note: The provided id is used only in id_pressed and id_focused signals. It's not related to the index arguments in e.g. set_item_checked().
void add_multistate_item(label: String, max_states: int, default_state: int = 0, id: int = -1, accel: Key = 0) 🔗
Adds a new multistate item with text label.
Contrarily to normal binary items, multistate items can have more than two states, as defined by max_states. The default value is defined by default_state.
An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided, then the default value of 0 (corresponding to @GlobalScope.KEY_NONE) will be assigned to the item (which means it won't have any accelerator). See get_item_accelerator() for more info on accelerators.
func _ready():
add_multistate_item("Item", 3, 0)
index_pressed.connect(func(index: int):
toggle_item_multistate(index)
match get_item_multistate(index):
0:
print("First state")
1:
print("Second state")
2:
print("Third state")
)
Note: Multistate items don't update their state automatically and must be done manually. See toggle_item_multistate(), set_item_multistate() and get_item_multistate() for more info on how to control it.
void add_radio_check_item(label: String, id: int = -1, accel: Key = 0) 🔗
Adds a new radio check button with text label.
An id can optionally be provided, as well as an accelerator (accel). If no id is provided, one will be created from the index. If no accel is provided, then the default value of 0 (corresponding to @GlobalScope.KEY_NONE) will be assigned to the item (which means it won't have any accelerator). See get_item_accelerator() for more info on accelerators.
Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See set_item_checked() for more info on how to control it.
void add_radio_check_shortcut(shortcut: Shortcut, id: int = -1, global: bool = false) 🔗
Adds a new radio check button and assigns a Shortcut to it. Sets the label of the checkbox to the Shortcut's name.
An id can optionally be provided. If no id is provided, one will be created from the index.
Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See set_item_checked() for more info on how to control it.
void add_separator(label: String = "", id: int = -1) 🔗
Añade un separador entre los elementos. Los separadores también ocupan un índice, que se puede establecer utilizando el parámetro id.
Opcionalmente, se puede proporcionar un label, que aparecerá en el centro del separador.
void add_shortcut(shortcut: Shortcut, id: int = -1, global: bool = false, allow_echo: bool = false) 🔗
Añade un Shortcut.
Se puede proporcionar un id opcionalmente. Si no se proporciona un id, se creará uno a partir del índice.
Si allow_echo es true, el atajo se puede activar con eventos de eco.
void add_submenu_item(label: String, submenu: String, id: int = -1) 🔗
Obsoleto: Prefer using add_submenu_node_item() instead.
Añade un elemento que actuará como submenú del nodo padre PopupMenu cuando se haga clic. El argumento submenu debe ser el nombre de un PopupMenu existente que se haya añadido como hijo a este nodo. Este submenú se mostrará cuando se haga clic en el elemento, se mantenga el ratón encima durante el tiempo suficiente o se active mediante las acciones de entrada ui_select o ui_right.
Se puede proporcionar un id opcionalmente. Si no se proporciona un id, se creará uno a partir del índice.
void add_submenu_node_item(label: String, submenu: PopupMenu, id: int = -1) 🔗
Añade un elemento que actuará como submenú del nodo padre PopupMenu cuando se haga clic. Este submenú se mostrará cuando se haga clic en el elemento, se mantenga el ratón encima durante el tiempo suficiente o se active mediante las acciones de entrada ui_select o ui_right.
submenu debe ser hijo de este PopupMenu o no tener un nodo padre (en cuyo caso se añadirá automáticamente como hijo). Si el popup submenu tiene otro padre, este método fallará.
Se puede proporcionar un id opcionalmente. Si no se proporciona un id, se creará uno a partir del índice.
void clear(free_submenus: bool = false) 🔗
Elimina todos los elementos del PopupMenu. Si free_submenus es true, los nodos del submenú se liberan automáticamente.
int get_focused_item() const 🔗
Devuelve el índice del elemento actualmente enfocado. Devuelve -1 si no hay ningún elemento enfocado.
Key get_item_accelerator(index: int) const 🔗
Devuelve el acelerador del elemento en el index dado. Un acelerador es un atajo de teclado que se puede pulsar para activar el botón del menú incluso si no está abierto. El valor de retorno es un entero que generalmente es una combinación de KeyModifierMasks y Keys usando OR bitwise como KEY_MASK_CTRL | KEY_A (Ctrl + A). Si no se define ningún acelerador para el index especificado, get_item_accelerator() devuelve 0 (correspondiente a @GlobalScope.KEY_NONE).
AutoTranslateMode get_item_auto_translate_mode(index: int) const 🔗
Devuelve el modo de traducción automática del elemento en el index dado.
Texture2D get_item_icon(index: int) const 🔗
Devuelve el icono del elemento en el index dado.
int get_item_icon_max_width(index: int) const 🔗
Devuelve el ancho máximo permitido del icono para el elemento en el index dado.
Color get_item_icon_modulate(index: int) const 🔗
Devuelve un Color que modula el icono del elemento en el index dado.
int get_item_id(index: int) const 🔗
Devuelve el ID del elemento en el index dado. El id se puede asignar manualmente, mientras que el índice no.
int get_item_indent(index: int) const 🔗
Devuelve el desplazamiento horizontal del elemento en el index dado.
int get_item_index(id: int) const 🔗
Devuelve el índice del elemento que contiene el id especificado. El índice se asigna automáticamente a cada elemento por el motor y no se puede establecer manualmente.
String get_item_language(index: int) const 🔗
Devuelve el código de idioma del texto del elemento.
Variant get_item_metadata(index: int) const 🔗
Devuelve los metadatos del elemento especificado, que pueden ser de cualquier tipo. Puede configurarlo con set_item_metadata(), que proporciona una forma sencilla de asignar datos de contexto a los elementos.
int get_item_multistate(index: int) const 🔗
Devuelve el estado del elemento en el index dado.
int get_item_multistate_max(index: int) const 🔗
Devuelve el número máximo de estados del elemento en el index dado.
Shortcut get_item_shortcut(index: int) const 🔗
Devuelve el Shortcut asociado al elemento en el index dado.
String get_item_submenu(index: int) const 🔗
Obsoleto: Prefer using get_item_submenu_node() instead.
Devuelve el nombre del submenú del elemento en el index dado. Véase add_submenu_item() para obtener más información sobre cómo añadir un submenú.
PopupMenu get_item_submenu_node(index: int) const 🔗
Devuelve el submenú del elemento en el index dado, o null si no se añadió ningún submenú. Véase add_submenu_node_item() para obtener más información sobre cómo añadir un submenú.
String get_item_text(index: int) const 🔗
Devuelve el texto del elemento en el index dado.
TextDirection get_item_text_direction(index: int) const 🔗
Devuelve la dirección de escritura base del texto del elemento.
String get_item_tooltip(index: int) const 🔗
Returns the tooltip associated with the item at the given index.
bool is_item_checkable(index: int) const 🔗
Returns true if the item at the given index is checkable in some way, i.e. if it has a checkbox or radio button.
Note: Checkable items just display a checkmark or radio button, but don't have any built-in checking behavior and must be checked/unchecked manually.
bool is_item_checked(index: int) const 🔗
Devuelve true si el elemento en el index dado está marcado.
bool is_item_disabled(index: int) const 🔗
Devuelve true si el elemento en el index dado está desactivado. Cuando está desactivado, no se puede seleccionar ni invocar su acción.
Véase set_item_disabled() para obtener más información sobre cómo desactivar un elemento.
bool is_item_radio_checkable(index: int) const 🔗
Devuelve true si el elemento en el index dado tiene una capacidad de comprobación estilo botón de radio.
Nota: Esto es puramente estético; debes añadir la lógica para marcar/desmarcar elementos en grupos de radio.
bool is_item_separator(index: int) const 🔗
Devuelve true si el artículo es un separador. Si lo es, se mostrará como una línea. Véase add_separator() para más información sobre cómo añadir un separador.
bool is_item_shortcut_disabled(index: int) const 🔗
Devuelve true si el atajo del elemento especificado está desactivado.
Devuelve true si el menú nativo del sistema es compatible y actualmente utilizado por este PopupMenu.
Devuelve true si el menú está vinculado al menú especial del sistema.
void remove_item(index: int) 🔗
Elimina el elemento en el index dado del menú.
Nota: Los índices de los elementos después del elemento eliminado se desplazarán en uno.
void scroll_to_item(index: int) 🔗
Mueve la vista de desplazamiento para hacer visible el elemento en el index dado.
void set_focused_item(index: int) 🔗
Establece el elemento actualmente enfocado como el index dado.
Pasar -1 como índice hace que ningún elemento esté enfocado.
void set_item_accelerator(index: int, accel: Key) 🔗
Establece el acelerador del elemento en el index dado. Un acelerador es un atajo de teclado que se puede presionar para activar el botón del menú incluso si no está abierto. accel es generalmente una combinación de KeyModifierMasks y Keys usando OR bitwise como KEY_MASK_CTRL | KEY_A (Ctrl + A).
void set_item_as_checkable(index: int, enable: bool) 🔗
Establece si el elemento en el index dado tiene una casilla de verificación. Si es false, establece el tipo del elemento como texto plano.
Nota: Los elementos comprobables solo muestran una marca de verificación, pero no tienen ningún comportamiento de comprobación incorporado y deben marcarse/desmarcarse manualmente.
void set_item_as_radio_checkable(index: int, enable: bool) 🔗
Establece el tipo del elemento en el index dado como botón de radio. Si es false, establece el tipo del elemento como texto plano.
void set_item_as_separator(index: int, enable: bool) 🔗
Marca el elemento en el index dado como un separador, lo que significa que se mostrará como una línea. Si es false, establece el tipo del elemento como texto plano.
void set_item_auto_translate_mode(index: int, mode: AutoTranslateMode) 🔗
Establece el modo de traducción automática del elemento en el index dado.
Los elementos utilizan Node.AUTO_TRANSLATE_MODE_INHERIT por defecto, que utiliza el mismo modo de traducción automática que el propio PopupMenu.
void set_item_checked(index: int, checked: bool) 🔗
Establece el estado de marcado del elemento en el index dado.
void set_item_disabled(index: int, disabled: bool) 🔗
Activa/desactiva el elemento en el index dado. Cuando está desactivado, no se puede seleccionar y su acción no se puede invocar.
void set_item_icon(index: int, icon: Texture2D) 🔗
Reemplaza el icono Texture2D del elemento en el index dado.
void set_item_icon_max_width(index: int, width: int) 🔗
Establece el ancho máximo permitido del icono para el elemento en el index dado. Este límite se aplica sobre el tamaño predeterminado del icono y sobre icon_max_width. La altura se ajusta según la relación del icono.
void set_item_icon_modulate(index: int, modulate: Color) 🔗
Establece un Color modulador del icono del elemento en el index dado.
void set_item_id(index: int, id: int) 🔗
Establece el id del elemento en el index dado.
El id se utiliza en las señales id_pressed y id_focused.
void set_item_indent(index: int, indent: int) 🔗
Establece el desplazamiento horizontal del elemento en el index dado.
void set_item_language(index: int, language: String) 🔗
Sets the language code of the text for the item at the given index to language. This is used for line-breaking and text shaping algorithms. If language is empty, the current locale is used.
void set_item_metadata(index: int, metadata: Variant) 🔗
Establece los metadatos de un elemento, que pueden ser de cualquier tipo. Posteriormente se puede obtener con get_item_metadata(), que proporciona una forma sencilla de asignar datos de contexto a los elementos.
void set_item_multistate(index: int, state: int) 🔗
Establece el estado de un elemento multiestado. Véase add_multistate_item() para obtener más detalles.
void set_item_multistate_max(index: int, max_states: int) 🔗
Establece el número máximo de estados de un elemento multiestado. Véase add_multistate_item() para obtener más detalles.
void set_item_shortcut(index: int, shortcut: Shortcut, global: bool = false) 🔗
Establece un Shortcut para el elemento en el index dado.
void set_item_shortcut_disabled(index: int, disabled: bool) 🔗
Desactiva el Shortcut del elemento en el index dado.
void set_item_submenu(index: int, submenu: String) 🔗
Obsoleto: Prefer using set_item_submenu_node() instead.
Establece el submenú del elemento en el index dado. El submenú es el nombre de un nodo hijo PopupMenu que se mostrará cuando se haga clic en el elemento.
void set_item_submenu_node(index: int, submenu: PopupMenu) 🔗
Sets the submenu of the item at the given index. The submenu is a PopupMenu node that would be shown when the item is clicked. It must either be a child of this PopupMenu or has no parent (in which case it will be automatically added as a child). If the submenu popup has another parent, this method will fail.
void set_item_text(index: int, text: String) 🔗
Establece el texto del elemento en el index dado.
void set_item_text_direction(index: int, direction: TextDirection) 🔗
Establece la dirección de escritura base del texto del elemento.
void set_item_tooltip(index: int, tooltip: String) 🔗
Sets the String tooltip of the item at the given index.
void toggle_item_checked(index: int) 🔗
Alterna el estado de marcado del elemento en el index dado.
void toggle_item_multistate(index: int) 🔗
Pasa al siguiente estado de un elemento multiestado. Véase add_multistate_item() para más detalles.
Descripciones de las propiedades del tema
Color font_accelerator_color = Color(0.7, 0.7, 0.7, 0.8) 🔗
El texto Color utilizado para los atajos y aceleradores que se muestran junto al nombre del elemento de menú cuando está definido. Véase get_item_accelerator() para más información sobre los aceleradores.
Color font_color = Color(0.875, 0.875, 0.875, 1) 🔗
El texto predeterminado Color para los nombres de los elementos del menú.
Color font_disabled_color = Color(0.4, 0.4, 0.4, 0.8) 🔗
Color utilizado para el texto de los elementos del menú desactivados.
Color font_hover_color = Color(0.875, 0.875, 0.875, 1) 🔗
Color usado por el texto cuando el cursor esta encima del mismo.
Color font_outline_color = Color(0, 0, 0, 1) 🔗
El tono del contorno del texto del elemento del menú.
Color font_separator_color = Color(0.875, 0.875, 0.875, 1) 🔗
Color usado para el texto de los separadores etiquetados. Véase add_separator().
Color font_separator_outline_color = Color(0, 0, 0, 1) 🔗
El tinte del contorno del texto del separador etiquetado.
If not 0, the icon gutter will be merged with the checkbox gutter when possible. This acts as a boolean.
El espacio horizontal entre los elementos del ítem.
El ancho máximo permitido del icono del ítem. Este límite se aplica sobre el tamaño predeterminado del icono, pero antes del valor establecido con set_item_icon_max_width(). La altura se ajusta según la relación del icono.
Ancho del nivel de sangría simple.
Relleno horizontal a la derecha de los ítems (o a la izquierda, en el diseño RTL).
Relleno horizontal a la izquierda de los ítems (o a la derecha, en el diseño RTL).
El tamaño del contorno del texto del elemento.
Nota: Si se utiliza una fuente con FontFile.multichannel_signed_distance_field activado, su FontFile.msdf_pixel_range debe establecerse en al menos el doble del valor de outline_size para que la renderización del contorno se vea correcta. De lo contrario, el contorno puede parecer que se corta antes de lo previsto.
int separator_outline_size = 0 🔗
El tamaño del contorno del texto separador etiquetado.
El espacio vertical entre cada elemento del menú.
Font usada para los elementos del menú.
Font utilizada para el separador etiquetado.
Tamaño de fuente del separador etiquetado.
Tamaño de la fuente de los elementos del menú.
Icono Texture2D para los ítems de casilla de verificación marcados.
Icono Texture2D para los ítems de casilla de verificación marcados cuando están desactivados.
Icono Texture2D para los ítems de botón de radio marcados.
Texture2D radio_checked_disabled 🔗
Icono Texture2D para los elementos de botón de radio marcados cuando están desactivados.
Icono Texture2D para los elementos de botón de radio no marcados.
Texture2D radio_unchecked_disabled 🔗
Icono Texture2D para los elementos de botón de radio no marcados cuando están desactivados.
Icono Texture2D para la flecha del submenú (para diseños de izquierda a derecha).
Icono Texture2D para la flecha del submenú (para diseños de derecha a izquierda).
Icono Texture2D para los elementos de casilla de verificación no marcados.
Texture2D unchecked_disabled 🔗
Icono Texture2D para los elementos de casilla de verificación no marcados cuando están desactivados.
StyleBox que se muestra cuando el PopupMenu elemento tiene el cursor encima.
StyleBox labeled_separator_left 🔗
StyleBox para el lado izquierdo del separador etiquetado. Véase add_separator().
StyleBox labeled_separator_right 🔗
StyleBox para el lado derecho del separador etiquetado. Véase add_separator().
StyleBox para el panel de fondo.
StyleBox usado para los separadores. Véase add_separator().