OS Properties |
The OS type exposes the following members.
Name | Description | |
---|---|---|
Clipboard | The clipboard from the host OS. Might be unavailable on some platforms. | |
CurrentScreen | The current screen index (starting from 0). | |
ExitCode | The exit code passed to the OS when the main loop exits. By convention, an exit code of 0 indicates success whereas a non-zero exit code indicates an error. For portability reasons, the exit code should be set between 0 and 125 (inclusive). Note: This value will be ignored if using Quit(Int32) with an exit_code argument passed. | |
KeepScreenOn | If true, the engine tries to keep the screen on while the game is running. Useful on mobile. | |
LowProcessorUsageMode | If true, the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile. | |
LowProcessorUsageModeSleepUsec | The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage. | |
MaxWindowSize | The maximum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to (0, 0) to reset to the system default value. | |
MinWindowSize | The minimum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to (0, 0) to reset to the system default value. | |
ScreenOrientation | The current screen orientation. | |
Singleton | ||
TabletDriver | The current tablet driver in use. | |
VsyncEnabled | If true, vertical synchronization (Vsync) is enabled. | |
VsyncViaCompositor | If true and vsync_enabled is true, the operating system's window compositor will be used for vsync when the compositor is enabled and the game is in windowed mode. Note: This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it. Note: This property is only implemented on Windows. | |
WindowBorderless | If true, removes the window frame. Note: Setting window_borderless to false disables per-pixel transparency. | |
WindowFullscreen | If true, the window is fullscreen. | |
WindowMaximized | If true, the window is maximized. | |
WindowMinimized | If true, the window is minimized. | |
WindowPerPixelTransparencyEnabled | If true, the window background is transparent and window frame is removed. Use get_tree().get_root().set_transparent_background(true) to disable main viewport background rendering. Note: This property has no effect if Project > Project Settings > Display > Window > Per-pixel transparency > Allowed setting is disabled. Note: This property is implemented on HTML5, Linux, macOS and Windows. | |
WindowPosition | The window position relative to the screen, the origin is the top left corner, +Y axis goes to the bottom and +X axis goes to the right. | |
WindowResizable | If true, the window is resizable by the user. | |
WindowSize | The size of the window (without counting window manager decorations). |