Work in progress
Godot documentation is being updated to reflect the latest changes in version
4.0
. Some documentation pages may
still state outdated information. This banner will tell you if you're reading one of such pages.
The contents of this page are up to date. If you can still find outdated information, please open an issue.
DisplayServerΒΆ
Inherits: Object
Singleton for window management functions.
DescriptionΒΆ
DisplayServer handles everything related to window management. This is separated from OS as a single operating system may support multiple display servers.
Headless mode: Starting the engine with the --headless
command line argument disables all rendering and window management functions. Most functions from DisplayServer will return dummy values in this case.
MethodsΒΆ
EnumerationsΒΆ
enum Feature:
Display server supports global menu. This allows the application to display its menu items in the operating system's top bar. macOS
Feature FEATURE_SUBWINDOWS = 1
Display server supports multiple windows that can be moved outside of the main window. Windows, macOS, Linux (X11)
Feature FEATURE_TOUCHSCREEN = 2
Display server supports touchscreen input. Windows, Linux (X11), Android, iOS, Web
Feature FEATURE_MOUSE = 3
Display server supports mouse input. Windows, macOS, Linux (X11), Android, Web
Feature FEATURE_MOUSE_WARP = 4
Display server supports warping mouse coordinates to keep the mouse cursor constrained within an area, but looping when one of the edges is reached. Windows, macOS, Linux (X11)
Feature FEATURE_CLIPBOARD = 5
Display server supports setting and getting clipboard data. See also FEATURE_CLIPBOARD_PRIMARY. Windows, macOS, Linux (X11), Android, iOS, Web
Feature FEATURE_VIRTUAL_KEYBOARD = 6
Display server supports popping up a virtual keyboard when requested to input text without a physical keyboard. Android, iOS, Web
Feature FEATURE_CURSOR_SHAPE = 7
Display server supports setting the mouse cursor shape to be different from the default. Windows, macOS, Linux (X11), Android, Web
Feature FEATURE_CUSTOM_CURSOR_SHAPE = 8
Display server supports setting the mouse cursor shape to a custom image. Windows, macOS, Linux (X11), Web
Feature FEATURE_NATIVE_DIALOG = 9
Display server supports spawning dialogs using the operating system's native look-and-feel. macOS
Feature FEATURE_IME = 10
Display server supports Input Method Editor, which is commonly used for inputting Chinese/Japanese/Korean text. This is handled by the operating system, rather than by Godot. Windows, macOS, Linux (X11)
Feature FEATURE_WINDOW_TRANSPARENCY = 11
Display server supports windows can use per-pixel transparency to make windows behind them partially or fully visible. Windows, macOS, Linux (X11)
Feature FEATURE_HIDPI = 12
Display server supports querying the operating system's display scale factor. This allows for reliable automatic hiDPI display detection, as opposed to guessing based on the screen resolution and reported display DPI (which can be unreliable due to broken monitor EDID). Windows, macOS
Feature FEATURE_ICON = 13
Display server supports changing the window icon (usually displayed in the top-left corner). Windows, macOS, Linux (X11)
Feature FEATURE_NATIVE_ICON = 14
Display server supports changing the window icon (usually displayed in the top-left corner). Windows, macOS
Feature FEATURE_ORIENTATION = 15
Display server supports changing the screen orientation. Android, iOS