2020-03-31 11:56:58 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name= "DisplayServer" inherits= "Object" version= "4.0" >
<brief_description >
</brief_description>
<description >
</description>
<tutorials >
</tutorials>
<methods >
<method name= "clipboard_get" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-06 22:52:52 +02:00
Returns the user's clipboard as a string if possible.
2020-03-31 11:56:58 +02:00
</description>
</method>
2021-10-12 09:43:50 +02:00
<method name= "clipboard_get_primary" qualifiers= "const" >
<return type= "String" />
<description >
Returns the user's primary clipboard as a string if possible.
[b]Note:[/b] This method is only implemented on Linux.
</description>
</method>
2020-03-31 11:56:58 +02:00
<method name= "clipboard_set" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "clipboard" type= "String" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-06 22:52:52 +02:00
Sets the user's clipboard content to the given string.
2020-03-31 11:56:58 +02:00
</description>
</method>
2021-10-12 09:43:50 +02:00
<method name= "clipboard_set_primary" >
<return type= "void" />
<argument index= "0" name= "clipboard_primary" type= "String" />
<description >
Sets the user's primary clipboard content to the given string.
[b]Note:[/b] This method is only implemented on Linux.
</description>
</method>
2020-03-31 11:56:58 +02:00
<method name= "create_sub_window" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
<argument index= "0" name= "mode" type= "int" enum= "DisplayServer.WindowMode" />
<argument index= "1" name= "vsync_mode" type= "int" enum= "DisplayServer.VSyncMode" />
<argument index= "2" name= "flags" type= "int" />
<argument index= "3" name= "rect" type= "Rect2i" default= "Rect2i(0, 0, 0, 0)" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "cursor_get_shape" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "DisplayServer.CursorShape" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "cursor_set_custom_image" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "cursor" type= "Resource" />
<argument index= "1" name= "shape" type= "int" enum= "DisplayServer.CursorShape" default= "0" />
<argument index= "2" name= "hotspot" type= "Vector2" default= "Vector2(0, 0)" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "cursor_set_shape" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "shape" type= "int" enum= "DisplayServer.CursorShape" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "delete_sub_window" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "window_id" type= "int" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "dialog_input_text" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "Error" />
<argument index= "0" name= "title" type= "String" />
<argument index= "1" name= "description" type= "String" />
<argument index= "2" name= "existing_text" type= "String" />
<argument index= "3" name= "callback" type= "Callable" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "dialog_show" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "Error" />
<argument index= "0" name= "title" type= "String" />
<argument index= "1" name= "description" type= "String" />
<argument index= "2" name= "buttons" type= "PackedStringArray" />
<argument index= "3" name= "callback" type= "Callable" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "enable_for_stealing_focus" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "process_id" type= "int" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "force_process_and_drop_events" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "get_name" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "get_screen_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
2020-07-09 01:02:38 +02:00
<method name= "get_swap_cancel_ok" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "get_window_at_screen_position" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
<argument index= "0" name= "position" type= "Vector2i" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "get_window_list" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "PackedInt32Array" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_add_check_item" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "label" type= "String" />
<argument index= "2" name= "callback" type= "Callable" />
<argument index= "3" name= "tag" type= "Variant" default= "null" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_add_item" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "label" type= "String" />
<argument index= "2" name= "callback" type= "Callable" />
<argument index= "3" name= "tag" type= "Variant" default= "null" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_add_separator" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_add_submenu_item" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "label" type= "String" />
<argument index= "2" name= "submenu" type= "String" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_clear" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_get_item_callback" >
2021-07-30 15:28:05 +02:00
<return type= "Callable" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_get_item_submenu" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_get_item_tag" >
2021-07-30 15:28:05 +02:00
<return type= "Variant" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_get_item_text" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_is_item_checkable" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_is_item_checked" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_remove_item" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_set_item_callback" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
<argument index= "2" name= "callback" type= "Callable" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_set_item_checkable" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
<argument index= "2" name= "checkable" type= "bool" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_set_item_checked" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
<argument index= "2" name= "checked" type= "bool" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_set_item_submenu" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
<argument index= "2" name= "submenu" type= "String" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_set_item_tag" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
<argument index= "2" name= "tag" type= "Variant" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "global_menu_set_item_text" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu_root" type= "String" />
<argument index= "1" name= "idx" type= "int" />
<argument index= "2" name= "text" type= "String" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "has_feature" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "feature" type= "int" enum= "DisplayServer.Feature" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "ime_get_selection" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2i" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "ime_get_text" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
2020-06-11 11:27:07 +02:00
<method name= "keyboard_get_current_layout" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2020-06-11 11:27:07 +02:00
<description >
Returns active keyboard layout index.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
2021-09-17 03:07:59 +02:00
<method name= "keyboard_get_keycode_from_physical" qualifiers= "const" >
<return type= "int" enum= "Key" />
<argument index= "0" name= "keycode" type= "int" enum= "Key" />
<description >
Converts a physical (US QWERTY) [code]keycode[/code] to one in the active keyboard layout.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
2020-06-11 11:27:07 +02:00
<method name= "keyboard_get_layout_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2020-06-11 11:27:07 +02:00
<description >
Returns the number of keyboard layouts.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name= "keyboard_get_layout_language" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "index" type= "int" />
2020-06-11 11:27:07 +02:00
<description >
Returns the ISO-639/BCP-47 language code of the keyboard layout at position [code]index[/code].
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name= "keyboard_get_layout_name" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "index" type= "int" />
2020-06-11 11:27:07 +02:00
<description >
Returns the localized name of the keyboard layout at position [code]index[/code].
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name= "keyboard_set_current_layout" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "index" type= "int" />
2020-06-11 11:27:07 +02:00
<description >
Sets active keyboard layout.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
2020-03-31 11:56:58 +02:00
<method name= "mouse_get_button_state" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "MouseButton" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "mouse_get_mode" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "DisplayServer.MouseMode" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "mouse_get_position" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2i" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-06 22:52:52 +02:00
Returns the mouse cursor's current position.
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "mouse_set_mode" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "mouse_mode" type= "int" enum= "DisplayServer.MouseMode" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "mouse_warp_to_position" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "position" type= "Vector2i" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-06 22:52:52 +02:00
Sets the mouse cursor position to the given [code]position[/code].
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "process_events" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "screen_get_dpi" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
2020-03-31 11:56:58 +02:00
<description >
2020-10-01 21:52:20 +02:00
Returns the dots per inch density of the specified screen. If [code]screen[/code] is [/code]SCREEN_OF_MAIN_WINDOW[/code] (the default value), a screen with the main window will be used.
[b]Note:[/b] On macOS, returned value is inaccurate if fractional display scaling mode is used.
[b]Note:[/b] On Android devices, the actual screen densities are grouped into six generalized densities:
[codeblock]
ldpi - 120 dpi
mdpi - 160 dpi
hdpi - 240 dpi
xhdpi - 320 dpi
xxhdpi - 480 dpi
xxxhdpi - 640 dpi
[/codeblock]
[b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. Returns [code]72[/code] on unsupported platforms.
2020-03-31 11:56:58 +02:00
</description>
</method>
2020-07-03 12:06:03 +02:00
<method name= "screen_get_max_scale" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "float" />
2020-07-03 12:06:03 +02:00
<description >
2022-01-02 18:32:49 +01:00
Returns the greatest scale factor of all screens.
2020-07-03 12:06:03 +02:00
[b]Note:[/b] On macOS returned value is [code]2.0[/code] if there is at least one hiDPI (Retina) screen in the system, and [code]1.0[/code] in all other cases.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
2020-03-31 11:56:58 +02:00
<method name= "screen_get_orientation" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "DisplayServer.ScreenOrientation" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "screen_get_position" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2i" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "screen_get_scale" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "float" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
2020-03-31 11:56:58 +02:00
<description >
2022-01-02 18:32:49 +01:00
Returns the scale factor of the specified screen by index.
2020-07-03 12:06:03 +02:00
[b]Note:[/b] On macOS returned value is [code]2.0[/code] for hiDPI (Retina) screen, and [code]1.0[/code] for all other cases.
[b]Note:[/b] This method is implemented on macOS.
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "screen_get_size" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2i" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "screen_get_usable_rect" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Rect2i" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "screen_is_kept_on" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "screen_is_touchscreen" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "screen_set_keep_on" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "enable" type= "bool" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "screen_set_orientation" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "orientation" type= "int" enum= "DisplayServer.ScreenOrientation" />
<argument index= "1" name= "screen" type= "int" default= "-1" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "set_icon" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "image" type= "Image" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "set_native_icon" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "filename" type= "String" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
2021-02-17 15:07:56 +01:00
<method name= "tablet_get_current_driver" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2021-02-17 15:07:56 +01:00
<description >
Returns current active tablet driver name.
[b]Note:[/b] This method is implemented on Windows.
</description>
</method>
<method name= "tablet_get_driver_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2021-02-17 15:07:56 +01:00
<description >
Returns the total number of available tablet drivers.
[b]Note:[/b] This method is implemented on Windows.
</description>
</method>
<method name= "tablet_get_driver_name" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "idx" type= "int" />
2021-02-17 15:07:56 +01:00
<description >
Returns the tablet driver name for the given index.
[b]Note:[/b] This method is implemented on Windows.
</description>
</method>
<method name= "tablet_set_current_driver" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "name" type= "String" />
2021-02-17 15:07:56 +01:00
<description >
Set active tablet driver name.
[b]Note:[/b] This method is implemented on Windows.
</description>
</method>
2020-03-31 11:56:58 +02:00
<method name= "virtual_keyboard_get_height" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2020-03-31 11:56:58 +02:00
<description >
2020-07-17 17:44:13 +02:00
Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "virtual_keyboard_hide" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2020-03-31 11:56:58 +02:00
<description >
2020-07-17 17:44:13 +02:00
Hides the virtual keyboard if it is shown, does nothing otherwise.
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "virtual_keyboard_show" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "existing_text" type= "String" />
<argument index= "1" name= "position" type= "Rect2" default= "Rect2i(0, 0, 0, 0)" />
<argument index= "2" name= "multiline" type= "bool" default= "false" />
<argument index= "3" name= "max_length" type= "int" default= "-1" />
<argument index= "4" name= "cursor_start" type= "int" default= "-1" />
<argument index= "5" name= "cursor_end" type= "int" default= "-1" />
2020-03-31 11:56:58 +02:00
<description >
2020-07-17 17:44:13 +02:00
Shows the virtual keyboard if the platform has one.
[code]existing_text[/code] parameter is useful for implementing your own [LineEdit] or [TextEdit], as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).
[code]position[/code] parameter is the screen space [Rect2] of the edited text.
[code]multiline[/code] parameter needs to be set to [code]true[/code] to be able to enter multiple lines of text, as in [TextEdit].
[code]max_length[/code] limits the number of characters that can be entered if different from [code]-1[/code].
[code]cursor_start[/code] can optionally define the current text cursor position if [code]cursor_end[/code] is not set.
[code]cursor_start[/code] and [code]cursor_end[/code] can optionally define the current text selection.
[b]Note:[/b] This method is implemented on Android, iOS and UWP.
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "window_attach_instance_id" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "instance_id" type= "int" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_can_draw" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_get_attached_instance_id" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_get_current_screen" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_get_flag" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "flag" type= "int" enum= "DisplayServer.WindowFlags" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-06 22:52:52 +02:00
Returns the current value of the given window's [code]flag[/code].
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "window_get_max_size" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2i" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_get_min_size" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2i" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_get_mode" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "DisplayServer.WindowMode" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-06 22:52:52 +02:00
Returns the mode of the given window.
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "window_get_position" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2i" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-06 22:52:52 +02:00
Returns the position of the given window to on the screen.
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "window_get_real_size" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2i" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_get_size" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2i" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
2021-06-19 17:44:59 +02:00
<method name= "window_get_vsync_mode" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "DisplayServer.VSyncMode" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2021-06-19 17:44:59 +02:00
<description >
Returns the VSync mode of the given window.
</description>
</method>
2020-03-31 11:56:58 +02:00
<method name= "window_move_to_foreground" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_request_attention" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_set_current_screen" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "screen" type= "int" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_set_drop_files_callback" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "callback" type= "Callable" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_set_flag" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "flag" type= "int" enum= "DisplayServer.WindowFlags" />
<argument index= "1" name= "enabled" type= "bool" />
<argument index= "2" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-06 22:52:52 +02:00
Enables or disables the given window's given [code]flag[/code]. See [enum WindowFlags] for possible values and their behavior.
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "window_set_ime_active" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "active" type= "bool" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_set_ime_position" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "position" type= "Vector2i" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_set_input_event_callback" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "callback" type= "Callable" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_set_input_text_callback" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "callback" type= "Callable" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_set_max_size" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "max_size" type= "Vector2i" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_set_min_size" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "min_size" type= "Vector2i" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
2020-03-23 22:09:22 +01:00
Sets the minimum size for the given window to [code]min_size[/code] (in pixels).
[b]Note:[/b] By default, the main window has a minimum size of [code]Vector2i(64, 64)[/code]. This prevents issues that can arise when the window is resized to a near-zero size.
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "window_set_mode" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "mode" type= "int" enum= "DisplayServer.WindowMode" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-05 01:23:54 +02:00
Sets window mode for the given window to [code]mode[/code]. See [enum WindowMode] for possible values and how each mode behaves.
[b]Note:[/b] Setting the window to fullscreen forcibly sets the borderless flag to [code]true[/code], so make sure to set it back to [code]false[/code] when not wanted.
2020-03-31 11:56:58 +02:00
</description>
</method>
2020-06-29 11:31:36 +02:00
<method name= "window_set_mouse_passthrough" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "region" type= "PackedVector2Array" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-06-29 11:31:36 +02:00
<description >
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).
2020-09-13 14:45:36 +02:00
[codeblocks]
[gdscript]
2020-06-29 11:31:36 +02:00
# 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([])
2020-09-13 14:45:36 +02:00
[/gdscript]
[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[] {});
[/csharp]
[/codeblocks]
2020-06-29 11:31:36 +02:00
[b]Note:[/b] On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
2020-03-31 11:56:58 +02:00
<method name= "window_set_position" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "position" type= "Vector2i" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-06 22:52:52 +02:00
Sets the position of the given window to [code]position[/code].
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "window_set_rect_changed_callback" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "callback" type= "Callable" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
<method name= "window_set_size" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "size" type= "Vector2i" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-06 22:52:52 +02:00
Sets the size of the given window to [code]size[/code].
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "window_set_title" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "title" type= "String" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
2021-10-06 22:52:52 +02:00
Sets the title of the given window to [code]title[/code].
2020-03-31 11:56:58 +02:00
</description>
</method>
<method name= "window_set_transient" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "window_id" type= "int" />
<argument index= "1" name= "parent_window_id" type= "int" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
2021-06-19 17:44:59 +02:00
<method name= "window_set_vsync_mode" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "vsync_mode" type= "int" enum= "DisplayServer.VSyncMode" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2021-06-19 17:44:59 +02:00
<description >
Sets the VSync mode of the given window.
See [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 [constant VSYNC_ENABLED], if the desired mode is not supported.
</description>
</method>
2020-03-31 11:56:58 +02:00
<method name= "window_set_window_event_callback" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "callback" type= "Callable" />
<argument index= "1" name= "window_id" type= "int" default= "0" />
2020-03-31 11:56:58 +02:00
<description >
</description>
</method>
</methods>
<constants >
<constant name= "FEATURE_GLOBAL_MENU" value= "0" enum= "Feature" >
</constant>
<constant name= "FEATURE_SUBWINDOWS" value= "1" enum= "Feature" >
</constant>
<constant name= "FEATURE_TOUCHSCREEN" value= "2" enum= "Feature" >
</constant>
<constant name= "FEATURE_MOUSE" value= "3" enum= "Feature" >
</constant>
<constant name= "FEATURE_MOUSE_WARP" value= "4" enum= "Feature" >
</constant>
<constant name= "FEATURE_CLIPBOARD" value= "5" enum= "Feature" >
</constant>
<constant name= "FEATURE_VIRTUAL_KEYBOARD" value= "6" enum= "Feature" >
</constant>
<constant name= "FEATURE_CURSOR_SHAPE" value= "7" enum= "Feature" >
</constant>
<constant name= "FEATURE_CUSTOM_CURSOR_SHAPE" value= "8" enum= "Feature" >
</constant>
2021-05-07 16:50:19 +02:00
<constant name= "FEATURE_NATIVE_DIALOG" value= "9" enum= "Feature" >
2020-03-31 11:56:58 +02:00
</constant>
2021-12-16 14:00:55 +01:00
<constant name= "FEATURE_IME" value= "10" enum= "Feature" >
2020-03-31 11:56:58 +02:00
</constant>
2021-12-16 14:00:55 +01:00
<constant name= "FEATURE_WINDOW_TRANSPARENCY" value= "11" enum= "Feature" >
2020-03-31 11:56:58 +02:00
</constant>
2021-12-16 14:00:55 +01:00
<constant name= "FEATURE_HIDPI" value= "12" enum= "Feature" >
2020-03-31 11:56:58 +02:00
</constant>
2021-12-16 14:00:55 +01:00
<constant name= "FEATURE_ICON" value= "13" enum= "Feature" >
2020-03-31 11:56:58 +02:00
</constant>
2021-12-16 14:00:55 +01:00
<constant name= "FEATURE_NATIVE_ICON" value= "14" enum= "Feature" >
2020-03-31 11:56:58 +02:00
</constant>
2021-12-16 14:00:55 +01:00
<constant name= "FEATURE_ORIENTATION" value= "15" enum= "Feature" >
2020-03-31 11:56:58 +02:00
</constant>
2021-12-16 14:00:55 +01:00
<constant name= "FEATURE_SWAP_BUFFERS" value= "16" enum= "Feature" >
2020-03-31 11:56:58 +02:00
</constant>
2021-12-16 14:00:55 +01:00
<constant name= "FEATURE_CLIPBOARD_PRIMARY" value= "18" enum= "Feature" >
2021-10-20 21:25:09 +02:00
</constant>
2020-03-31 11:56:58 +02:00
<constant name= "MOUSE_MODE_VISIBLE" value= "0" enum= "MouseMode" >
2021-03-31 00:35:08 +02:00
Makes the mouse cursor visible if it is hidden.
2020-03-31 11:56:58 +02:00
</constant>
<constant name= "MOUSE_MODE_HIDDEN" value= "1" enum= "MouseMode" >
2021-03-31 00:35:08 +02:00
Makes the mouse cursor hidden if it is visible.
2020-03-31 11:56:58 +02:00
</constant>
<constant name= "MOUSE_MODE_CAPTURED" value= "2" enum= "MouseMode" >
2021-03-31 00:35:08 +02:00
Captures the mouse. The mouse will be hidden and its position locked at the center of the screen.
[b]Note:[/b] If you want to process the mouse's movement in this mode, you need to use [member InputEventMouseMotion.relative].
2020-03-31 11:56:58 +02:00
</constant>
<constant name= "MOUSE_MODE_CONFINED" value= "3" enum= "MouseMode" >
2021-03-31 00:35:08 +02:00
Confines the mouse cursor to the game window, and make it visible.
</constant>
<constant name= "MOUSE_MODE_CONFINED_HIDDEN" value= "4" enum= "MouseMode" >
Confines the mouse cursor to the game window, and make it hidden.
2020-03-31 11:56:58 +02:00
</constant>
<constant name= "SCREEN_OF_MAIN_WINDOW" value= "-1" >
</constant>
<constant name= "MAIN_WINDOW_ID" value= "0" >
</constant>
<constant name= "INVALID_WINDOW_ID" value= "-1" >
</constant>
<constant name= "SCREEN_LANDSCAPE" value= "0" enum= "ScreenOrientation" >
</constant>
<constant name= "SCREEN_PORTRAIT" value= "1" enum= "ScreenOrientation" >
</constant>
<constant name= "SCREEN_REVERSE_LANDSCAPE" value= "2" enum= "ScreenOrientation" >
</constant>
<constant name= "SCREEN_REVERSE_PORTRAIT" value= "3" enum= "ScreenOrientation" >
</constant>
<constant name= "SCREEN_SENSOR_LANDSCAPE" value= "4" enum= "ScreenOrientation" >
</constant>
<constant name= "SCREEN_SENSOR_PORTRAIT" value= "5" enum= "ScreenOrientation" >
</constant>
<constant name= "SCREEN_SENSOR" value= "6" enum= "ScreenOrientation" >
</constant>
<constant name= "CURSOR_ARROW" value= "0" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_IBEAM" value= "1" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_POINTING_HAND" value= "2" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_CROSS" value= "3" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_WAIT" value= "4" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_BUSY" value= "5" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_DRAG" value= "6" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_CAN_DROP" value= "7" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_FORBIDDEN" value= "8" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_VSIZE" value= "9" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_HSIZE" value= "10" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_BDIAGSIZE" value= "11" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_FDIAGSIZE" value= "12" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_MOVE" value= "13" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_VSPLIT" value= "14" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_HSPLIT" value= "15" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_HELP" value= "16" enum= "CursorShape" >
</constant>
<constant name= "CURSOR_MAX" value= "17" enum= "CursorShape" >
</constant>
<constant name= "WINDOW_MODE_WINDOWED" value= "0" enum= "WindowMode" >
</constant>
<constant name= "WINDOW_MODE_MINIMIZED" value= "1" enum= "WindowMode" >
</constant>
<constant name= "WINDOW_MODE_MAXIMIZED" value= "2" enum= "WindowMode" >
</constant>
<constant name= "WINDOW_MODE_FULLSCREEN" value= "3" enum= "WindowMode" >
2020-09-03 21:59:40 +02:00
Fullscreen window mode. Note that this is not [i]exclusive[/i] 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.
2021-11-15 10:43:07 +01:00
Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
2020-03-31 11:56:58 +02:00
</constant>
<constant name= "WINDOW_FLAG_RESIZE_DISABLED" value= "0" enum= "WindowFlags" >
</constant>
<constant name= "WINDOW_FLAG_BORDERLESS" value= "1" enum= "WindowFlags" >
</constant>
<constant name= "WINDOW_FLAG_ALWAYS_ON_TOP" value= "2" enum= "WindowFlags" >
</constant>
<constant name= "WINDOW_FLAG_TRANSPARENT" value= "3" enum= "WindowFlags" >
</constant>
<constant name= "WINDOW_FLAG_NO_FOCUS" value= "4" enum= "WindowFlags" >
</constant>
<constant name= "WINDOW_FLAG_MAX" value= "5" enum= "WindowFlags" >
</constant>
<constant name= "WINDOW_EVENT_MOUSE_ENTER" value= "0" enum= "WindowEvent" >
</constant>
<constant name= "WINDOW_EVENT_MOUSE_EXIT" value= "1" enum= "WindowEvent" >
</constant>
<constant name= "WINDOW_EVENT_FOCUS_IN" value= "2" enum= "WindowEvent" >
</constant>
<constant name= "WINDOW_EVENT_FOCUS_OUT" value= "3" enum= "WindowEvent" >
</constant>
<constant name= "WINDOW_EVENT_CLOSE_REQUEST" value= "4" enum= "WindowEvent" >
</constant>
<constant name= "WINDOW_EVENT_GO_BACK_REQUEST" value= "5" enum= "WindowEvent" >
</constant>
<constant name= "WINDOW_EVENT_DPI_CHANGE" value= "6" enum= "WindowEvent" >
</constant>
2021-06-19 17:44:59 +02:00
<constant name= "VSYNC_DISABLED" value= "0" enum= "VSyncMode" >
No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible).
</constant>
<constant name= "VSYNC_ENABLED" value= "1" enum= "VSyncMode" >
Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible).
</constant>
<constant name= "VSYNC_ADAPTIVE" value= "2" enum= "VSyncMode" >
Behaves like [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.
</constant>
<constant name= "VSYNC_MAILBOX" value= "3" enum= "VSyncMode" >
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.
</constant>
2020-03-31 11:56:58 +02:00
</constants>
</class>