Returns active keyboard layout index.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
Returns the number of keyboard layouts.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
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.
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.
Sets active keyboard layout.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
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.
Return the greatest scale factor of all screens.
[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.
Return the scale factor of the specified screen by index.
[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.
Returns current active tablet driver name.
[b]Note:[/b] This method is implemented on Windows.
Returns the total number of available tablet drivers.
[b]Note:[/b] This method is implemented on Windows.
Returns the tablet driver name for the given index.
[b]Note:[/b] This method is implemented on Windows.
Set active tablet driver name.
[b]Note:[/b] This method is implemented on Windows.
Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
Hides the virtual keyboard if it is shown, does nothing otherwise.
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.
Returns the VSync mode of the given window.
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.
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).
[codeblocks]
[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([])
[/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]
[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.
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.
Makes the mouse cursor visible if it is hidden.
Makes the mouse cursor hidden if it is visible.
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].
Confines the mouse cursor to the game window, and make it visible.
Confines the mouse cursor to the game window, and make it hidden.
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.
Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/latest/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling fullscreen mode.
No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible).
Default vertical synchronization mode, the image is displayed only on vertical blanking intervals (no tearing is visible).
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.
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.