Files
godot-docs/classes/class_displayserver.rst
2022-02-01 16:35:13 +01:00

1424 lines
120 KiB
ReStructuredText

:github_url: hide
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the DisplayServer.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _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:`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| |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :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:`Variant<class_Variant>` tag=null **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :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:`Variant<class_Variant>` tag=null **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_add_separator<class_DisplayServer_method_global_menu_add_separator>` **(** :ref:`String<class_String>` menu_root **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :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 **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`global_menu_clear<class_DisplayServer_method_global_menu_clear>` **(** :ref:`String<class_String>` menu_root **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :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 **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :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 **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :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 **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :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 **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :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| |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 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_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_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 **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :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:`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:`mouse_warp_to_position<class_DisplayServer_method_mouse_warp_to_position>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 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_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:`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=Rect2i(0, 0, 0, 0), :ref:`bool<class_bool>` multiline=false, :ref:`int<class_int>` max_length=-1, :ref:`int<class_int>` cursor_start=-1, :ref:`int<class_int>` cursor_end=-1 **)** |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 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_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:`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_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| |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 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_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_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_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:
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**
----
.. _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_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:
enum **WindowMode**:
- **WINDOW_MODE_WINDOWED** = **0**
- **WINDOW_MODE_MINIMIZED** = **1**
- **WINDOW_MODE_MAXIMIZED** = **2**
- **WINDOW_MODE_FULLSCREEN** = **3** --- Fullscreen window mode. Note that this is not *exclusive* fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project.
Regardless of the platform, enabling fullscreen 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 fullscreen 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_MAX:
enum **WindowFlags**:
- **WINDOW_FLAG_RESIZE_DISABLED** = **0**
- **WINDOW_FLAG_BORDERLESS** = **1**
- **WINDOW_FLAG_ALWAYS_ON_TOP** = **2**
- **WINDOW_FLAG_TRANSPARENT** = **3**
- **WINDOW_FLAG_NO_FOCUS** = **4**
- **WINDOW_FLAG_MAX** = **5**
----
.. _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:
enum **WindowEvent**:
- **WINDOW_EVENT_MOUSE_ENTER** = **0**
- **WINDOW_EVENT_MOUSE_EXIT** = **1**
- **WINDOW_EVENT_FOCUS_IN** = **2**
- **WINDOW_EVENT_FOCUS_OUT** = **3**
- **WINDOW_EVENT_CLOSE_REQUEST** = **4**
- **WINDOW_EVENT_GO_BACK_REQUEST** = **5**
- **WINDOW_EVENT_DPI_CHANGE** = **6**
----
.. _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.
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_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:
- void **global_menu_add_check_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Variant<class_Variant>` tag=null **)**
----
.. _class_DisplayServer_method_global_menu_add_item:
- void **global_menu_add_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`Callable<class_Callable>` callback, :ref:`Variant<class_Variant>` tag=null **)**
----
.. _class_DisplayServer_method_global_menu_add_separator:
- void **global_menu_add_separator** **(** :ref:`String<class_String>` menu_root **)**
----
.. _class_DisplayServer_method_global_menu_add_submenu_item:
- void **global_menu_add_submenu_item** **(** :ref:`String<class_String>` menu_root, :ref:`String<class_String>` label, :ref:`String<class_String>` submenu **)**
----
.. _class_DisplayServer_method_global_menu_clear:
- void **global_menu_clear** **(** :ref:`String<class_String>` menu_root **)**
----
.. _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 **)**
----
.. _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 **)**
----
.. _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 **)**
----
.. _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 **)**
----
.. _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|
----
.. _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|
----
.. _class_DisplayServer_method_global_menu_remove_item:
- void **global_menu_remove_item** **(** :ref:`String<class_String>` menu_root, :ref:`int<class_int>` idx **)**
----
.. _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 **)**
----
.. _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 **)**
----
.. _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 **)**
----
.. _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 **)**
----
.. _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 **)**
----
.. _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 **)**
----
.. _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_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_mouse_warp_to_position:
- void **mouse_warp_to_position** **(** :ref:`Vector2i<class_Vector2i>` position **)**
Sets the mouse cursor position to the given ``position``.
----
.. _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 ``\ 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_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_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=Rect2i(0, 0, 0, 0), :ref:`bool<class_bool>` multiline=false, :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.
\ ``multiline`` parameter needs to be set to ``true`` to be able to enter multiple lines of text, as in :ref:`TextEdit<class_TextEdit>`.
\ ``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 UWP.
----
.. _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_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_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_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 VSync mode of the given window.
----
.. _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_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 fullscreen 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_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 **)**
----
.. _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 VSync 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_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.)`