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
Успадковує: Button < BaseButton < Control < CanvasItem < Node < Object
Кнопка, яка виводить PopupMenu при натисканні.
Опис
Кнопка, яка виводить PopupMenu при натисканні. get_popup().add_item("Моя назва виробу"). Ви також можете створювати їх безпосередньо з інспектора редактора Godot.
Дивись також BaseButton які містять загальні властивості та методи, пов'язані з цим вершиною.
Властивості
action_mode |
|
|
flat |
|
|
focus_mode |
|
|
|
||
|
||
|
||
|
||
Texture2D |
||
|
||
|
||
String |
|
|
|
||
toggle_mode |
|
Методи
PopupMenu |
get_popup() const |
void |
set_disable_shortcuts(disabled: bool) |
void |
Сигнали
about_to_popup() 🔗
Увімкніть, коли PopupMenu цієї кнопки Меню про показати.
Описи властивостей
Кількість елементів в даний час в списку.
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 🔗
Якщо true, коли курсор висить над іншим MenuButton в одному з батьків, який також має switch_on_hover, він закриє струм MenuButton і відкриє інший.
Описи методів
PopupMenu get_popup() const 🔗
Повертаємо PopupMenu, що міститься в цій кнопці.
Попередження: Це необхідний внутрішній вузол, видаляючи і звільняючи його може призвести до аварії. Якщо ви хочете приховати його або будь-який з своїх дітей, скористайтеся їх пам'ятне вікно.видиме.
void set_disable_shortcuts(disabled: bool) 🔗
Якщо true, ярлики вимкнені і не можна використовувати для запуску кнопки.
void show_popup() 🔗
Налаштовує позицію пікапу і sizing для MenuButton, потім показує PopupMenu. За допомогою get_popup().popup().