Files
godot-docs/classes/class_displayserver.rst
2022-10-08 13:57:16 +02:00

2317 lines
229 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/DisplayServer.xml.
.. _class_DisplayServer:
DisplayServer
=============
**Inherits:** :ref:`Object<class_Object>`
Methods
-------
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`clipboard_get<class_DisplayServer_method_clipboard_get>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`clipboard_get_primary<class_DisplayServer_method_clipboard_get_primary>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`clipboard_has<class_DisplayServer_method_clipboard_has>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clipboard_set<class_DisplayServer_method_clipboard_set>` **(** :ref:`String<class_String>` clipboard **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clipboard_set_primary<class_DisplayServer_method_clipboard_set_primary>` **(** :ref:`String<class_String>` clipboard_primary **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`create_sub_window<class_DisplayServer_method_create_sub_window>` **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` flags, :ref:`Rect2i<class_Rect2i>` rect=Rect2i(0, 0, 0, 0) **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`CursorShape<enum_DisplayServer_CursorShape>` | :ref:`cursor_get_shape<class_DisplayServer_method_cursor_get_shape>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`cursor_set_custom_image<class_DisplayServer_method_cursor_set_custom_image>` **(** :ref:`Resource<class_Resource>` cursor, :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape=0, :ref:`Vector2<class_Vector2>` hotspot=Vector2(0, 0) **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`cursor_set_shape<class_DisplayServer_method_cursor_set_shape>` **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`delete_sub_window<class_DisplayServer_method_delete_sub_window>` **(** :ref:`int<class_int>` window_id **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`dialog_input_text<class_DisplayServer_method_dialog_input_text>` **(** :ref:`String<class_String>` title, :ref:`String<class_String>` description, :ref:`String<class_String>` existing_text, :ref:`Callable<class_Callable>` callback **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`dialog_show<class_DisplayServer_method_dialog_show>` **(** :ref:`String<class_String>` title, :ref:`String<class_String>` description, :ref:`PackedStringArray<class_PackedStringArray>` buttons, :ref:`Callable<class_Callable>` callback **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`enable_for_stealing_focus<class_DisplayServer_method_enable_for_stealing_focus>` **(** :ref:`int<class_int>` process_id **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`force_process_and_drop_events<class_DisplayServer_method_force_process_and_drop_events>` **(** **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Color<class_Color>` | :ref:`get_accent_color<class_DisplayServer_method_get_accent_color>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Rect2[]<class_Rect2>` | :ref:`get_display_cutouts<class_DisplayServer_method_get_display_cutouts>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Rect2i<class_Rect2i>` | :ref:`get_display_safe_area<class_DisplayServer_method_get_display_safe_area>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_name<class_DisplayServer_method_get_name>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_screen_count<class_DisplayServer_method_get_screen_count>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_swap_cancel_ok<class_DisplayServer_method_get_swap_cancel_ok>` **(** **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_window_at_screen_position<class_DisplayServer_method_get_window_at_screen_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_window_list<class_DisplayServer_method_get_window_list>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_add_check_item<class_DisplayServer_method_global_menu_add_check_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_add_icon_check_item<class_DisplayServer_method_global_menu_add_icon_check_item>` **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_add_icon_item<class_DisplayServer_method_global_menu_add_icon_item>` **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_add_icon_radio_check_item<class_DisplayServer_method_global_menu_add_icon_radio_check_item>` **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_add_item<class_DisplayServer_method_global_menu_add_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` labe, :ref:`int<class_int>` max_states, :ref:`int<class_int>` default_state, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_add_radio_check_item<class_DisplayServer_method_global_menu_add_radio_check_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_add_separator<class_DisplayServer_method_global_menu_add_separator>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` index=-1 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_add_submenu_item<class_DisplayServer_method_global_menu_add_submenu_item>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`String<class_String>` submenu, :ref:`int<class_int>` index=-1 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_clear<class_DisplayServer_method_global_menu_clear>` **(** :ref:`String<class_String>` menu_root **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Key<enum_@GlobalScope_Key>` | :ref:`global_menu_get_item_accelerator<class_DisplayServer_method_global_menu_get_item_accelerator>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Callable<class_Callable>` | :ref:`global_menu_get_item_callback<class_DisplayServer_method_global_menu_get_item_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Texture2D<class_Texture2D>` | :ref:`global_menu_get_item_icon<class_DisplayServer_method_global_menu_get_item_icon>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_get_item_indentation_level<class_DisplayServer_method_global_menu_get_item_indentation_level>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_get_item_index_from_tag<class_DisplayServer_method_global_menu_get_item_index_from_tag>` **(** :ref:`String<class_String>` menu_root, :ref:`Variant<class_Variant>` tag **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_get_item_index_from_text<class_DisplayServer_method_global_menu_get_item_index_from_text>` **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` text **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Callable<class_Callable>` | :ref:`global_menu_get_item_key_callback<class_DisplayServer_method_global_menu_get_item_key_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_get_item_max_states<class_DisplayServer_method_global_menu_get_item_max_states>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`global_menu_get_item_state<class_DisplayServer_method_global_menu_get_item_state>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`global_menu_get_item_submenu<class_DisplayServer_method_global_menu_get_item_submenu>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`global_menu_get_item_tag<class_DisplayServer_method_global_menu_get_item_tag>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`global_menu_get_item_text<class_DisplayServer_method_global_menu_get_item_text>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`global_menu_get_item_tooltip<class_DisplayServer_method_global_menu_get_item_tooltip>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`global_menu_is_item_checkable<class_DisplayServer_method_global_menu_is_item_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`global_menu_is_item_checked<class_DisplayServer_method_global_menu_is_item_checked>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`global_menu_is_item_disabled<class_DisplayServer_method_global_menu_is_item_disabled>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`global_menu_is_item_radio_checkable<class_DisplayServer_method_global_menu_is_item_radio_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_remove_item<class_DisplayServer_method_global_menu_remove_item>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_accelerator<class_DisplayServer_method_global_menu_set_item_accelerator>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_callback<class_DisplayServer_method_global_menu_set_item_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_checkable<class_DisplayServer_method_global_menu_set_item_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_checked<class_DisplayServer_method_global_menu_set_item_checked>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_disabled<class_DisplayServer_method_global_menu_set_item_disabled>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_icon<class_DisplayServer_method_global_menu_set_item_icon>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` icon **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_indentation_level<class_DisplayServer_method_global_menu_set_item_indentation_level>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` level **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_key_callback<class_DisplayServer_method_global_menu_set_item_key_callback>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` key_callback **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_max_states<class_DisplayServer_method_global_menu_set_item_max_states>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` max_states **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_radio_checkable<class_DisplayServer_method_global_menu_set_item_radio_checkable>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_state<class_DisplayServer_method_global_menu_set_item_state>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_submenu<class_DisplayServer_method_global_menu_set_item_submenu>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_tag<class_DisplayServer_method_global_menu_set_item_tag>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_text<class_DisplayServer_method_global_menu_set_item_text>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_set_item_tooltip<class_DisplayServer_method_global_menu_set_item_tooltip>` **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_feature<class_DisplayServer_method_has_feature>` **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`ime_get_selection<class_DisplayServer_method_ime_get_selection>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`ime_get_text<class_DisplayServer_method_ime_get_text>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_dark_mode<class_DisplayServer_method_is_dark_mode>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_dark_mode_supported<class_DisplayServer_method_is_dark_mode_supported>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`keyboard_get_current_layout<class_DisplayServer_method_keyboard_get_current_layout>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Key<enum_@GlobalScope_Key>` | :ref:`keyboard_get_keycode_from_physical<class_DisplayServer_method_keyboard_get_keycode_from_physical>` **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`keyboard_get_layout_count<class_DisplayServer_method_keyboard_get_layout_count>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`keyboard_get_layout_language<class_DisplayServer_method_keyboard_get_layout_language>` **(** :ref:`int<class_int>` index **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`keyboard_get_layout_name<class_DisplayServer_method_keyboard_get_layout_name>` **(** :ref:`int<class_int>` index **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`keyboard_set_current_layout<class_DisplayServer_method_keyboard_set_current_layout>` **(** :ref:`int<class_int>` index **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`MouseButton<enum_@GlobalScope_MouseButton>` | :ref:`mouse_get_button_state<class_DisplayServer_method_mouse_get_button_state>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`MouseMode<enum_DisplayServer_MouseMode>` | :ref:`mouse_get_mode<class_DisplayServer_method_mouse_get_mode>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`mouse_get_position<class_DisplayServer_method_mouse_get_position>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`mouse_set_mode<class_DisplayServer_method_mouse_set_mode>` **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`process_events<class_DisplayServer_method_process_events>` **(** **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`screen_get_dpi<class_DisplayServer_method_screen_get_dpi>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`screen_get_max_scale<class_DisplayServer_method_screen_get_max_scale>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` | :ref:`screen_get_orientation<class_DisplayServer_method_screen_get_orientation>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_position<class_DisplayServer_method_screen_get_position>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`screen_get_refresh_rate<class_DisplayServer_method_screen_get_refresh_rate>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`screen_get_scale<class_DisplayServer_method_screen_get_scale>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`screen_get_size<class_DisplayServer_method_screen_get_size>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Rect2i<class_Rect2i>` | :ref:`screen_get_usable_rect<class_DisplayServer_method_screen_get_usable_rect>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`screen_is_kept_on<class_DisplayServer_method_screen_is_kept_on>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`screen_is_touchscreen<class_DisplayServer_method_screen_is_touchscreen>` **(** :ref:`int<class_int>` screen=-1 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`screen_set_keep_on<class_DisplayServer_method_screen_set_keep_on>` **(** :ref:`bool<class_bool>` enable **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`screen_set_orientation<class_DisplayServer_method_screen_set_orientation>` **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_icon<class_DisplayServer_method_set_icon>` **(** :ref:`Image<class_Image>` image **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_native_icon<class_DisplayServer_method_set_native_icon>` **(** :ref:`String<class_String>` filename **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`tablet_get_current_driver<class_DisplayServer_method_tablet_get_current_driver>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`tablet_get_driver_count<class_DisplayServer_method_tablet_get_driver_count>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`tablet_get_driver_name<class_DisplayServer_method_tablet_get_driver_name>` **(** :ref:`int<class_int>` idx **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`tablet_set_current_driver<class_DisplayServer_method_tablet_set_current_driver>` **(** :ref:`String<class_String>` name **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary[]<class_Dictionary>` | :ref:`tts_get_voices<class_DisplayServer_method_tts_get_voices>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`tts_get_voices_for_language<class_DisplayServer_method_tts_get_voices_for_language>` **(** :ref:`String<class_String>` language **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`tts_is_paused<class_DisplayServer_method_tts_is_paused>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`tts_is_speaking<class_DisplayServer_method_tts_is_speaking>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`tts_pause<class_DisplayServer_method_tts_pause>` **(** **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`tts_resume<class_DisplayServer_method_tts_resume>` **(** **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`tts_set_utterance_callback<class_DisplayServer_method_tts_set_utterance_callback>` **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`tts_speak<class_DisplayServer_method_tts_speak>` **(** :ref:`String<class_String>` text, :ref:`String<class_String>` voice, :ref:`int<class_int>` volume=50, :ref:`float<class_float>` pitch=1.0, :ref:`float<class_float>` rate=1.0, :ref:`int<class_int>` utterance_id=0, :ref:`bool<class_bool>` interrupt=false **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`tts_stop<class_DisplayServer_method_tts_stop>` **(** **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`virtual_keyboard_get_height<class_DisplayServer_method_virtual_keyboard_get_height>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`virtual_keyboard_hide<class_DisplayServer_method_virtual_keyboard_hide>` **(** **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`virtual_keyboard_show<class_DisplayServer_method_virtual_keyboard_show>` **(** :ref:`String<class_String>` existing_text, :ref:`Rect2<class_Rect2>` position=Rect2(0, 0, 0, 0), :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` type=0, :ref:`int<class_int>` max_length=-1, :ref:`int<class_int>` cursor_start=-1, :ref:`int<class_int>` cursor_end=-1 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`warp_mouse<class_DisplayServer_method_warp_mouse>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_attach_instance_id<class_DisplayServer_method_window_attach_instance_id>` **(** :ref:`int<class_int>` instance_id, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`window_can_draw<class_DisplayServer_method_window_can_draw>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`window_get_active_popup<class_DisplayServer_method_window_get_active_popup>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`window_get_attached_instance_id<class_DisplayServer_method_window_get_attached_instance_id>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`window_get_current_screen<class_DisplayServer_method_window_get_current_screen>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`window_get_flag<class_DisplayServer_method_window_get_flag>` **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_max_size<class_DisplayServer_method_window_get_max_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_min_size<class_DisplayServer_method_window_get_min_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`WindowMode<enum_DisplayServer_WindowMode>` | :ref:`window_get_mode<class_DisplayServer_method_window_get_mode>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`window_get_native_handle<class_DisplayServer_method_window_get_native_handle>` **(** :ref:`HandleType<enum_DisplayServer_HandleType>` handle_type, :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Rect2i<class_Rect2i>` | :ref:`window_get_popup_safe_rect<class_DisplayServer_method_window_get_popup_safe_rect>` **(** :ref:`int<class_int>` window **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_position<class_DisplayServer_method_window_get_position>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_real_size<class_DisplayServer_method_window_get_real_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_safe_title_margins<class_DisplayServer_method_window_get_safe_title_margins>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`window_get_size<class_DisplayServer_method_window_get_size>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` | :ref:`window_get_vsync_mode<class_DisplayServer_method_window_get_vsync_mode>` **(** :ref:`int<class_int>` window_id=0 **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`window_maximize_on_title_dbl_click<class_DisplayServer_method_window_maximize_on_title_dbl_click>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`window_minimize_on_title_dbl_click<class_DisplayServer_method_window_minimize_on_title_dbl_click>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_move_to_foreground<class_DisplayServer_method_window_move_to_foreground>` **(** :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_request_attention<class_DisplayServer_method_window_request_attention>` **(** :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_current_screen<class_DisplayServer_method_window_set_current_screen>` **(** :ref:`int<class_int>` screen, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_drop_files_callback<class_DisplayServer_method_window_set_drop_files_callback>` **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_exclusive<class_DisplayServer_method_window_set_exclusive>` **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_flag<class_DisplayServer_method_window_set_flag>` **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`bool<class_bool>` enabled, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_ime_active<class_DisplayServer_method_window_set_ime_active>` **(** :ref:`bool<class_bool>` active, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_ime_position<class_DisplayServer_method_window_set_ime_position>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_input_event_callback<class_DisplayServer_method_window_set_input_event_callback>` **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_input_text_callback<class_DisplayServer_method_window_set_input_text_callback>` **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_max_size<class_DisplayServer_method_window_set_max_size>` **(** :ref:`Vector2i<class_Vector2i>` max_size, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_min_size<class_DisplayServer_method_window_set_min_size>` **(** :ref:`Vector2i<class_Vector2i>` min_size, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_mode<class_DisplayServer_method_window_set_mode>` **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_mouse_passthrough<class_DisplayServer_method_window_set_mouse_passthrough>` **(** :ref:`PackedVector2Array<class_PackedVector2Array>` region, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_popup_safe_rect<class_DisplayServer_method_window_set_popup_safe_rect>` **(** :ref:`int<class_int>` window, :ref:`Rect2i<class_Rect2i>` rect **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_position<class_DisplayServer_method_window_set_position>` **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_rect_changed_callback<class_DisplayServer_method_window_set_rect_changed_callback>` **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_size<class_DisplayServer_method_window_set_size>` **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_title<class_DisplayServer_method_window_set_title>` **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_transient<class_DisplayServer_method_window_set_transient>` **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_vsync_mode<class_DisplayServer_method_window_set_vsync_mode>` **(** :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_window_buttons_offset<class_DisplayServer_method_window_set_window_buttons_offset>` **(** :ref:`Vector2i<class_Vector2i>` offset, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>` **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Enumerations
------------
.. _enum_DisplayServer_Feature:
.. _class_DisplayServer_constant_FEATURE_GLOBAL_MENU:
.. _class_DisplayServer_constant_FEATURE_SUBWINDOWS:
.. _class_DisplayServer_constant_FEATURE_TOUCHSCREEN:
.. _class_DisplayServer_constant_FEATURE_MOUSE:
.. _class_DisplayServer_constant_FEATURE_MOUSE_WARP:
.. _class_DisplayServer_constant_FEATURE_CLIPBOARD:
.. _class_DisplayServer_constant_FEATURE_VIRTUAL_KEYBOARD:
.. _class_DisplayServer_constant_FEATURE_CURSOR_SHAPE:
.. _class_DisplayServer_constant_FEATURE_CUSTOM_CURSOR_SHAPE:
.. _class_DisplayServer_constant_FEATURE_NATIVE_DIALOG:
.. _class_DisplayServer_constant_FEATURE_IME:
.. _class_DisplayServer_constant_FEATURE_WINDOW_TRANSPARENCY:
.. _class_DisplayServer_constant_FEATURE_HIDPI:
.. _class_DisplayServer_constant_FEATURE_ICON:
.. _class_DisplayServer_constant_FEATURE_NATIVE_ICON:
.. _class_DisplayServer_constant_FEATURE_ORIENTATION:
.. _class_DisplayServer_constant_FEATURE_SWAP_BUFFERS:
.. _class_DisplayServer_constant_FEATURE_CLIPBOARD_PRIMARY:
.. _class_DisplayServer_constant_FEATURE_TEXT_TO_SPEECH:
.. _class_DisplayServer_constant_FEATURE_EXTEND_TO_TITLE:
enum **Feature**:
- **FEATURE_GLOBAL_MENU** = **0**
- **FEATURE_SUBWINDOWS** = **1**
- **FEATURE_TOUCHSCREEN** = **2**
- **FEATURE_MOUSE** = **3**
- **FEATURE_MOUSE_WARP** = **4**
- **FEATURE_CLIPBOARD** = **5**
- **FEATURE_VIRTUAL_KEYBOARD** = **6**
- **FEATURE_CURSOR_SHAPE** = **7**
- **FEATURE_CUSTOM_CURSOR_SHAPE** = **8**
- **FEATURE_NATIVE_DIALOG** = **9**
- **FEATURE_IME** = **10**
- **FEATURE_WINDOW_TRANSPARENCY** = **11**
- **FEATURE_HIDPI** = **12**
- **FEATURE_ICON** = **13**
- **FEATURE_NATIVE_ICON** = **14**
- **FEATURE_ORIENTATION** = **15**
- **FEATURE_SWAP_BUFFERS** = **16**
- **FEATURE_CLIPBOARD_PRIMARY** = **18**
- **FEATURE_TEXT_TO_SPEECH** = **19** --- Display server supports text-to-speech. See ``tts_*`` methods.
- **FEATURE_EXTEND_TO_TITLE** = **20** --- Display server supports expanding window content to the title. See :ref:`WINDOW_FLAG_EXTEND_TO_TITLE<class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE>`.
----
.. _enum_DisplayServer_MouseMode:
.. _class_DisplayServer_constant_MOUSE_MODE_VISIBLE:
.. _class_DisplayServer_constant_MOUSE_MODE_HIDDEN:
.. _class_DisplayServer_constant_MOUSE_MODE_CAPTURED:
.. _class_DisplayServer_constant_MOUSE_MODE_CONFINED:
.. _class_DisplayServer_constant_MOUSE_MODE_CONFINED_HIDDEN:
enum **MouseMode**:
- **MOUSE_MODE_VISIBLE** = **0** --- Makes the mouse cursor visible if it is hidden.
- **MOUSE_MODE_HIDDEN** = **1** --- Makes the mouse cursor hidden if it is visible.
- **MOUSE_MODE_CAPTURED** = **2** --- Captures the mouse. The mouse will be hidden and its position locked at the center of the screen.
\ **Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative<class_InputEventMouseMotion_property_relative>`.
- **MOUSE_MODE_CONFINED** = **3** --- Confines the mouse cursor to the game window, and make it visible.
- **MOUSE_MODE_CONFINED_HIDDEN** = **4** --- Confines the mouse cursor to the game window, and make it hidden.
----
.. _enum_DisplayServer_ScreenOrientation:
.. _class_DisplayServer_constant_SCREEN_LANDSCAPE:
.. _class_DisplayServer_constant_SCREEN_PORTRAIT:
.. _class_DisplayServer_constant_SCREEN_REVERSE_LANDSCAPE:
.. _class_DisplayServer_constant_SCREEN_REVERSE_PORTRAIT:
.. _class_DisplayServer_constant_SCREEN_SENSOR_LANDSCAPE:
.. _class_DisplayServer_constant_SCREEN_SENSOR_PORTRAIT:
.. _class_DisplayServer_constant_SCREEN_SENSOR:
enum **ScreenOrientation**:
- **SCREEN_LANDSCAPE** = **0**
- **SCREEN_PORTRAIT** = **1**
- **SCREEN_REVERSE_LANDSCAPE** = **2**
- **SCREEN_REVERSE_PORTRAIT** = **3**
- **SCREEN_SENSOR_LANDSCAPE** = **4**
- **SCREEN_SENSOR_PORTRAIT** = **5**
- **SCREEN_SENSOR** = **6**
----
.. _enum_DisplayServer_VirtualKeyboardType:
.. _class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT:
.. _class_DisplayServer_constant_KEYBOARD_TYPE_MULTILINE:
.. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER:
.. _class_DisplayServer_constant_KEYBOARD_TYPE_NUMBER_DECIMAL:
.. _class_DisplayServer_constant_KEYBOARD_TYPE_PHONE:
.. _class_DisplayServer_constant_KEYBOARD_TYPE_EMAIL_ADDRESS:
.. _class_DisplayServer_constant_KEYBOARD_TYPE_PASSWORD:
.. _class_DisplayServer_constant_KEYBOARD_TYPE_URL:
enum **VirtualKeyboardType**:
- **KEYBOARD_TYPE_DEFAULT** = **0** --- Default text virtual keyboard.
- **KEYBOARD_TYPE_MULTILINE** = **1** --- Multiline virtual keyboard.
- **KEYBOARD_TYPE_NUMBER** = **2** --- Virtual number keypad, useful for PIN entry.
- **KEYBOARD_TYPE_NUMBER_DECIMAL** = **3** --- Virtual number keypad, useful for entering fractional numbers.
- **KEYBOARD_TYPE_PHONE** = **4** --- Virtual phone number keypad.
- **KEYBOARD_TYPE_EMAIL_ADDRESS** = **5** --- Virtual keyboard with additional keys to assist with typing email addresses.
- **KEYBOARD_TYPE_PASSWORD** = **6** --- Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.
\ **Note:** This is not supported on Web. Instead, this behaves identically to :ref:`KEYBOARD_TYPE_DEFAULT<class_DisplayServer_constant_KEYBOARD_TYPE_DEFAULT>`.
- **KEYBOARD_TYPE_URL** = **7** --- Virtual keyboard with additional keys to assist with typing URLs.
----
.. _enum_DisplayServer_CursorShape:
.. _class_DisplayServer_constant_CURSOR_ARROW:
.. _class_DisplayServer_constant_CURSOR_IBEAM:
.. _class_DisplayServer_constant_CURSOR_POINTING_HAND:
.. _class_DisplayServer_constant_CURSOR_CROSS:
.. _class_DisplayServer_constant_CURSOR_WAIT:
.. _class_DisplayServer_constant_CURSOR_BUSY:
.. _class_DisplayServer_constant_CURSOR_DRAG:
.. _class_DisplayServer_constant_CURSOR_CAN_DROP:
.. _class_DisplayServer_constant_CURSOR_FORBIDDEN:
.. _class_DisplayServer_constant_CURSOR_VSIZE:
.. _class_DisplayServer_constant_CURSOR_HSIZE:
.. _class_DisplayServer_constant_CURSOR_BDIAGSIZE:
.. _class_DisplayServer_constant_CURSOR_FDIAGSIZE:
.. _class_DisplayServer_constant_CURSOR_MOVE:
.. _class_DisplayServer_constant_CURSOR_VSPLIT:
.. _class_DisplayServer_constant_CURSOR_HSPLIT:
.. _class_DisplayServer_constant_CURSOR_HELP:
.. _class_DisplayServer_constant_CURSOR_MAX:
enum **CursorShape**:
- **CURSOR_ARROW** = **0**
- **CURSOR_IBEAM** = **1**
- **CURSOR_POINTING_HAND** = **2**
- **CURSOR_CROSS** = **3**
- **CURSOR_WAIT** = **4**
- **CURSOR_BUSY** = **5**
- **CURSOR_DRAG** = **6**
- **CURSOR_CAN_DROP** = **7**
- **CURSOR_FORBIDDEN** = **8**
- **CURSOR_VSIZE** = **9**
- **CURSOR_HSIZE** = **10**
- **CURSOR_BDIAGSIZE** = **11**
- **CURSOR_FDIAGSIZE** = **12**
- **CURSOR_MOVE** = **13**
- **CURSOR_VSPLIT** = **14**
- **CURSOR_HSPLIT** = **15**
- **CURSOR_HELP** = **16**
- **CURSOR_MAX** = **17**
----
.. _enum_DisplayServer_WindowMode:
.. _class_DisplayServer_constant_WINDOW_MODE_WINDOWED:
.. _class_DisplayServer_constant_WINDOW_MODE_MINIMIZED:
.. _class_DisplayServer_constant_WINDOW_MODE_MAXIMIZED:
.. _class_DisplayServer_constant_WINDOW_MODE_FULLSCREEN:
.. _class_DisplayServer_constant_WINDOW_MODE_EXCLUSIVE_FULLSCREEN:
enum **WindowMode**:
- **WINDOW_MODE_WINDOWED** = **0** --- Windowed mode, i.e. :ref:`Window<class_Window>` doesn't occupy the whole screen (unless set to the size of the screen).
- **WINDOW_MODE_MINIMIZED** = **1** --- Minimized window mode, i.e. :ref:`Window<class_Window>` is not visible and available on window manager's window list. Normally happens when the minimize button is pressed.
- **WINDOW_MODE_MAXIMIZED** = **2** --- Maximized window mode, i.e. :ref:`Window<class_Window>` will occupy whole screen area except task bar and still display its borders. Normally happens when the minimize button is pressed.
- **WINDOW_MODE_FULLSCREEN** = **3** --- Full screen window mode. Note that this is not *exclusive* full screen. On Windows and Linux, a borderless window is used to emulate full screen. On macOS, a new desktop is used to display the running project.
Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling full screen mode.
- **WINDOW_MODE_EXCLUSIVE_FULLSCREEN** = **4** --- Exclusive full screen window mode. This mode is implemented on Windows only. On other platforms, it is equivalent to :ref:`WINDOW_MODE_FULLSCREEN<class_DisplayServer_constant_WINDOW_MODE_FULLSCREEN>`.
Only one window in exclusive full screen mode can be visible on a given screen at a time. If multiple windows are in exclusive full screen mode for the same screen, the last one being set to this mode takes precedence.
Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports :doc:`multiple resolutions <../tutorials/rendering/multiple_resolutions>` when enabling full screen mode.
----
.. _enum_DisplayServer_WindowFlags:
.. _class_DisplayServer_constant_WINDOW_FLAG_RESIZE_DISABLED:
.. _class_DisplayServer_constant_WINDOW_FLAG_BORDERLESS:
.. _class_DisplayServer_constant_WINDOW_FLAG_ALWAYS_ON_TOP:
.. _class_DisplayServer_constant_WINDOW_FLAG_TRANSPARENT:
.. _class_DisplayServer_constant_WINDOW_FLAG_NO_FOCUS:
.. _class_DisplayServer_constant_WINDOW_FLAG_POPUP:
.. _class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE:
.. _class_DisplayServer_constant_WINDOW_FLAG_MAX:
enum **WindowFlags**:
- **WINDOW_FLAG_RESIZE_DISABLED** = **0** --- The window can't be resizing by dragging its resize grip. It's still possible to resize the window using :ref:`window_set_size<class_DisplayServer_method_window_set_size>`. This flag is ignored for full screen windows.
- **WINDOW_FLAG_BORDERLESS** = **1** --- The window do not have native title bar and other decorations. This flag is ignored for full-screen windows.
- **WINDOW_FLAG_ALWAYS_ON_TOP** = **2** --- The window is floating on top of all other windows. This flag is ignored for full-screen windows.
- **WINDOW_FLAG_TRANSPARENT** = **3** --- The window background can be transparent.
\ **Note:** This flag has no effect if :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed<class_ProjectSettings_property_display/window/per_pixel_transparency/allowed>` is set to ``false``.
\ **Note:** Transparency support is implemented on Linux, macOS and Windows, but availability might vary depending on GPU driver, display manager, and compositor capabilities.
- **WINDOW_FLAG_NO_FOCUS** = **4** --- The window can't be focused. No-focus window will ignore all input, except mouse clicks.
- **WINDOW_FLAG_POPUP** = **5** --- Window is part of menu or :ref:`OptionButton<class_OptionButton>` dropdown. This flag can't be changed when the window is visible. An active popup window will exclusively receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have ``transient parent`` set (see :ref:`window_set_transient<class_DisplayServer_method_window_set_transient>`).
- **WINDOW_FLAG_EXTEND_TO_TITLE** = **6** --- Window content is expanded to the full size of the window. Unlike borderless window, the frame is left intact and can be used to resize the window, title bar is transparent, but have minimize/maximize/close buttons.
Use :ref:`window_set_window_buttons_offset<class_DisplayServer_method_window_set_window_buttons_offset>` to adjust minimize/maximize/close buttons offset.
Use :ref:`window_get_safe_title_margins<class_DisplayServer_method_window_get_safe_title_margins>` to determine area under the title bar that is not covered by decorations.
\ **Note:** This flag is implemented on macOS.
- **WINDOW_FLAG_MAX** = **7** --- Max value of the :ref:`WindowFlags<enum_DisplayServer_WindowFlags>`.
----
.. _enum_DisplayServer_WindowEvent:
.. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_ENTER:
.. _class_DisplayServer_constant_WINDOW_EVENT_MOUSE_EXIT:
.. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_IN:
.. _class_DisplayServer_constant_WINDOW_EVENT_FOCUS_OUT:
.. _class_DisplayServer_constant_WINDOW_EVENT_CLOSE_REQUEST:
.. _class_DisplayServer_constant_WINDOW_EVENT_GO_BACK_REQUEST:
.. _class_DisplayServer_constant_WINDOW_EVENT_DPI_CHANGE:
.. _class_DisplayServer_constant_WINDOW_EVENT_TITLEBAR_CHANGE:
enum **WindowEvent**:
- **WINDOW_EVENT_MOUSE_ENTER** = **0** --- Sent when the mouse pointer enters the window, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
- **WINDOW_EVENT_MOUSE_EXIT** = **1** --- Sent when the mouse pointer exits the window, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
- **WINDOW_EVENT_FOCUS_IN** = **2** --- Sent when the window grabs focus, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
- **WINDOW_EVENT_FOCUS_OUT** = **3** --- Sent when the window loses focus, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
- **WINDOW_EVENT_CLOSE_REQUEST** = **4** --- Sent when the user has attempted to close the window (e.g. close button is pressed), see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
- **WINDOW_EVENT_GO_BACK_REQUEST** = **5** --- Sent when the device "Back" button is pressed, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
\ **Note:** This event is implemented on Android.
- **WINDOW_EVENT_DPI_CHANGE** = **6** --- Sent when the window is moved to the display with different DPI, or display DPI is changed, see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
\ **Note:** This flag is implemented on macOS.
- **WINDOW_EVENT_TITLEBAR_CHANGE** = **7** --- Sent when the window title bar decoration is changed (e.g. :ref:`WINDOW_FLAG_EXTEND_TO_TITLE<class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE>` is set or window entered/exited full screen mode), see :ref:`window_set_window_event_callback<class_DisplayServer_method_window_set_window_event_callback>`.
\ **Note:** This flag is implemented on macOS.
----
.. _enum_DisplayServer_VSyncMode:
.. _class_DisplayServer_constant_VSYNC_DISABLED:
.. _class_DisplayServer_constant_VSYNC_ENABLED:
.. _class_DisplayServer_constant_VSYNC_ADAPTIVE:
.. _class_DisplayServer_constant_VSYNC_MAILBOX:
enum **VSyncMode**:
- **VSYNC_DISABLED** = **0** --- No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible).
- **VSYNC_ENABLED** = **1** --- Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible).
- **VSYNC_ADAPTIVE** = **2** --- Behaves like :ref:`VSYNC_DISABLED<class_DisplayServer_constant_VSYNC_DISABLED>` when the framerate drops below the screen's refresh rate to reduce stuttering (tearing may be visible), otherwise vertical synchronization is enabled to avoid tearing.
- **VSYNC_MAILBOX** = **3** --- Displays the most recent image in the queue on vertical blanking intervals, while rendering to the other images (no tearing is visible).
Although not guaranteed, the images can be rendered as fast as possible, which may reduce input lag.
----
.. _enum_DisplayServer_HandleType:
.. _class_DisplayServer_constant_DISPLAY_HANDLE:
.. _class_DisplayServer_constant_WINDOW_HANDLE:
.. _class_DisplayServer_constant_WINDOW_VIEW:
enum **HandleType**:
- **DISPLAY_HANDLE** = **0** --- Display handle:
- Linux: ``X11::Display*`` for the display.
- **WINDOW_HANDLE** = **1** --- Window handle:
- Windows: ``HWND`` for the window.
- Linux: ``X11::Window*`` for the window.
- macOS: ``NSWindow*`` for the window.
- iOS: ``UIViewController*`` for the view controller.
- Android: ``jObject`` for the activity.
- **WINDOW_VIEW** = **2** --- Window view:
- macOS: ``NSView*`` for the window main view.
- iOS: ``UIView*`` for the window main view.
----
.. _enum_DisplayServer_TTSUtteranceEvent:
.. _class_DisplayServer_constant_TTS_UTTERANCE_STARTED:
.. _class_DisplayServer_constant_TTS_UTTERANCE_ENDED:
.. _class_DisplayServer_constant_TTS_UTTERANCE_CANCELED:
.. _class_DisplayServer_constant_TTS_UTTERANCE_BOUNDARY:
enum **TTSUtteranceEvent**:
- **TTS_UTTERANCE_STARTED** = **0** --- Utterance has begun to be spoken.
- **TTS_UTTERANCE_ENDED** = **1** --- Utterance was successfully finished.
- **TTS_UTTERANCE_CANCELED** = **2** --- Utterance was canceled, or TTS service was unable to process it.
- **TTS_UTTERANCE_BOUNDARY** = **3** --- Utterance reached a word or sentence boundary.
Constants
---------
.. _class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW:
.. _class_DisplayServer_constant_MAIN_WINDOW_ID:
.. _class_DisplayServer_constant_INVALID_WINDOW_ID:
- **SCREEN_OF_MAIN_WINDOW** = **-1**
- **MAIN_WINDOW_ID** = **0**
- **INVALID_WINDOW_ID** = **-1**
Method Descriptions
-------------------
.. _class_DisplayServer_method_clipboard_get:
- :ref:`String<class_String>` **clipboard_get** **(** **)** |const|
Returns the user's clipboard as a string if possible.
----
.. _class_DisplayServer_method_clipboard_get_primary:
- :ref:`String<class_String>` **clipboard_get_primary** **(** **)** |const|
Returns the user's primary clipboard as a string if possible.
\ **Note:** This method is only implemented on Linux.
----
.. _class_DisplayServer_method_clipboard_has:
- :ref:`bool<class_bool>` **clipboard_has** **(** **)** |const|
Returns ``true`` if there is content on the user's clipboard.
----
.. _class_DisplayServer_method_clipboard_set:
- void **clipboard_set** **(** :ref:`String<class_String>` clipboard **)**
Sets the user's clipboard content to the given string.
----
.. _class_DisplayServer_method_clipboard_set_primary:
- void **clipboard_set_primary** **(** :ref:`String<class_String>` clipboard_primary **)**
Sets the user's primary clipboard content to the given string.
\ **Note:** This method is only implemented on Linux.
----
.. _class_DisplayServer_method_create_sub_window:
- :ref:`int<class_int>` **create_sub_window** **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` flags, :ref:`Rect2i<class_Rect2i>` rect=Rect2i(0, 0, 0, 0) **)**
----
.. _class_DisplayServer_method_cursor_get_shape:
- :ref:`CursorShape<enum_DisplayServer_CursorShape>` **cursor_get_shape** **(** **)** |const|
----
.. _class_DisplayServer_method_cursor_set_custom_image:
- void **cursor_set_custom_image** **(** :ref:`Resource<class_Resource>` cursor, :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape=0, :ref:`Vector2<class_Vector2>` hotspot=Vector2(0, 0) **)**
----
.. _class_DisplayServer_method_cursor_set_shape:
- void **cursor_set_shape** **(** :ref:`CursorShape<enum_DisplayServer_CursorShape>` shape **)**
----
.. _class_DisplayServer_method_delete_sub_window:
- void **delete_sub_window** **(** :ref:`int<class_int>` window_id **)**
----
.. _class_DisplayServer_method_dialog_input_text:
- :ref:`Error<enum_@GlobalScope_Error>` **dialog_input_text** **(** :ref:`String<class_String>` title, :ref:`String<class_String>` description, :ref:`String<class_String>` existing_text, :ref:`Callable<class_Callable>` callback **)**
----
.. _class_DisplayServer_method_dialog_show:
- :ref:`Error<enum_@GlobalScope_Error>` **dialog_show** **(** :ref:`String<class_String>` title, :ref:`String<class_String>` description, :ref:`PackedStringArray<class_PackedStringArray>` buttons, :ref:`Callable<class_Callable>` callback **)**
----
.. _class_DisplayServer_method_enable_for_stealing_focus:
- void **enable_for_stealing_focus** **(** :ref:`int<class_int>` process_id **)**
----
.. _class_DisplayServer_method_force_process_and_drop_events:
- void **force_process_and_drop_events** **(** **)**
----
.. _class_DisplayServer_method_get_accent_color:
- :ref:`Color<class_Color>` **get_accent_color** **(** **)** |const|
Returns OS theme accent color. Returns ``Color(0, 0, 0, 0)``, if accent color is unknown.
\ **Note:** This method is implemented on macOS and Windows.
----
.. _class_DisplayServer_method_get_display_cutouts:
- :ref:`Rect2[]<class_Rect2>` **get_display_cutouts** **(** **)** |const|
Returns an :ref:`Array<class_Array>` of :ref:`Rect2<class_Rect2>`, each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also :ref:`get_display_safe_area<class_DisplayServer_method_get_display_safe_area>`.
\ **Note:** Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
----
.. _class_DisplayServer_method_get_display_safe_area:
- :ref:`Rect2i<class_Rect2i>` **get_display_safe_area** **(** **)** |const|
Returns the unobscured area of the display where interactive controls should be rendered. See also :ref:`get_display_cutouts<class_DisplayServer_method_get_display_cutouts>`.
----
.. _class_DisplayServer_method_get_name:
- :ref:`String<class_String>` **get_name** **(** **)** |const|
----
.. _class_DisplayServer_method_get_screen_count:
- :ref:`int<class_int>` **get_screen_count** **(** **)** |const|
----
.. _class_DisplayServer_method_get_swap_cancel_ok:
- :ref:`bool<class_bool>` **get_swap_cancel_ok** **(** **)**
----
.. _class_DisplayServer_method_get_window_at_screen_position:
- :ref:`int<class_int>` **get_window_at_screen_position** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
----
.. _class_DisplayServer_method_get_window_list:
- :ref:`PackedInt32Array<class_PackedInt32Array>` **get_window_list** **(** **)** |const|
----
.. _class_DisplayServer_method_global_menu_add_check_item:
- :ref:`int<class_int>` **global_menu_add_check_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
Adds a new checkable item with text ``label`` to the global menu with ID ``menu_root``.
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
\ **Note:** This method is implemented on macOS.
\ **Supported system menu IDs:**\
::
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
----
.. _class_DisplayServer_method_global_menu_add_icon_check_item:
- :ref:`int<class_int>` **global_menu_add_icon_check_item** **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
Adds a new checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
\ **Note:** This method is implemented on macOS.
\ **Supported system menu IDs:**\
::
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
----
.. _class_DisplayServer_method_global_menu_add_icon_item:
- :ref:`int<class_int>` **global_menu_add_icon_item** **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
Adds a new item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
\ **Note:** This method is implemented on macOS.
\ **Supported system menu IDs:**\
::
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
----
.. _class_DisplayServer_method_global_menu_add_icon_radio_check_item:
- :ref:`int<class_int>` **global_menu_add_icon_radio_check_item** **(** :ref:`String<class_String>` menu_root, :ref:`Texture2D<class_Texture2D>` icon, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
Adds a new radio-checkable item with text ``label`` and icon ``icon`` to the global menu with ID ``menu_root``.
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
\ **Note:** Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`global_menu_set_item_checked<class_DisplayServer_method_global_menu_set_item_checked>` for more info on how to control it.
\ **Note:** This method is implemented on macOS.
\ **Supported system menu IDs:**\
::
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
----
.. _class_DisplayServer_method_global_menu_add_item:
- :ref:`int<class_int>` **global_menu_add_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
Adds a new item with text ``label`` to the global menu with ID ``menu_root``.
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
\ **Note:** This method is implemented on macOS.
\ **Supported system menu IDs:**\
::
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
----
.. _class_DisplayServer_method_global_menu_add_multistate_item:
- :ref:`int<class_int>` **global_menu_add_multistate_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` labe, :ref:`int<class_int>` max_states, :ref:`int<class_int>` default_state, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
Adds a new item with text ``labe`` to the global menu with ID ``menu_root``.
Contrarily to normal binary items, multistate items can have more than two states, as defined by ``max_states``. Each press or activate of the item will increase the state by one. The default value is defined by ``default_state``.
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
\ **Note:** By default, there's no indication of the current item state, it should be changed manually.
\ **Note:** This method is implemented on macOS.
\ **Supported system menu IDs:**\
::
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
----
.. _class_DisplayServer_method_global_menu_add_radio_check_item:
- :ref:`int<class_int>` **global_menu_add_radio_check_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Callable<class_Callable>` key_callback, :ref:`Variant<class_Variant>` tag=null, :ref:`Key<enum_@GlobalScope_Key>` accelerator=0, :ref:`int<class_int>` index=-1 **)**
Adds a new radio-checkable item with text ``label`` to the global menu with ID ``menu_root``.
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
\ **Note:** Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`global_menu_set_item_checked<class_DisplayServer_method_global_menu_set_item_checked>` for more info on how to control it.
\ **Note:** This method is implemented on macOS.
\ **Supported system menu IDs:**\
::
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
----
.. _class_DisplayServer_method_global_menu_add_separator:
- :ref:`int<class_int>` **global_menu_add_separator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` index=-1 **)**
Adds a separator between items to the global menu with ID ``menu_root``. Separators also occupy an index.
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
\ **Note:** This method is implemented on macOS.
\ **Supported system menu IDs:**\
::
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
----
.. _class_DisplayServer_method_global_menu_add_submenu_item:
- :ref:`int<class_int>` **global_menu_add_submenu_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`String<class_String>` submenu, :ref:`int<class_int>` index=-1 **)**
Adds an item that will act as a submenu of the global menu ``menu_root``. The ``submenu`` argument is the ID of the global menu root that will be shown when the item is clicked.
Returns index of the inserted item, it's not guaranteed to be the same as ``index`` value.
\ **Note:** This method is implemented on macOS.
\ **Supported system menu IDs:**\
::
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
----
.. _class_DisplayServer_method_global_menu_clear:
- void **global_menu_clear** **(** :ref:`String<class_String>` menu_root **)**
Removes all items from the global menu with ID ``menu_root``.
\ **Note:** This method is implemented on macOS.
\ **Supported system menu IDs:**\
::
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
----
.. _class_DisplayServer_method_global_menu_get_item_accelerator:
- :ref:`Key<enum_@GlobalScope_Key>` **global_menu_get_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns the accelerator of the item at index ``idx``. Accelerators are special combinations of keys that activate the item, no matter which control is focused.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_callback:
- :ref:`Callable<class_Callable>` **global_menu_get_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns the callback of the item at index ``idx``.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_icon:
- :ref:`Texture2D<class_Texture2D>` **global_menu_get_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns the icon of the item at index ``idx``.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_indentation_level:
- :ref:`int<class_int>` **global_menu_get_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns the horizontal offset of the item at the given ``idx``.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_index_from_tag:
- :ref:`int<class_int>` **global_menu_get_item_index_from_tag** **(** :ref:`String<class_String>` menu_root, :ref:`Variant<class_Variant>` tag **)** |const|
Returns the index of the item with the specified ``tag``. Index is automatically assigned to each item by the engine. Index can not be set manually.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_index_from_text:
- :ref:`int<class_int>` **global_menu_get_item_index_from_text** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` text **)** |const|
Returns the index of the item with the specified ``text``. Index is automatically assigned to each item by the engine. Index can not be set manually.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_key_callback:
- :ref:`Callable<class_Callable>` **global_menu_get_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns the callback of the item accelerator at index ``idx``.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_max_states:
- :ref:`int<class_int>` **global_menu_get_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns number of states of an multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_state:
- :ref:`int<class_int>` **global_menu_get_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns the state of an multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_submenu:
- :ref:`String<class_String>` **global_menu_get_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns the submenu ID of the item at index ``idx``. See :ref:`global_menu_add_submenu_item<class_DisplayServer_method_global_menu_add_submenu_item>` for more info on how to add a submenu.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_tag:
- :ref:`Variant<class_Variant>` **global_menu_get_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns the metadata of the specified item, which might be of any type. You can set it with :ref:`global_menu_set_item_tag<class_DisplayServer_method_global_menu_set_item_tag>`, which provides a simple way of assigning context data to items.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_text:
- :ref:`String<class_String>` **global_menu_get_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns the text of the item at index ``idx``.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_get_item_tooltip:
- :ref:`String<class_String>` **global_menu_get_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns the tooltip associated with the specified index index ``idx``.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_is_item_checkable:
- :ref:`bool<class_bool>` **global_menu_is_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns ``true`` if the item at index ``idx`` is checkable in some way, i.e. if it has a checkbox or radio button.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_is_item_checked:
- :ref:`bool<class_bool>` **global_menu_is_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns ``true`` if the item at index ``idx`` is checked.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_is_item_disabled:
- :ref:`bool<class_bool>` **global_menu_is_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns ``true`` if the item at index ``idx`` is disabled. When it is disabled it can't be selected, or its action invoked.
See :ref:`global_menu_set_item_disabled<class_DisplayServer_method_global_menu_set_item_disabled>` for more info on how to disable an item.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_is_item_radio_checkable:
- :ref:`bool<class_bool>` **global_menu_is_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)** |const|
Returns ``true`` if the item at index ``idx`` has radio button-style checkability.
\ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_remove_item:
- void **global_menu_remove_item** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
Removes the item at index ``idx`` from the global menu ``menu_root``.
\ **Note:** The indices of items after the removed item will be shifted by one.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_accelerator:
- void **global_menu_set_item_accelerator** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Key<enum_@GlobalScope_Key>` keycode **)**
Sets the accelerator of the item at index ``idx``.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_callback:
- void **global_menu_set_item_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` callback **)**
Sets the callback of the item at index ``idx``. Callback is emitted when an item is pressed.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_checkable:
- void **global_menu_set_item_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
Sets whether the item at index ``idx`` has a checkbox. If ``false``, sets the type of the item to plain text.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_checked:
- void **global_menu_set_item_checked** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checked **)**
Sets the checkstate status of the item at index ``idx``.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_disabled:
- void **global_menu_set_item_disabled** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
Enables/disables the item at index ``idx``. When it is disabled, it can't be selected and its action can't be invoked.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_icon:
- void **global_menu_set_item_icon** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` icon **)**
Replaces the :ref:`Texture2D<class_Texture2D>` icon of the specified ``idx``.
\ **Note:** This method is implemented on macOS.
\ **Note:** This method is not supported by macOS "_dock" menu items.
----
.. _class_DisplayServer_method_global_menu_set_item_indentation_level:
- void **global_menu_set_item_indentation_level** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` level **)**
Sets the horizontal offset of the item at the given ``idx``.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_key_callback:
- void **global_menu_set_item_key_callback** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Callable<class_Callable>` key_callback **)**
Sets the callback of the item at index ``idx``. Callback is emitted when its accelerator is activated.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_max_states:
- void **global_menu_set_item_max_states** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` max_states **)**
Sets number of state of an multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_radio_checkable:
- void **global_menu_set_item_radio_checkable** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`bool<class_bool>` checkable **)**
Sets the type of the item at the specified index ``idx`` to radio button. If ``false``, sets the type of the item to plain text
\ **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_state:
- void **global_menu_set_item_state** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`int<class_int>` state **)**
Sets the state of an multistate item. See :ref:`global_menu_add_multistate_item<class_DisplayServer_method_global_menu_add_multistate_item>` for details.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_submenu:
- void **global_menu_set_item_submenu** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` submenu **)**
Sets the submenu of the item at index ``idx``. The submenu is the ID of a global menu root that would be shown when the item is clicked.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_tag:
- void **global_menu_set_item_tag** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` tag **)**
Sets the metadata of an item, which may be of any type. You can later get it with :ref:`global_menu_get_item_tag<class_DisplayServer_method_global_menu_get_item_tag>`, which provides a simple way of assigning context data to items.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_text:
- void **global_menu_set_item_text** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
Sets the text of the item at index ``idx``.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_global_menu_set_item_tooltip:
- void **global_menu_set_item_tooltip** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)**
Sets the :ref:`String<class_String>` tooltip of the item at the specified index ``idx``.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_has_feature:
- :ref:`bool<class_bool>` **has_feature** **(** :ref:`Feature<enum_DisplayServer_Feature>` feature **)** |const|
----
.. _class_DisplayServer_method_ime_get_selection:
- :ref:`Vector2i<class_Vector2i>` **ime_get_selection** **(** **)** |const|
----
.. _class_DisplayServer_method_ime_get_text:
- :ref:`String<class_String>` **ime_get_text** **(** **)** |const|
----
.. _class_DisplayServer_method_is_dark_mode:
- :ref:`bool<class_bool>` **is_dark_mode** **(** **)** |const|
Returns ``true`` if OS is using dark mode.
\ **Note:** This method is implemented on macOS, Windows and Linux.
----
.. _class_DisplayServer_method_is_dark_mode_supported:
- :ref:`bool<class_bool>` **is_dark_mode_supported** **(** **)** |const|
Returns ``true`` if OS supports dark mode.
\ **Note:** This method is implemented on macOS, Windows and Linux.
----
.. _class_DisplayServer_method_keyboard_get_current_layout:
- :ref:`int<class_int>` **keyboard_get_current_layout** **(** **)** |const|
Returns active keyboard layout index.
\ **Note:** This method is implemented on Linux, macOS and Windows.
----
.. _class_DisplayServer_method_keyboard_get_keycode_from_physical:
- :ref:`Key<enum_@GlobalScope_Key>` **keyboard_get_keycode_from_physical** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
Converts a physical (US QWERTY) ``keycode`` to one in the active keyboard layout.
\ **Note:** This method is implemented on Linux, macOS and Windows.
----
.. _class_DisplayServer_method_keyboard_get_layout_count:
- :ref:`int<class_int>` **keyboard_get_layout_count** **(** **)** |const|
Returns the number of keyboard layouts.
\ **Note:** This method is implemented on Linux, macOS and Windows.
----
.. _class_DisplayServer_method_keyboard_get_layout_language:
- :ref:`String<class_String>` **keyboard_get_layout_language** **(** :ref:`int<class_int>` index **)** |const|
Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``.
\ **Note:** This method is implemented on Linux, macOS and Windows.
----
.. _class_DisplayServer_method_keyboard_get_layout_name:
- :ref:`String<class_String>` **keyboard_get_layout_name** **(** :ref:`int<class_int>` index **)** |const|
Returns the localized name of the keyboard layout at position ``index``.
\ **Note:** This method is implemented on Linux, macOS and Windows.
----
.. _class_DisplayServer_method_keyboard_set_current_layout:
- void **keyboard_set_current_layout** **(** :ref:`int<class_int>` index **)**
Sets active keyboard layout.
\ **Note:** This method is implemented on Linux, macOS and Windows.
----
.. _class_DisplayServer_method_mouse_get_button_state:
- :ref:`MouseButton<enum_@GlobalScope_MouseButton>` **mouse_get_button_state** **(** **)** |const|
----
.. _class_DisplayServer_method_mouse_get_mode:
- :ref:`MouseMode<enum_DisplayServer_MouseMode>` **mouse_get_mode** **(** **)** |const|
----
.. _class_DisplayServer_method_mouse_get_position:
- :ref:`Vector2i<class_Vector2i>` **mouse_get_position** **(** **)** |const|
Returns the mouse cursor's current position.
----
.. _class_DisplayServer_method_mouse_set_mode:
- void **mouse_set_mode** **(** :ref:`MouseMode<enum_DisplayServer_MouseMode>` mouse_mode **)**
----
.. _class_DisplayServer_method_process_events:
- void **process_events** **(** **)**
----
.. _class_DisplayServer_method_screen_get_dpi:
- :ref:`int<class_int>` **screen_get_dpi** **(** :ref:`int<class_int>` screen=-1 **)** |const|
Returns the dots per inch density of the specified screen. If ``screen`` is :ref:`SCREEN_OF_MAIN_WINDOW<class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW>` (the default value), a screen with the main window will be used.
\ **Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used.
\ **Note:** On Android devices, the actual screen densities are grouped into six generalized densities:
::
ldpi - 120 dpi
mdpi - 160 dpi
hdpi - 240 dpi
xhdpi - 320 dpi
xxhdpi - 480 dpi
xxxhdpi - 640 dpi
\ **Note:** This method is implemented on Android, Linux, macOS and Windows. Returns ``72`` on unsupported platforms.
----
.. _class_DisplayServer_method_screen_get_max_scale:
- :ref:`float<class_float>` **screen_get_max_scale** **(** **)** |const|
Returns the greatest scale factor of all screens.
\ **Note:** On macOS returned value is ``2.0`` if there is at least one hiDPI (Retina) screen in the system, and ``1.0`` in all other cases.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_screen_get_orientation:
- :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` **screen_get_orientation** **(** :ref:`int<class_int>` screen=-1 **)** |const|
----
.. _class_DisplayServer_method_screen_get_position:
- :ref:`Vector2i<class_Vector2i>` **screen_get_position** **(** :ref:`int<class_int>` screen=-1 **)** |const|
----
.. _class_DisplayServer_method_screen_get_refresh_rate:
- :ref:`float<class_float>` **screen_get_refresh_rate** **(** :ref:`int<class_int>` screen=-1 **)** |const|
Returns the current refresh rate of the specified screen. If ``screen`` is :ref:`SCREEN_OF_MAIN_WINDOW<class_DisplayServer_constant_SCREEN_OF_MAIN_WINDOW>` (the default value), a screen with the main window will be used.
\ **Note:** Returns ``-1.0`` if the DisplayServer fails to find the refresh rate for the specified screen. On Web, :ref:`screen_get_refresh_rate<class_DisplayServer_method_screen_get_refresh_rate>` will always return ``-1.0`` as there is no way to retrieve the refresh rate on that platform.
To fallback to a default refresh rate if the method fails, try:
::
var refresh_rate = DisplayServer.screen_get_refresh_rate()
if refresh_rate < 0:
refresh_rate = 60.0
----
.. _class_DisplayServer_method_screen_get_scale:
- :ref:`float<class_float>` **screen_get_scale** **(** :ref:`int<class_int>` screen=-1 **)** |const|
Returns the scale factor of the specified screen by index.
\ **Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_screen_get_size:
- :ref:`Vector2i<class_Vector2i>` **screen_get_size** **(** :ref:`int<class_int>` screen=-1 **)** |const|
----
.. _class_DisplayServer_method_screen_get_usable_rect:
- :ref:`Rect2i<class_Rect2i>` **screen_get_usable_rect** **(** :ref:`int<class_int>` screen=-1 **)** |const|
----
.. _class_DisplayServer_method_screen_is_kept_on:
- :ref:`bool<class_bool>` **screen_is_kept_on** **(** **)** |const|
----
.. _class_DisplayServer_method_screen_is_touchscreen:
- :ref:`bool<class_bool>` **screen_is_touchscreen** **(** :ref:`int<class_int>` screen=-1 **)** |const|
----
.. _class_DisplayServer_method_screen_set_keep_on:
- void **screen_set_keep_on** **(** :ref:`bool<class_bool>` enable **)**
----
.. _class_DisplayServer_method_screen_set_orientation:
- void **screen_set_orientation** **(** :ref:`ScreenOrientation<enum_DisplayServer_ScreenOrientation>` orientation, :ref:`int<class_int>` screen=-1 **)**
----
.. _class_DisplayServer_method_set_icon:
- void **set_icon** **(** :ref:`Image<class_Image>` image **)**
----
.. _class_DisplayServer_method_set_native_icon:
- void **set_native_icon** **(** :ref:`String<class_String>` filename **)**
----
.. _class_DisplayServer_method_tablet_get_current_driver:
- :ref:`String<class_String>` **tablet_get_current_driver** **(** **)** |const|
Returns current active tablet driver name.
\ **Note:** This method is implemented on Windows.
----
.. _class_DisplayServer_method_tablet_get_driver_count:
- :ref:`int<class_int>` **tablet_get_driver_count** **(** **)** |const|
Returns the total number of available tablet drivers.
\ **Note:** This method is implemented on Windows.
----
.. _class_DisplayServer_method_tablet_get_driver_name:
- :ref:`String<class_String>` **tablet_get_driver_name** **(** :ref:`int<class_int>` idx **)** |const|
Returns the tablet driver name for the given index.
\ **Note:** This method is implemented on Windows.
----
.. _class_DisplayServer_method_tablet_set_current_driver:
- void **tablet_set_current_driver** **(** :ref:`String<class_String>` name **)**
Set active tablet driver name.
\ **Note:** This method is implemented on Windows.
----
.. _class_DisplayServer_method_tts_get_voices:
- :ref:`Dictionary[]<class_Dictionary>` **tts_get_voices** **(** **)** |const|
Returns an :ref:`Array<class_Array>` of voice information dictionaries.
Each :ref:`Dictionary<class_Dictionary>` contains two :ref:`String<class_String>` entries:
- ``name`` is voice name.
- ``id`` is voice identifier.
- ``language`` is language code in ``lang_Variant`` format. ``lang`` part is a 2 or 3-letter code based on the ISO-639 standard, in lowercase. And ``Variant`` part is an engine dependent string describing country, region or/and dialect.
\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows.
----
.. _class_DisplayServer_method_tts_get_voices_for_language:
- :ref:`PackedStringArray<class_PackedStringArray>` **tts_get_voices_for_language** **(** :ref:`String<class_String>` language **)** |const|
Returns an :ref:`PackedStringArray<class_PackedStringArray>` of voice identifiers for the ``language``.
\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows.
----
.. _class_DisplayServer_method_tts_is_paused:
- :ref:`bool<class_bool>` **tts_is_paused** **(** **)** |const|
Returns ``true`` if the synthesizer is in a paused state.
\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows.
----
.. _class_DisplayServer_method_tts_is_speaking:
- :ref:`bool<class_bool>` **tts_is_speaking** **(** **)** |const|
Returns ``true`` if the synthesizer is generating speech, or have utterance waiting in the queue.
\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows.
----
.. _class_DisplayServer_method_tts_pause:
- void **tts_pause** **(** **)**
Puts the synthesizer into a paused state.
\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows.
----
.. _class_DisplayServer_method_tts_resume:
- void **tts_resume** **(** **)**
Resumes the synthesizer if it was paused.
\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows.
----
.. _class_DisplayServer_method_tts_set_utterance_callback:
- void **tts_set_utterance_callback** **(** :ref:`TTSUtteranceEvent<enum_DisplayServer_TTSUtteranceEvent>` event, :ref:`Callable<class_Callable>` callable **)**
Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary.
- ``TTS_UTTERANCE_STARTED``, ``TTS_UTTERANCE_ENDED``, and ``TTS_UTTERANCE_CANCELED`` callable's method should take one :ref:`int<class_int>` parameter, the utterance id.
- ``TTS_UTTERANCE_BOUNDARY`` callable's method should take two :ref:`int<class_int>` parameters, the index of the character and the utterance id.
\ **Note:** The granularity of the boundary callbacks is engine dependent.
\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows.
----
.. _class_DisplayServer_method_tts_speak:
- void **tts_speak** **(** :ref:`String<class_String>` text, :ref:`String<class_String>` voice, :ref:`int<class_int>` volume=50, :ref:`float<class_float>` pitch=1.0, :ref:`float<class_float>` rate=1.0, :ref:`int<class_int>` utterance_id=0, :ref:`bool<class_bool>` interrupt=false **)**
Adds an utterance to the queue. If ``interrupt`` is ``true``, the queue is cleared first.
- ``voice`` identifier is one of the ``"id"`` values returned by :ref:`tts_get_voices<class_DisplayServer_method_tts_get_voices>` or one of the values returned by :ref:`tts_get_voices_for_language<class_DisplayServer_method_tts_get_voices_for_language>`.
- ``volume`` ranges from ``0`` (lowest) to ``100`` (highest).
- ``pitch`` ranges from ``0.0`` (lowest) to ``2.0`` (highest), ``1.0`` is default pitch for the current voice.
- ``rate`` ranges from ``0.1`` (lowest) to ``10.0`` (highest), ``1.0`` is a normal speaking rate. Other values act as a percentage relative.
- ``utterance_id`` is passed as a parameter to the callback functions.
\ **Note:** On Windows and Linux, utterance ``text`` can use SSML markup. SSML support is engine and voice dependent. If the engine does not support SSML, you should strip out all XML markup before calling :ref:`tts_speak<class_DisplayServer_method_tts_speak>`.
\ **Note:** The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated.
\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows.
----
.. _class_DisplayServer_method_tts_stop:
- void **tts_stop** **(** **)**
Stops synthesis in progress and removes all utterances from the queue.
\ **Note:** This method is implemented on Android, iOS, Web, Linux, macOS, and Windows.
----
.. _class_DisplayServer_method_virtual_keyboard_get_height:
- :ref:`int<class_int>` **virtual_keyboard_get_height** **(** **)** |const|
Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
----
.. _class_DisplayServer_method_virtual_keyboard_hide:
- void **virtual_keyboard_hide** **(** **)**
Hides the virtual keyboard if it is shown, does nothing otherwise.
----
.. _class_DisplayServer_method_virtual_keyboard_show:
- void **virtual_keyboard_show** **(** :ref:`String<class_String>` existing_text, :ref:`Rect2<class_Rect2>` position=Rect2(0, 0, 0, 0), :ref:`VirtualKeyboardType<enum_DisplayServer_VirtualKeyboardType>` type=0, :ref:`int<class_int>` max_length=-1, :ref:`int<class_int>` cursor_start=-1, :ref:`int<class_int>` cursor_end=-1 **)**
Shows the virtual keyboard if the platform has one.
\ ``existing_text`` parameter is useful for implementing your own :ref:`LineEdit<class_LineEdit>` or :ref:`TextEdit<class_TextEdit>`, as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).
\ ``position`` parameter is the screen space :ref:`Rect2<class_Rect2>` of the edited text.
\ ``type`` parameter allows configuring which type of virtual keyboard to show.
\ ``max_length`` limits the number of characters that can be entered if different from ``-1``.
\ ``cursor_start`` can optionally define the current text cursor position if ``cursor_end`` is not set.
\ ``cursor_start`` and ``cursor_end`` can optionally define the current text selection.
\ **Note:** This method is implemented on Android, iOS and Web.
----
.. _class_DisplayServer_method_warp_mouse:
- void **warp_mouse** **(** :ref:`Vector2i<class_Vector2i>` position **)**
Sets the mouse cursor position to the given ``position`` relative to an origin at the upper left corner of the currently focused game Window Manager window.
----
.. _class_DisplayServer_method_window_attach_instance_id:
- void **window_attach_instance_id** **(** :ref:`int<class_int>` instance_id, :ref:`int<class_int>` window_id=0 **)**
----
.. _class_DisplayServer_method_window_can_draw:
- :ref:`bool<class_bool>` **window_can_draw** **(** :ref:`int<class_int>` window_id=0 **)** |const|
----
.. _class_DisplayServer_method_window_get_active_popup:
- :ref:`int<class_int>` **window_get_active_popup** **(** **)** |const|
Returns ID of the active popup window, or :ref:`INVALID_WINDOW_ID<class_DisplayServer_constant_INVALID_WINDOW_ID>` if there is none.
----
.. _class_DisplayServer_method_window_get_attached_instance_id:
- :ref:`int<class_int>` **window_get_attached_instance_id** **(** :ref:`int<class_int>` window_id=0 **)** |const|
----
.. _class_DisplayServer_method_window_get_current_screen:
- :ref:`int<class_int>` **window_get_current_screen** **(** :ref:`int<class_int>` window_id=0 **)** |const|
----
.. _class_DisplayServer_method_window_get_flag:
- :ref:`bool<class_bool>` **window_get_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`int<class_int>` window_id=0 **)** |const|
Returns the current value of the given window's ``flag``.
----
.. _class_DisplayServer_method_window_get_max_size:
- :ref:`Vector2i<class_Vector2i>` **window_get_max_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
----
.. _class_DisplayServer_method_window_get_min_size:
- :ref:`Vector2i<class_Vector2i>` **window_get_min_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
----
.. _class_DisplayServer_method_window_get_mode:
- :ref:`WindowMode<enum_DisplayServer_WindowMode>` **window_get_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
Returns the mode of the given window.
----
.. _class_DisplayServer_method_window_get_native_handle:
- :ref:`int<class_int>` **window_get_native_handle** **(** :ref:`HandleType<enum_DisplayServer_HandleType>` handle_type, :ref:`int<class_int>` window_id=0 **)** |const|
Returns internal structure pointers for use in plugins.
\ **Note:** This method is implemented on Android, Linux, macOS and Windows.
----
.. _class_DisplayServer_method_window_get_popup_safe_rect:
- :ref:`Rect2i<class_Rect2i>` **window_get_popup_safe_rect** **(** :ref:`int<class_int>` window **)** |const|
Returns the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system.
----
.. _class_DisplayServer_method_window_get_position:
- :ref:`Vector2i<class_Vector2i>` **window_get_position** **(** :ref:`int<class_int>` window_id=0 **)** |const|
Returns the position of the given window to on the screen.
----
.. _class_DisplayServer_method_window_get_real_size:
- :ref:`Vector2i<class_Vector2i>` **window_get_real_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
----
.. _class_DisplayServer_method_window_get_safe_title_margins:
- :ref:`Vector2i<class_Vector2i>` **window_get_safe_title_margins** **(** :ref:`int<class_int>` window_id=0 **)** |const|
Returns left and right margins of the title that are safe to use (contains no buttons or other elements) when :ref:`WINDOW_FLAG_EXTEND_TO_TITLE<class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE>` flag is set.
----
.. _class_DisplayServer_method_window_get_size:
- :ref:`Vector2i<class_Vector2i>` **window_get_size** **(** :ref:`int<class_int>` window_id=0 **)** |const|
----
.. _class_DisplayServer_method_window_get_vsync_mode:
- :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` **window_get_vsync_mode** **(** :ref:`int<class_int>` window_id=0 **)** |const|
Returns the V-Sync mode of the given window.
----
.. _class_DisplayServer_method_window_maximize_on_title_dbl_click:
- :ref:`bool<class_bool>` **window_maximize_on_title_dbl_click** **(** **)** |const|
Returns ``true``, if double-click on a window title should maximize it.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_window_minimize_on_title_dbl_click:
- :ref:`bool<class_bool>` **window_minimize_on_title_dbl_click** **(** **)** |const|
Returns ``true``, if double-click on a window title should minimize it.
\ **Note:** This method is implemented on macOS.
----
.. _class_DisplayServer_method_window_move_to_foreground:
- void **window_move_to_foreground** **(** :ref:`int<class_int>` window_id=0 **)**
----
.. _class_DisplayServer_method_window_request_attention:
- void **window_request_attention** **(** :ref:`int<class_int>` window_id=0 **)**
----
.. _class_DisplayServer_method_window_set_current_screen:
- void **window_set_current_screen** **(** :ref:`int<class_int>` screen, :ref:`int<class_int>` window_id=0 **)**
----
.. _class_DisplayServer_method_window_set_drop_files_callback:
- void **window_set_drop_files_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
----
.. _class_DisplayServer_method_window_set_exclusive:
- void **window_set_exclusive** **(** :ref:`int<class_int>` window_id, :ref:`bool<class_bool>` exclusive **)**
If set to ``true``, this window will always stay on top of its parent window, parent window will ignore input while this window is opened.
\ **Note:** On macOS, exclusive windows are confined to the same space (virtual desktop or screen) as the parent window.
\ **Note:** This method is implemented on macOS and Windows.
----
.. _class_DisplayServer_method_window_set_flag:
- void **window_set_flag** **(** :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` flag, :ref:`bool<class_bool>` enabled, :ref:`int<class_int>` window_id=0 **)**
Enables or disables the given window's given ``flag``. See :ref:`WindowFlags<enum_DisplayServer_WindowFlags>` for possible values and their behavior.
----
.. _class_DisplayServer_method_window_set_ime_active:
- void **window_set_ime_active** **(** :ref:`bool<class_bool>` active, :ref:`int<class_int>` window_id=0 **)**
----
.. _class_DisplayServer_method_window_set_ime_position:
- void **window_set_ime_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
----
.. _class_DisplayServer_method_window_set_input_event_callback:
- void **window_set_input_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
----
.. _class_DisplayServer_method_window_set_input_text_callback:
- void **window_set_input_text_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
----
.. _class_DisplayServer_method_window_set_max_size:
- void **window_set_max_size** **(** :ref:`Vector2i<class_Vector2i>` max_size, :ref:`int<class_int>` window_id=0 **)**
----
.. _class_DisplayServer_method_window_set_min_size:
- void **window_set_min_size** **(** :ref:`Vector2i<class_Vector2i>` min_size, :ref:`int<class_int>` window_id=0 **)**
Sets the minimum size for the given window to ``min_size`` (in pixels).
\ **Note:** By default, the main window has a minimum size of ``Vector2i(64, 64)``. This prevents issues that can arise when the window is resized to a near-zero size.
----
.. _class_DisplayServer_method_window_set_mode:
- void **window_set_mode** **(** :ref:`WindowMode<enum_DisplayServer_WindowMode>` mode, :ref:`int<class_int>` window_id=0 **)**
Sets window mode for the given window to ``mode``. See :ref:`WindowMode<enum_DisplayServer_WindowMode>` for possible values and how each mode behaves.
\ **Note:** Setting the window to full screen forcibly sets the borderless flag to ``true``, so make sure to set it back to ``false`` when not wanted.
----
.. _class_DisplayServer_method_window_set_mouse_passthrough:
- void **window_set_mouse_passthrough** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` region, :ref:`int<class_int>` window_id=0 **)**
Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
.. tabs::
.. code-tab:: gdscript
# Set region, using Path2D node.
DisplayServer.window_set_mouse_passthrough($Path2D.curve.get_baked_points())
# Set region, using Polygon2D node.
DisplayServer.window_set_mouse_passthrough($Polygon2D.polygon)
# Reset region to default.
DisplayServer.window_set_mouse_passthrough([])
.. code-tab:: csharp
// Set region, using Path2D node.
DisplayServer.WindowSetMousePassthrough(GetNode<Path2D>("Path2D").Curve.GetBakedPoints());
// Set region, using Polygon2D node.
DisplayServer.WindowSetMousePassthrough(GetNode<Polygon2D>("Polygon2D").Polygon);
// Reset region to default.
DisplayServer.WindowSetMousePassthrough(new Vector2[] {});
\ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is.
\ **Note:** This method is implemented on Linux, macOS and Windows.
----
.. _class_DisplayServer_method_window_set_popup_safe_rect:
- void **window_set_popup_safe_rect** **(** :ref:`int<class_int>` window, :ref:`Rect2i<class_Rect2i>` rect **)**
Sets the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system. Clicking this area will not auto-close this popup.
----
.. _class_DisplayServer_method_window_set_position:
- void **window_set_position** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`int<class_int>` window_id=0 **)**
Sets the position of the given window to ``position``.
----
.. _class_DisplayServer_method_window_set_rect_changed_callback:
- void **window_set_rect_changed_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
----
.. _class_DisplayServer_method_window_set_size:
- void **window_set_size** **(** :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` window_id=0 **)**
Sets the size of the given window to ``size``.
----
.. _class_DisplayServer_method_window_set_title:
- void **window_set_title** **(** :ref:`String<class_String>` title, :ref:`int<class_int>` window_id=0 **)**
Sets the title of the given window to ``title``.
----
.. _class_DisplayServer_method_window_set_transient:
- void **window_set_transient** **(** :ref:`int<class_int>` window_id, :ref:`int<class_int>` parent_window_id **)**
Sets window transient parent. Transient window is will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can't enter full-screen mode.
Note that behavior might be different depending on the platform.
----
.. _class_DisplayServer_method_window_set_vsync_mode:
- void **window_set_vsync_mode** **(** :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` vsync_mode, :ref:`int<class_int>` window_id=0 **)**
Sets the V-Sync mode of the given window.
See :ref:`VSyncMode<enum_DisplayServer_VSyncMode>` for possible values and how they affect the behavior of your application.
Depending on the platform and used renderer, the engine will fall back to :ref:`VSYNC_ENABLED<class_DisplayServer_constant_VSYNC_ENABLED>`, if the desired mode is not supported.
----
.. _class_DisplayServer_method_window_set_window_buttons_offset:
- void **window_set_window_buttons_offset** **(** :ref:`Vector2i<class_Vector2i>` offset, :ref:`int<class_int>` window_id=0 **)**
When :ref:`WINDOW_FLAG_EXTEND_TO_TITLE<class_DisplayServer_constant_WINDOW_FLAG_EXTEND_TO_TITLE>` flag is set, set offset to the center of the first titlebar button.
\ **Note:** This flag is implemented on macOS.
----
.. _class_DisplayServer_method_window_set_window_event_callback:
- void **window_set_window_event_callback** **(** :ref:`Callable<class_Callable>` callback, :ref:`int<class_int>` window_id=0 **)**
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`