: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//doc_classes. .. _class_DisplayServer: DisplayServer ============= **Inherits:** :ref:`Object` Methods ------- +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`clipboard_get` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`clipboard_get_primary` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`clipboard_has` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clipboard_set` **(** :ref:`String` clipboard **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clipboard_set_primary` **(** :ref:`String` clipboard_primary **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`create_sub_window` **(** :ref:`WindowMode` mode, :ref:`VSyncMode` vsync_mode, :ref:`int` flags, :ref:`Rect2i` rect=Rect2i(0, 0, 0, 0) **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`CursorShape` | :ref:`cursor_get_shape` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cursor_set_custom_image` **(** :ref:`Resource` cursor, :ref:`CursorShape` shape=0, :ref:`Vector2` hotspot=Vector2(0, 0) **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`cursor_set_shape` **(** :ref:`CursorShape` shape **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`delete_sub_window` **(** :ref:`int` window_id **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`dialog_input_text` **(** :ref:`String` title, :ref:`String` description, :ref:`String` existing_text, :ref:`Callable` callback **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`dialog_show` **(** :ref:`String` title, :ref:`String` description, :ref:`PackedStringArray` buttons, :ref:`Callable` callback **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`enable_for_stealing_focus` **(** :ref:`int` process_id **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`force_process_and_drop_events` **(** **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_name` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_screen_count` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_swap_cancel_ok` **(** **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_window_at_screen_position` **(** :ref:`Vector2i` position **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedInt32Array` | :ref:`get_window_list` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_add_check_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`Callable` callback, :ref:`Variant` tag=null **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_add_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`Callable` callback, :ref:`Variant` tag=null **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_add_separator` **(** :ref:`String` menu_root **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_add_submenu_item` **(** :ref:`String` menu_root, :ref:`String` label, :ref:`String` submenu **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_clear` **(** :ref:`String` menu_root **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Callable` | :ref:`global_menu_get_item_callback` **(** :ref:`String` menu_root, :ref:`int` idx **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`global_menu_get_item_submenu` **(** :ref:`String` menu_root, :ref:`int` idx **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`global_menu_get_item_tag` **(** :ref:`String` menu_root, :ref:`int` idx **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`global_menu_get_item_text` **(** :ref:`String` menu_root, :ref:`int` idx **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`global_menu_is_item_checkable` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`global_menu_is_item_checked` **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_remove_item` **(** :ref:`String` menu_root, :ref:`int` idx **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_set_item_callback` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Callable` callback **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_set_item_checkable` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` checkable **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_set_item_checked` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` checked **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_set_item_submenu` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`String` submenu **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_set_item_tag` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Variant` tag **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`global_menu_set_item_text` **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`String` text **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_feature` **(** :ref:`Feature` feature **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`ime_get_selection` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`ime_get_text` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`keyboard_get_current_layout` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Key` | :ref:`keyboard_get_keycode_from_physical` **(** :ref:`Key` keycode **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`keyboard_get_layout_count` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`keyboard_get_layout_language` **(** :ref:`int` index **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`keyboard_get_layout_name` **(** :ref:`int` index **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`keyboard_set_current_layout` **(** :ref:`int` index **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`MouseButton` | :ref:`mouse_get_button_state` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`MouseMode` | :ref:`mouse_get_mode` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`mouse_get_position` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`mouse_set_mode` **(** :ref:`MouseMode` mouse_mode **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`mouse_warp_to_position` **(** :ref:`Vector2i` position **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`process_events` **(** **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`screen_get_dpi` **(** :ref:`int` screen=-1 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`screen_get_max_scale` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ScreenOrientation` | :ref:`screen_get_orientation` **(** :ref:`int` screen=-1 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`screen_get_position` **(** :ref:`int` screen=-1 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`screen_get_refresh_rate` **(** :ref:`int` screen=-1 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`screen_get_scale` **(** :ref:`int` screen=-1 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`screen_get_size` **(** :ref:`int` screen=-1 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2i` | :ref:`screen_get_usable_rect` **(** :ref:`int` screen=-1 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`screen_is_kept_on` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`screen_is_touchscreen` **(** :ref:`int` screen=-1 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`screen_set_keep_on` **(** :ref:`bool` enable **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`screen_set_orientation` **(** :ref:`ScreenOrientation` orientation, :ref:`int` screen=-1 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_icon` **(** :ref:`Image` image **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_native_icon` **(** :ref:`String` filename **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`tablet_get_current_driver` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`tablet_get_driver_count` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`tablet_get_driver_name` **(** :ref:`int` idx **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tablet_set_current_driver` **(** :ref:`String` name **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`virtual_keyboard_get_height` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`virtual_keyboard_hide` **(** **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`virtual_keyboard_show` **(** :ref:`String` existing_text, :ref:`Rect2` position=Rect2(0, 0, 0, 0), :ref:`bool` multiline=false, :ref:`int` max_length=-1, :ref:`int` cursor_start=-1, :ref:`int` cursor_end=-1 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_attach_instance_id` **(** :ref:`int` instance_id, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`window_can_draw` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`window_get_active_popup` **(** **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`window_get_attached_instance_id` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`window_get_current_screen` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`window_get_flag` **(** :ref:`WindowFlags` flag, :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`window_get_max_size` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`window_get_min_size` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`WindowMode` | :ref:`window_get_mode` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`window_get_native_handle` **(** :ref:`HandleType` handle_type, :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2i` | :ref:`window_get_popup_safe_rect` **(** :ref:`int` window **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`window_get_position` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`window_get_real_size` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`window_get_size` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`VSyncMode` | :ref:`window_get_vsync_mode` **(** :ref:`int` window_id=0 **)** |const| | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_move_to_foreground` **(** :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_request_attention` **(** :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_current_screen` **(** :ref:`int` screen, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_drop_files_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_exclusive` **(** :ref:`int` window_id, :ref:`bool` exclusive **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_flag` **(** :ref:`WindowFlags` flag, :ref:`bool` enabled, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_ime_active` **(** :ref:`bool` active, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_ime_position` **(** :ref:`Vector2i` position, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_input_event_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_input_text_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_max_size` **(** :ref:`Vector2i` max_size, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_min_size` **(** :ref:`Vector2i` min_size, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_mode` **(** :ref:`WindowMode` mode, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_mouse_passthrough` **(** :ref:`PackedVector2Array` region, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_popup_safe_rect` **(** :ref:`int` window, :ref:`Rect2i` rect **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_position` **(** :ref:`Vector2i` position, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_rect_changed_callback` **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_size` **(** :ref:`Vector2i` size, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_title` **(** :ref:`String` title, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_transient` **(** :ref:`int` window_id, :ref:`int` parent_window_id **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_vsync_mode` **(** :ref:`VSyncMode` vsync_mode, :ref:`int` window_id=0 **)** | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`window_set_window_event_callback` **(** :ref:`Callable` callback, :ref:`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`. - **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: .. _class_DisplayServer_constant_WINDOW_MODE_EXCLUSIVE_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. - **WINDOW_MODE_EXCLUSIVE_FULLSCREEN** = **4** --- Exclusive fullscreen window mode. This mode is implemented on Windows only. On other platforms, it is equivalent to :ref:`WINDOW_MODE_FULLSCREEN`. Only one window in exclusive fullscreen mode can be visible on a given screen at a time. If multiple windows are in exclusive fullscreen mode for the same screen, the last one being set to this mode takes precedence. 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_POPUP: .. _class_DisplayServer_constant_WINDOW_FLAG_MAX: enum **WindowFlags**: - **WINDOW_FLAG_RESIZE_DISABLED** = **0** --- Window can't be resizing by dragging its resize grip. It's still possible to resize the window using :ref:`window_set_size`. This flag is ignored for full screen windows. - **WINDOW_FLAG_BORDERLESS** = **1** --- Window do not have native title bar and other decorations. This flag is ignored for full-screen windows. - **WINDOW_FLAG_ALWAYS_ON_TOP** = **2** --- Window is floating above other regular windows. This flag is ignored for full-screen windows. - **WINDOW_FLAG_TRANSPARENT** = **3** --- Window is will be destroyed with its transient parent and displayed on top of non-exclusive full-screen parent window. Transient windows can't enter full-screen mode. - **WINDOW_FLAG_NO_FOCUS** = **4** --- Window can't be focused. No-focus window will ignore all input, except mouse clicks. - **WINDOW_FLAG_POPUP** = **5** --- Window is part of menu or :ref:`OptionButton` dropdown. This flag can't be changed when window is visible. An active popup window will exclusivly receive all input, without stealing focus from its parent. Popup windows are automatically closed when uses click outside it, or when an application is switched. Popup window must have :ref:`WINDOW_FLAG_TRANSPARENT` set. - **WINDOW_FLAG_MAX** = **6** ---- .. _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` 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` **clipboard_get** **(** **)** |const| Returns the user's clipboard as a string if possible. ---- .. _class_DisplayServer_method_clipboard_get_primary: - :ref:`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` **clipboard_has** **(** **)** |const| Returns ``true`` if there is content on the user's clipboard. ---- .. _class_DisplayServer_method_clipboard_set: - void **clipboard_set** **(** :ref:`String` clipboard **)** Sets the user's clipboard content to the given string. ---- .. _class_DisplayServer_method_clipboard_set_primary: - void **clipboard_set_primary** **(** :ref:`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` **create_sub_window** **(** :ref:`WindowMode` mode, :ref:`VSyncMode` vsync_mode, :ref:`int` flags, :ref:`Rect2i` rect=Rect2i(0, 0, 0, 0) **)** ---- .. _class_DisplayServer_method_cursor_get_shape: - :ref:`CursorShape` **cursor_get_shape** **(** **)** |const| ---- .. _class_DisplayServer_method_cursor_set_custom_image: - void **cursor_set_custom_image** **(** :ref:`Resource` cursor, :ref:`CursorShape` shape=0, :ref:`Vector2` hotspot=Vector2(0, 0) **)** ---- .. _class_DisplayServer_method_cursor_set_shape: - void **cursor_set_shape** **(** :ref:`CursorShape` shape **)** ---- .. _class_DisplayServer_method_delete_sub_window: - void **delete_sub_window** **(** :ref:`int` window_id **)** ---- .. _class_DisplayServer_method_dialog_input_text: - :ref:`Error` **dialog_input_text** **(** :ref:`String` title, :ref:`String` description, :ref:`String` existing_text, :ref:`Callable` callback **)** ---- .. _class_DisplayServer_method_dialog_show: - :ref:`Error` **dialog_show** **(** :ref:`String` title, :ref:`String` description, :ref:`PackedStringArray` buttons, :ref:`Callable` callback **)** ---- .. _class_DisplayServer_method_enable_for_stealing_focus: - void **enable_for_stealing_focus** **(** :ref:`int` process_id **)** ---- .. _class_DisplayServer_method_force_process_and_drop_events: - void **force_process_and_drop_events** **(** **)** ---- .. _class_DisplayServer_method_get_name: - :ref:`String` **get_name** **(** **)** |const| ---- .. _class_DisplayServer_method_get_screen_count: - :ref:`int` **get_screen_count** **(** **)** |const| ---- .. _class_DisplayServer_method_get_swap_cancel_ok: - :ref:`bool` **get_swap_cancel_ok** **(** **)** ---- .. _class_DisplayServer_method_get_window_at_screen_position: - :ref:`int` **get_window_at_screen_position** **(** :ref:`Vector2i` position **)** |const| ---- .. _class_DisplayServer_method_get_window_list: - :ref:`PackedInt32Array` **get_window_list** **(** **)** |const| ---- .. _class_DisplayServer_method_global_menu_add_check_item: - void **global_menu_add_check_item** **(** :ref:`String` menu_root, :ref:`String` label, :ref:`Callable` callback, :ref:`Variant` tag=null **)** ---- .. _class_DisplayServer_method_global_menu_add_item: - void **global_menu_add_item** **(** :ref:`String` menu_root, :ref:`String` label, :ref:`Callable` callback, :ref:`Variant` tag=null **)** ---- .. _class_DisplayServer_method_global_menu_add_separator: - void **global_menu_add_separator** **(** :ref:`String` menu_root **)** ---- .. _class_DisplayServer_method_global_menu_add_submenu_item: - void **global_menu_add_submenu_item** **(** :ref:`String` menu_root, :ref:`String` label, :ref:`String` submenu **)** ---- .. _class_DisplayServer_method_global_menu_clear: - void **global_menu_clear** **(** :ref:`String` menu_root **)** ---- .. _class_DisplayServer_method_global_menu_get_item_callback: - :ref:`Callable` **global_menu_get_item_callback** **(** :ref:`String` menu_root, :ref:`int` idx **)** ---- .. _class_DisplayServer_method_global_menu_get_item_submenu: - :ref:`String` **global_menu_get_item_submenu** **(** :ref:`String` menu_root, :ref:`int` idx **)** ---- .. _class_DisplayServer_method_global_menu_get_item_tag: - :ref:`Variant` **global_menu_get_item_tag** **(** :ref:`String` menu_root, :ref:`int` idx **)** ---- .. _class_DisplayServer_method_global_menu_get_item_text: - :ref:`String` **global_menu_get_item_text** **(** :ref:`String` menu_root, :ref:`int` idx **)** ---- .. _class_DisplayServer_method_global_menu_is_item_checkable: - :ref:`bool` **global_menu_is_item_checkable** **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| ---- .. _class_DisplayServer_method_global_menu_is_item_checked: - :ref:`bool` **global_menu_is_item_checked** **(** :ref:`String` menu_root, :ref:`int` idx **)** |const| ---- .. _class_DisplayServer_method_global_menu_remove_item: - void **global_menu_remove_item** **(** :ref:`String` menu_root, :ref:`int` idx **)** ---- .. _class_DisplayServer_method_global_menu_set_item_callback: - void **global_menu_set_item_callback** **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Callable` callback **)** ---- .. _class_DisplayServer_method_global_menu_set_item_checkable: - void **global_menu_set_item_checkable** **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` checkable **)** ---- .. _class_DisplayServer_method_global_menu_set_item_checked: - void **global_menu_set_item_checked** **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`bool` checked **)** ---- .. _class_DisplayServer_method_global_menu_set_item_submenu: - void **global_menu_set_item_submenu** **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`String` submenu **)** ---- .. _class_DisplayServer_method_global_menu_set_item_tag: - void **global_menu_set_item_tag** **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`Variant` tag **)** ---- .. _class_DisplayServer_method_global_menu_set_item_text: - void **global_menu_set_item_text** **(** :ref:`String` menu_root, :ref:`int` idx, :ref:`String` text **)** ---- .. _class_DisplayServer_method_has_feature: - :ref:`bool` **has_feature** **(** :ref:`Feature` feature **)** |const| ---- .. _class_DisplayServer_method_ime_get_selection: - :ref:`Vector2i` **ime_get_selection** **(** **)** |const| ---- .. _class_DisplayServer_method_ime_get_text: - :ref:`String` **ime_get_text** **(** **)** |const| ---- .. _class_DisplayServer_method_keyboard_get_current_layout: - :ref:`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` **keyboard_get_keycode_from_physical** **(** :ref:`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` **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` **keyboard_get_layout_language** **(** :ref:`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` **keyboard_get_layout_name** **(** :ref:`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` index **)** Sets active keyboard layout. \ **Note:** This method is implemented on Linux, macOS and Windows. ---- .. _class_DisplayServer_method_mouse_get_button_state: - :ref:`MouseButton` **mouse_get_button_state** **(** **)** |const| ---- .. _class_DisplayServer_method_mouse_get_mode: - :ref:`MouseMode` **mouse_get_mode** **(** **)** |const| ---- .. _class_DisplayServer_method_mouse_get_position: - :ref:`Vector2i` **mouse_get_position** **(** **)** |const| Returns the mouse cursor's current position. ---- .. _class_DisplayServer_method_mouse_set_mode: - void **mouse_set_mode** **(** :ref:`MouseMode` mouse_mode **)** ---- .. _class_DisplayServer_method_mouse_warp_to_position: - void **mouse_warp_to_position** **(** :ref:`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` **screen_get_dpi** **(** :ref:`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` **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` **screen_get_orientation** **(** :ref:`int` screen=-1 **)** |const| ---- .. _class_DisplayServer_method_screen_get_position: - :ref:`Vector2i` **screen_get_position** **(** :ref:`int` screen=-1 **)** |const| ---- .. _class_DisplayServer_method_screen_get_refresh_rate: - :ref:`float` **screen_get_refresh_rate** **(** :ref:`int` screen=-1 **)** |const| Returns the current refresh rate of the specified screen. If ``screen`` is :ref:`SCREEN_OF_MAIN_WINDOW` (the default value), a screen with the main window will be used. \ **Note:** Returns ``-1.0`` if the DisplayServer fails to find the refresh rate for the specified screen. On HTML5, :ref:`screen_get_refresh_rate` will always return ``-1.0`` as there is no way to retrieve the refresh rate on that platform. To fallback to a default refresh rate if the method fails, try: :: var refresh_rate = DisplayServer.screen_get_refresh_rate() if refresh_rate < 0: refresh_rate = 60.0 ---- .. _class_DisplayServer_method_screen_get_scale: - :ref:`float` **screen_get_scale** **(** :ref:`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` **screen_get_size** **(** :ref:`int` screen=-1 **)** |const| ---- .. _class_DisplayServer_method_screen_get_usable_rect: - :ref:`Rect2i` **screen_get_usable_rect** **(** :ref:`int` screen=-1 **)** |const| ---- .. _class_DisplayServer_method_screen_is_kept_on: - :ref:`bool` **screen_is_kept_on** **(** **)** |const| ---- .. _class_DisplayServer_method_screen_is_touchscreen: - :ref:`bool` **screen_is_touchscreen** **(** :ref:`int` screen=-1 **)** |const| ---- .. _class_DisplayServer_method_screen_set_keep_on: - void **screen_set_keep_on** **(** :ref:`bool` enable **)** ---- .. _class_DisplayServer_method_screen_set_orientation: - void **screen_set_orientation** **(** :ref:`ScreenOrientation` orientation, :ref:`int` screen=-1 **)** ---- .. _class_DisplayServer_method_set_icon: - void **set_icon** **(** :ref:`Image` image **)** ---- .. _class_DisplayServer_method_set_native_icon: - void **set_native_icon** **(** :ref:`String` filename **)** ---- .. _class_DisplayServer_method_tablet_get_current_driver: - :ref:`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` **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` **tablet_get_driver_name** **(** :ref:`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` name **)** Set active tablet driver name. \ **Note:** This method is implemented on Windows. ---- .. _class_DisplayServer_method_virtual_keyboard_get_height: - :ref:`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` existing_text, :ref:`Rect2` position=Rect2(0, 0, 0, 0), :ref:`bool` multiline=false, :ref:`int` max_length=-1, :ref:`int` cursor_start=-1, :ref:`int` cursor_end=-1 **)** Shows the virtual keyboard if the platform has one. \ ``existing_text`` parameter is useful for implementing your own :ref:`LineEdit` or :ref:`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` 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`. \ ``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` instance_id, :ref:`int` window_id=0 **)** ---- .. _class_DisplayServer_method_window_can_draw: - :ref:`bool` **window_can_draw** **(** :ref:`int` window_id=0 **)** |const| ---- .. _class_DisplayServer_method_window_get_active_popup: - :ref:`int` **window_get_active_popup** **(** **)** |const| Returns ID of the active popup window, or :ref:`INVALID_WINDOW_ID` if there is none. ---- .. _class_DisplayServer_method_window_get_attached_instance_id: - :ref:`int` **window_get_attached_instance_id** **(** :ref:`int` window_id=0 **)** |const| ---- .. _class_DisplayServer_method_window_get_current_screen: - :ref:`int` **window_get_current_screen** **(** :ref:`int` window_id=0 **)** |const| ---- .. _class_DisplayServer_method_window_get_flag: - :ref:`bool` **window_get_flag** **(** :ref:`WindowFlags` flag, :ref:`int` window_id=0 **)** |const| Returns the current value of the given window's ``flag``. ---- .. _class_DisplayServer_method_window_get_max_size: - :ref:`Vector2i` **window_get_max_size** **(** :ref:`int` window_id=0 **)** |const| ---- .. _class_DisplayServer_method_window_get_min_size: - :ref:`Vector2i` **window_get_min_size** **(** :ref:`int` window_id=0 **)** |const| ---- .. _class_DisplayServer_method_window_get_mode: - :ref:`WindowMode` **window_get_mode** **(** :ref:`int` window_id=0 **)** |const| Returns the mode of the given window. ---- .. _class_DisplayServer_method_window_get_native_handle: - :ref:`int` **window_get_native_handle** **(** :ref:`HandleType` handle_type, :ref:`int` window_id=0 **)** |const| Returns internal structure pointers for use in plugins. \ **Note:** This method is implemented on Android, Linux, macOS and Windows. ---- .. _class_DisplayServer_method_window_get_popup_safe_rect: - :ref:`Rect2i` **window_get_popup_safe_rect** **(** :ref:`int` window **)** |const| Returns the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system. ---- .. _class_DisplayServer_method_window_get_position: - :ref:`Vector2i` **window_get_position** **(** :ref:`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` **window_get_real_size** **(** :ref:`int` window_id=0 **)** |const| ---- .. _class_DisplayServer_method_window_get_size: - :ref:`Vector2i` **window_get_size** **(** :ref:`int` window_id=0 **)** |const| ---- .. _class_DisplayServer_method_window_get_vsync_mode: - :ref:`VSyncMode` **window_get_vsync_mode** **(** :ref:`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` window_id=0 **)** ---- .. _class_DisplayServer_method_window_request_attention: - void **window_request_attention** **(** :ref:`int` window_id=0 **)** ---- .. _class_DisplayServer_method_window_set_current_screen: - void **window_set_current_screen** **(** :ref:`int` screen, :ref:`int` window_id=0 **)** ---- .. _class_DisplayServer_method_window_set_drop_files_callback: - void **window_set_drop_files_callback** **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** ---- .. _class_DisplayServer_method_window_set_exclusive: - void **window_set_exclusive** **(** :ref:`int` window_id, :ref:`bool` exclusive **)** If set to ``true``, this window will always stay on top of its parent window, parent window will ignore input while this window is opened. \ **Note:** On macOS, exclusive windows are confined to the same space (virtual desktop or screen) as the parent window. \ **Note:** This method is implemented on macOS and Windows. ---- .. _class_DisplayServer_method_window_set_flag: - void **window_set_flag** **(** :ref:`WindowFlags` flag, :ref:`bool` enabled, :ref:`int` window_id=0 **)** Enables or disables the given window's given ``flag``. See :ref:`WindowFlags` for possible values and their behavior. ---- .. _class_DisplayServer_method_window_set_ime_active: - void **window_set_ime_active** **(** :ref:`bool` active, :ref:`int` window_id=0 **)** ---- .. _class_DisplayServer_method_window_set_ime_position: - void **window_set_ime_position** **(** :ref:`Vector2i` position, :ref:`int` window_id=0 **)** ---- .. _class_DisplayServer_method_window_set_input_event_callback: - void **window_set_input_event_callback** **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** ---- .. _class_DisplayServer_method_window_set_input_text_callback: - void **window_set_input_text_callback** **(** :ref:`Callable` callback, :ref:`int` window_id=0 **)** ---- .. _class_DisplayServer_method_window_set_max_size: - void **window_set_max_size** **(** :ref:`Vector2i` max_size, :ref:`int` window_id=0 **)** ---- .. _class_DisplayServer_method_window_set_min_size: - void **window_set_min_size** **(** :ref:`Vector2i` min_size, :ref:`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` mode, :ref:`int` window_id=0 **)** Sets window mode for the given window to ``mode``. See :ref:`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` region, :ref:`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").Curve.GetBakedPoints()); // Set region, using Polygon2D node. DisplayServer.WindowSetMousePassthrough(GetNode("Polygon2D").Polygon); // Reset region to default. DisplayServer.WindowSetMousePassthrough(new Vector2[] {}); \ **Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is. \ **Note:** This method is implemented on Linux, macOS and Windows. ---- .. _class_DisplayServer_method_window_set_popup_safe_rect: - void **window_set_popup_safe_rect** **(** :ref:`int` window, :ref:`Rect2i` rect **)** Sets the bounding box of control, or menu item that was used to open the popup window, in the screen coordinate system. Clicking this area will not auto-close this popup. ---- .. _class_DisplayServer_method_window_set_position: - void **window_set_position** **(** :ref:`Vector2i` position, :ref:`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` callback, :ref:`int` window_id=0 **)** ---- .. _class_DisplayServer_method_window_set_size: - void **window_set_size** **(** :ref:`Vector2i` size, :ref:`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` title, :ref:`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` window_id, :ref:`int` parent_window_id **)** ---- .. _class_DisplayServer_method_window_set_vsync_mode: - void **window_set_vsync_mode** **(** :ref:`VSyncMode` vsync_mode, :ref:`int` window_id=0 **)** Sets the VSync mode of the given window. See :ref:`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`, if the desired mode is not supported. ---- .. _class_DisplayServer_method_window_set_window_event_callback: - void **window_set_window_event_callback** **(** :ref:`Callable` callback, :ref:`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.)`