Index · Object → Node → Viewport → Window → Popup → PopupMenu

PopupMenu

A modal window used to display a list of options.

Class Description

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.

Properties

var canvas_item_default_texture_filter: Viewport.DefaultCanvasItemTextureFilter = 4
var canvas_item_default_texture_repeat: Viewport.DefaultCanvasItemTextureRepeat = 3
var hide_on_checkable_item_selection: bool = true

If true, hides the PopupMenu when a checkbox or radio button is selected.

var hide_on_item_selection: bool = true

If true, hides the PopupMenu when an item is selected.

var hide_on_state_item_selection: bool = false

If true, hides the PopupMenu when a state item is selected.

var item_count: int = 0

The number of items currently in the list.

var item_{index}/checkable: int = 0

The checkable item type of the item at index.

Note: index is a value in the 0 .. item_count - 1 range.

var item_{index}/checked: bool = false

If true, the item at index is checked.

Note: index is a value in the 0 .. item_count - 1 range.

var item_{index}/disabled: bool = false

If true, the item at index is disabled.

Note: index is a value in the 0 .. item_count - 1 range.

var item_{index}/icon: Texture2D

The icon of the item at index.

Note: index is a value in the 0 .. item_count - 1 range.

var item_{index}/id: int = 0

The ID of the item at index.

Note: index is a value in the 0 .. item_count - 1 range.

var item_{index}/separator: bool = false

If true, the item at index is a separator.

Note: index is a value in the 0 .. item_count - 1 range.

var item_{index}/text: String = ""

The text of the item at index.

Note: index is a value in the 0 .. item_count - 1 range.

var prefer_native_menu: bool = false

If true, MenuBar will use native menu when supported.

Note: If PopupMenu is linked to StatusIndicator, MenuBar, or another PopupMenu item it can use native menu regardless of this property, use is_native_menu() to check it.

var search_bar_enabled: bool = false

If true, shows a search bar at the top of the PopupMenu for filtering items. See search_bar_min_item_count for dynamically controlling its visibility based on the number of items.

Note: When enabled, allow_search is ignored.

var search_bar_fuzzy_search_enabled: bool = true

If true, enables fuzzy searching in the PopupMenu search bar. This allows the search results to include items that almost match the search query, as well items that match the individual characters of the search query, but not in sequence.

Use search_bar_fuzzy_search_max_misses to set the maximum number of mismatches allowed in the search results.

var search_bar_fuzzy_search_max_misses: int = 2

Sets the maximum number of mismatches allowed in each search result when fuzzy searching is enabled for the PopupMenu search bar. Any item with more mismatches will be hidden from the search results.

var search_bar_min_item_count: int = 0

Sets the minimum number of items required for the search bar to be visible. search_bar_enabled must be true for this to have any effect. Separator items are not counted.

var shrink_height: bool = true

If true, shrinks PopupMenu to minimum height when it's shown.

var shrink_width: bool = true

If true, shrinks PopupMenu to minimum width when it's shown.

var submenu_popup_delay: float = 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.

var system_menu_id: NativeMenu.SystemMenus = 0

If set to one of the values of NativeMenu.SystemMenus, this PopupMenu is bound to the special system menu. Only one PopupMenu can be bound to each special menu at a time.

var transparent: bool = true
var transparent_bg: bool = true
Inherited from Popup (9)
var borderless: bool = true
var popup_window: bool = true
var popup_wm_hint: bool = true
var transient: bool = true
var unresizable: bool = true
var visible: bool = false
var wrap_controls: bool = true
Inherited from Window (41)
var always_on_top: bool = false
var borderless: bool = false
var content_scale_size: Vector2i = Vector2i(0, 0)
var exclusive: bool = false
var extend_to_title: bool = false
var force_native: bool = false
var max_size: Vector2i = Vector2i(0, 0)
var maximize_disabled: bool = false
var min_size: Vector2i = Vector2i(0, 0)
var minimize_disabled: bool = false
var mode: Window.Mode = 0
var mouse_passthrough: bool = false
var mouse_passthrough_polygon: PackedVector2Array = PackedVector2Array()
var nonclient_area: Rect2i = Rect2i(0, 0, 0, 0)
var popup_window: bool = false
var popup_wm_hint: bool = false
var position: Vector2i = Vector2i(0, 0)
var sharp_corners: bool = false
var size: Vector2i = Vector2i(100, 100)
var title: String = ""
var transient: bool = false
var transparent: bool = false
var unfocusable: bool = false
var unresizable: bool = false
var visible: bool = true
var wrap_controls: bool = false
Inherited from Viewport (51)
var canvas_cull_mask: int = 4294967295
var disable_3d: bool = false
var fsr_sharpness: float = 0.2
var gui_disable_input: bool = false
var oversampling: bool = true
var own_world_3d: bool = false
var transparent_bg: bool = false
var use_debanding: bool = false
var use_hdr_2d: bool = false
var use_taa: bool = false
var use_xr: bool = false
Inherited from Node (14)
var owner: Node

Methods

func activate_item_by_event(event: InputEvent, for_global_only: bool = false) -> bool

Checks the provided event against the PopupMenu's shortcuts and accelerators, and activates the first item with matching events. If for_global_only is true, only shortcuts and accelerators with global set to true will be called.

Returns true if an item was successfully activated.

Note: Certain Controls, such as MenuButton, will call this method automatically.

func add_check_item(label: String, id: int = -1, accel: Key = 0) -> void

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 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.

func add_check_shortcut(shortcut: Shortcut, id: int = -1, global: bool = false) -> void

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.

func add_icon_check_item(texture: Texture2D, label: String, id: int = -1, accel: Key = 0) -> void

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 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.

func add_icon_check_shortcut(texture: Texture2D, shortcut: Shortcut, id: int = -1, global: bool = false) -> void

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.

func add_icon_item(texture: Texture2D, label: String, id: int = -1, accel: Key = 0) -> void

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 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 add_icon_radio_check_item(texture: Texture2D, label: String, id: int = -1, accel: Key = 0) -> void

Same as add_icon_check_item(), but uses a radio check button.

func add_icon_radio_check_shortcut(texture: Texture2D, shortcut: Shortcut, id: int = -1, global: bool = false) -> void

Same as add_icon_check_shortcut(), but uses a radio check button.

func add_icon_shortcut(texture: Texture2D, shortcut: Shortcut, id: int = -1, global: bool = false, allow_echo: bool = false) -> void

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.

func add_item(label: String, id: int = -1, accel: Key = 0) -> void

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 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().

func add_multistate_item(label: String, max_states: int, default_state: int = 0, id: int = -1, accel: Key = 0) -> void

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 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.

func add_radio_check_item(label: String, id: int = -1, accel: Key = 0) -> void

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 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.

func add_radio_check_shortcut(shortcut: Shortcut, id: int = -1, global: bool = false) -> void

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.

func add_separator(label: String = "", id: int = -1) -> void

Adds a separator between items. Separators also occupy an index, which you can set by using the id parameter.

A label can optionally be provided, which will appear at the center of the separator.

func add_shortcut(shortcut: Shortcut, id: int = -1, global: bool = false, allow_echo: bool = false) -> void

Adds a Shortcut.

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.

func add_submenu_item(label: String, submenu: String, id: int = -1) -> void

Adds an item that will act as a submenu of the parent PopupMenu node when clicked. The submenu argument must be the name of an existing PopupMenu that has been added as a child to this node. This submenu will be shown when the item is clicked, hovered for long enough, or activated using the ui_select or ui_right input actions.

An id can optionally be provided. If no id is provided, one will be created from the index.

func add_submenu_node_item(label: String, submenu: PopupMenu, id: int = -1) -> void

Adds an item that will act as a submenu of the parent PopupMenu node when clicked. This submenu will be shown when the item is clicked, hovered for long enough, or activated using the ui_select or ui_right input actions.

submenu must be either child of this PopupMenu or has no parent node (in which case it will be automatically added as a child). If the submenu popup has another parent, this method will fail.

An id can optionally be provided. If no id is provided, one will be created from the index.

func clear(free_submenus: bool = false) -> void

Removes all items from the PopupMenu. If free_submenus is true, the submenu nodes are automatically freed.

func get_focused_item() -> int

Returns the index of the currently focused item. Returns -1 if no item is focused.

func get_item_accelerator(index: int) -> Key

Returns the accelerator of the item at the given index. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The return value is an integer which is generally a combination of KeyModifierMasks and Keys using bitwise OR such as KEY_MASK_CTRL | KEY_A (Ctrl + A). If no accelerator is defined for the specified index, get_item_accelerator() returns 0 (corresponding to KEY_NONE).

func get_item_auto_translate_mode(index: int) -> Node.AutoTranslateMode

Returns the auto translate mode of the item at the given index.

func get_item_icon(index: int) -> Texture2D

Returns the icon of the item at the given index.

func get_item_icon_max_width(index: int) -> int

Returns the maximum allowed width of the icon for the item at the given index.

func get_item_icon_modulate(index: int) -> Color

Returns a Color modulating the item's icon at the given index.

func get_item_id(index: int) -> int

Returns the ID of the item at the given index.

func get_item_indent(index: int) -> int

Returns the horizontal offset of the item at the given index.

func get_item_index(id: int) -> int

Returns the index of the item containing the specified id. The index is automatically assigned to each item by the engine when added and represents the order items will be displayed.

func get_item_language(index: int) -> String

Returns item's text language code.

func get_item_metadata(index: int) -> Variant

Returns the metadata of the specified item, which might be of any type. You can set it with set_item_metadata(), which provides a simple way of assigning context data to items.

func get_item_multistate(index: int) -> int

Returns the state of the item at the given index.

func get_item_multistate_max(index: int) -> int

Returns the max states of the item at the given index.

func get_item_shortcut(index: int) -> Shortcut

Returns the Shortcut associated with the item at the given index.

func get_item_submenu(index: int) -> String

Returns the submenu name of the item at the given index. See add_submenu_item() for more info on how to add a submenu.

func get_item_submenu_node(index: int) -> PopupMenu

Returns the submenu of the item at the given index, or null if no submenu was added. See add_submenu_node_item() for more info on how to add a submenu.

func get_item_text(index: int) -> String

Returns the text of the item at the given index.

func get_item_text_direction(index: int) -> Control.TextDirection

Returns item's text base writing direction.

func get_item_tooltip(index: int) -> String

Returns the tooltip associated with the item at the given index.

func is_item_checkable(index: int) -> bool

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.

func is_item_checked(index: int) -> bool

Returns true if the item at the given index is checked.

func is_item_disabled(index: int) -> bool

Returns true if the item at the given index is disabled. When it is disabled it can't be selected, or its action invoked.

See set_item_disabled() for more info on how to disable an item.

func is_item_radio_checkable(index: int) -> bool

Returns true if the item at the given index has radio button-style checkability.

Note: This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.

func is_item_separator(index: int) -> bool

Returns true if the item is a separator. If it is, it will be displayed as a line. See add_separator() for more info on how to add a separator.

func is_item_shortcut_disabled(index: int) -> bool

Returns true if the specified item's shortcut is disabled.

func is_native_menu() -> bool

Returns true if the system native menu is supported and currently used by this PopupMenu.

func is_system_menu() -> bool

Returns true if the menu is bound to the special system menu.

func remove_item(index: int) -> void

Removes the item at the given index from the menu.

Note: The indices of items after the removed item will be shifted by one.

func scroll_to_item(index: int) -> void

Moves the scroll view to make the item at the given index visible.

func set_focused_item(index: int) -> void

Sets the currently focused item as the given index.

Passing -1 as the index makes so that no item is focused.

func set_item_accelerator(index: int, accel: Key) -> void

Sets the accelerator of the item at the given index. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. accel is generally a combination of KeyModifierMasks and Keys using bitwise OR such as KEY_MASK_CTRL | KEY_A (Ctrl + A).

func set_item_as_checkable(index: int, enable: bool) -> void

Sets whether the item at the given index has a checkbox. If false, sets the type of the item to plain text.

Note: Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.

func set_item_as_radio_checkable(index: int, enable: bool) -> void

Sets the type of the item at the given index to radio button. If false, sets the type of the item to plain text.

func set_item_as_separator(index: int, enable: bool) -> void

Mark the item at the given index as a separator, which means that it would be displayed as a line. If false, sets the type of the item to plain text.

func set_item_auto_translate_mode(index: int, mode: Node.AutoTranslateMode) -> void

Sets the auto translate mode of the item at the given index.

Items use Node.AUTO_TRANSLATE_MODE_INHERIT by default, which uses the same auto translate mode as the PopupMenu itself.

func set_item_checked(index: int, checked: bool) -> void

Sets the checkstate status of the item at the given index.

func set_item_disabled(index: int, disabled: bool) -> void

Enables/disables the item at the given index. When it is disabled, it can't be selected and its action can't be invoked.

func set_item_icon(index: int, icon: Texture2D) -> void

Replaces the Texture2D icon of the item at the given index.

func set_item_icon_max_width(index: int, width: int) -> void

Sets the maximum allowed width of the icon for the item at the given index. This limit is applied on top of the default size of the icon and on top of icon_max_width. The height is adjusted according to the icon's ratio.

func set_item_icon_modulate(index: int, modulate: Color) -> void

Sets a modulating Color of the item's icon at the given index.

func set_item_id(index: int, id: int) -> void

Sets the id of the item at the given index.

The id is used in id_pressed and id_focused signals.

func set_item_indent(index: int, indent: int) -> void

Sets the horizontal offset of the item at the given index.

func set_item_index(index: int, target_index: int) -> void

Changes the index of the item at index index to be at index target_index. This can be used to move an item above other items. The moved item will keep the same ID, even if it was generated from the original index.

Note: The indices of any items between index index and index target_index will be shifted by one.

func set_item_language(index: int, language: String) -> void

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.

func set_item_metadata(index: int, metadata: Variant) -> void

Sets the metadata of an item, which may be of any type. You can later get it with get_item_metadata(), which provides a simple way of assigning context data to items.

func set_item_multistate(index: int, state: int) -> void

Sets the state of a multistate item. See add_multistate_item() for details.

func set_item_multistate_max(index: int, max_states: int) -> void

Sets the max states of a multistate item. See add_multistate_item() for details.

func set_item_shortcut(index: int, shortcut: Shortcut, global: bool = false) -> void

Sets a Shortcut for the item at the given index.

func set_item_shortcut_disabled(index: int, disabled: bool) -> void

Disables the Shortcut of the item at the given index.

func set_item_submenu(index: int, submenu: String) -> void

Sets the submenu of the item at the given index. The submenu is the name of a child PopupMenu node that would be shown when the item is clicked.

func set_item_submenu_node(index: int, submenu: PopupMenu) -> void

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.

func set_item_text(index: int, text: String) -> void

Sets the text of the item at the given index.

func set_item_text_direction(index: int, direction: Control.TextDirection) -> void

Sets item's text base writing direction.

func set_item_tooltip(index: int, tooltip: String) -> void

Sets the String tooltip of the item at the given index.

func toggle_item_checked(index: int) -> void

Toggles the check state of the item at the given index.

func toggle_item_multistate(index: int) -> void

Cycle to the next state of a multistate item. See add_multistate_item() for details.

Inherited from Window (78)
func add_theme_color_override(name: StringName, color: Color) -> void
func add_theme_constant_override(name: StringName, constant: int) -> void
func add_theme_font_override(name: StringName, font: Font) -> void
func add_theme_font_size_override(name: StringName, font_size: int) -> void
func add_theme_icon_override(name: StringName, texture: Texture2D) -> void
func add_theme_stylebox_override(name: StringName, stylebox: StyleBox) -> void
func can_draw() -> bool
func child_controls_changed() -> void
func get_flag(flag: Window.Flags) -> bool
func get_theme_color(name: StringName, theme_type: StringName = &"") -> Color
func get_theme_constant(name: StringName, theme_type: StringName = &"") -> int
func get_theme_font(name: StringName, theme_type: StringName = &"") -> Font
func get_theme_font_size(name: StringName, theme_type: StringName = &"") -> int
func get_theme_icon(name: StringName, theme_type: StringName = &"") -> Texture2D
func get_theme_stylebox(name: StringName, theme_type: StringName = &"") -> StyleBox
func get_window_id() -> int
func grab_focus() -> void
func has_focus() -> bool
func has_theme_color(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_constant(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_font(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_font_size(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_icon(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_stylebox(name: StringName, theme_type: StringName = &"") -> bool
func hide() -> void
func is_embedded() -> bool
func move_to_center() -> void
func move_to_foreground() -> void
func popup(rect: Rect2i = Rect2i(0, 0, 0, 0)) -> void
func popup_centered(minsize: Vector2i = Vector2i(0, 0)) -> void
func popup_centered_clamped(minsize: Vector2i = Vector2i(0, 0), fallback_ratio: float = 0.75) -> void
func popup_centered_ratio(ratio: float = 0.8) -> void
func popup_exclusive(from_node: Node, rect: Rect2i = Rect2i(0, 0, 0, 0)) -> void
func popup_exclusive_centered(from_node: Node, minsize: Vector2i = Vector2i(0, 0)) -> void
func popup_exclusive_centered_clamped(from_node: Node, minsize: Vector2i = Vector2i(0, 0), fallback_ratio: float = 0.75) -> void
func popup_exclusive_centered_ratio(from_node: Node, ratio: float = 0.8) -> void
func popup_exclusive_on_parent(from_node: Node, parent_rect: Rect2i) -> void
func popup_on_parent(parent_rect: Rect2i) -> void
func request_attention() -> void
func reset_size() -> void
func set_flag(flag: Window.Flags, enabled: bool) -> void
func set_ime_active(active: bool) -> void
func set_ime_position(position: Vector2i) -> void
func set_taskbar_progress_value(value: float) -> void
func set_unparent_when_invisible(unparent: bool) -> void
func set_use_font_oversampling(enable: bool) -> void
func show() -> void
func start_drag() -> void
Inherited from Viewport (38)
func get_embedded_subwindows() -> Window[]
func gui_cancel_drag() -> void
func gui_release_focus() -> void
func gui_set_drag_description(description: String) -> void
func notify_mouse_entered() -> void
func notify_mouse_exited() -> void
func push_input(event: InputEvent, in_local_coords: bool = false) -> void
func push_text_input(text: String) -> void
func push_unhandled_input(event: InputEvent, in_local_coords: bool = false) -> void
func set_canvas_cull_mask_bit(layer: int, enable: bool) -> void
func set_input_as_handled() -> void
func warp_mouse(position: Vector2) -> void
Inherited from Node (106)
func _enter_tree() -> void
func _exit_tree() -> void
func _input(event: InputEvent) -> void
func _physics_process(delta: float) -> void
func _process(delta: float) -> void
func _ready() -> void
func _shortcut_input(event: InputEvent) -> void
func _unhandled_input(event: InputEvent) -> void
func _unhandled_key_input(event: InputEvent) -> void
func add_child(node: Node, force_readable_name: bool = false, internal: Node.InternalMode = 0) -> void
func add_sibling(sibling: Node, force_readable_name: bool = false) -> void
func add_to_group(group: StringName, persistent: bool = false) -> void
func atr(message: String, context: StringName = "") -> String
func atr_n(message: String, plural_message: StringName, n: int, context: StringName = "") -> String
func can_process() -> bool
func duplicate(flags: int = 15) -> Node
func find_child(pattern: String, recursive: bool = true, owned: bool = true) -> Node
func find_children(pattern: String, type: String = "", recursive: bool = true, owned: bool = true) -> Node[]
func find_parent(pattern: String) -> Node
func get_child(idx: int, include_internal: bool = false) -> Node
func get_child_count(include_internal: bool = false) -> int
func get_children(include_internal: bool = false) -> Node[]
func get_groups() -> StringName[]
func get_index(include_internal: bool = false) -> int
func get_node(path: NodePath) -> Node
func get_orphan_node_ids() -> int[]
func get_parent() -> Node
func get_path() -> NodePath
func get_path_to(node: Node, use_unique_path: bool = false) -> NodePath
func get_window() -> Window
func has_node(path: NodePath) -> bool
func is_ancestor_of(node: Node) -> bool
func is_greater_than(node: Node) -> bool
func is_in_group(group: StringName) -> bool
func move_child(child_node: Node, to_index: int) -> void
func notify_deferred_thread_group(what: int) -> void
func notify_thread_safe(what: int) -> void
func print_orphan_nodes() -> void
func print_tree() -> void
func print_tree_pretty() -> void
func propagate_call(method: StringName, args: Array = [], parent_first: bool = false) -> void
func propagate_notification(what: int) -> void
func queue_free() -> void
func remove_child(node: Node) -> void
func remove_from_group(group: StringName) -> void
func reparent(new_parent: Node, keep_global_transform: bool = true) -> void
func replace_by(node: Node, keep_groups: bool = false) -> void
func request_ready() -> void
func rpc(method: StringName) -> Error
func rpc_config(method: StringName, config: Variant) -> void
func rpc_id(peer_id: int, method: StringName) -> Error
func set_deferred_thread_group(property: StringName, value: Variant) -> void
func set_display_folded(fold: bool) -> void
func set_editable_instance(node: Node, is_editable: bool) -> void
func set_multiplayer_authority(id: int, recursive: bool = true) -> void
func set_physics_process(enable: bool) -> void
func set_physics_process_internal(enable: bool) -> void
func set_process(enable: bool) -> void
func set_process_input(enable: bool) -> void
func set_process_internal(enable: bool) -> void
func set_process_shortcut_input(enable: bool) -> void
func set_process_unhandled_input(enable: bool) -> void
func set_scene_instance_load_placeholder(load_placeholder: bool) -> void
func set_thread_safe(property: StringName, value: Variant) -> void
Inherited from Object (62)
func _get(property: StringName) -> Variant
func _get_property_list() -> Dictionary[]
func _init() -> void
func _iter_get(iter: Variant) -> Variant
func _iter_init(iter: Array) -> bool
func _iter_next(iter: Array) -> bool
func _notification(what: int) -> void
func _set(property: StringName, value: Variant) -> bool
func _to_string() -> String
func _validate_property(property: Dictionary) -> void
func add_user_signal(signal: String, arguments: Array = []) -> void
func call(method: StringName) -> Variant
func callv(method: StringName, arg_array: Array) -> Variant
func cancel_free() -> void
func connect(signal: StringName, callable: Callable, flags: int = 0) -> Error
func disconnect(signal: StringName, callable: Callable) -> void
func emit_signal(signal: StringName) -> Error
func free() -> void
func get(property: StringName) -> Variant
func get_class() -> String
func get_incoming_connections() -> Dictionary[]
func get_indexed(property_path: NodePath) -> Variant
func get_meta(name: StringName, default: Variant = null) -> Variant
func get_meta_list() -> StringName[]
func get_method_list() -> Dictionary[]
func get_property_list() -> Dictionary[]
func get_signal_connection_list(signal: StringName) -> Dictionary[]
func get_signal_list() -> Dictionary[]
func has_meta(name: StringName) -> bool
func has_method(method: StringName) -> bool
func has_signal(signal: StringName) -> bool
func is_class(class: StringName) -> bool
func is_connected(signal: StringName, callable: Callable) -> bool
func notification(what: int, reversed: bool = false) -> void
func remove_meta(name: StringName) -> void
func remove_user_signal(signal: StringName) -> void
func set(property: StringName, value: Variant) -> void
func set_block_signals(enable: bool) -> void
func set_deferred(property: StringName, value: Variant) -> void
func set_indexed(property_path: NodePath, value: Variant) -> void
func set_message_translation(enable: bool) -> void
func set_meta(name: StringName, value: Variant) -> void
func set_script(script: Variant) -> void
func set_translation_domain(domain: StringName) -> void
func to_string() -> String
func tr(message: StringName, context: StringName = &"") -> String
func tr_n(message: StringName, plural_message: StringName, n: int, context: StringName = &"") -> String

Signals

signal id_focused(id: int)

Emitted when the user navigated to an item of some id using the ProjectSettings.input/ui_up or ProjectSettings.input/ui_down input action.

signal id_pressed(id: int)

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.

signal index_pressed(index: int)

Emitted when an item of some index is pressed. Also emitted when its accelerator is activated on macOS.

signal menu_changed()

Emitted when any item is added, modified or removed.

Inherited from Popup (1)
signal popup_hide()
Inherited from Window (16)
signal dpi_changed()
signal focus_entered()
signal focus_exited()
signal mouse_entered()
signal mouse_exited()
signal output_max_linear_value_changed(output_max_linear_value: float)
signal theme_changed()
signal title_changed()
signal window_input(event: InputEvent)
Inherited from Viewport (2)
signal size_changed()
Inherited from Node (11)
signal child_entered_tree(node: Node)
signal child_exiting_tree(node: Node)
signal ready()
signal renamed()
signal replacing_by(node: Node)
signal tree_entered()
signal tree_exited()
signal tree_exiting()
Inherited from Object (2)