Click or drag to resize

OS Properties

The OS type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberClipboard

The clipboard from the host OS. Might be unavailable on some platforms.

Public propertyStatic memberCurrentScreen

The current screen index (starting from 0).

Public propertyStatic memberExitCode

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.

Public propertyStatic memberKeepScreenOn

If true, the engine tries to keep the screen on while the game is running. Useful on mobile.

Public propertyStatic memberLowProcessorUsageMode

If true, the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile.

Public propertyStatic memberLowProcessorUsageModeSleepUsec

The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage.

Public propertyStatic memberMaxWindowSize

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.

Public propertyStatic memberMinWindowSize

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.

Public propertyStatic memberScreenOrientation

The current screen orientation.

Public propertyStatic memberSingleton
Public propertyStatic memberTabletDriver

The current tablet driver in use.

Public propertyStatic memberVsyncEnabled

If true, vertical synchronization (Vsync) is enabled.

Public propertyStatic memberVsyncViaCompositor

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.

Public propertyStatic memberWindowBorderless

If true, removes the window frame.

Note: Setting window_borderless to false disables per-pixel transparency.

Public propertyStatic memberWindowFullscreen

If true, the window is fullscreen.

Public propertyStatic memberWindowMaximized

If true, the window is maximized.

Public propertyStatic memberWindowMinimized

If true, the window is minimized.

Public propertyStatic memberWindowPerPixelTransparencyEnabled

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.

Public propertyStatic memberWindowPosition

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.

Public propertyStatic memberWindowResizable

If true, the window is resizable by the user.

Public propertyStatic memberWindowSize

The size of the window (without counting window manager decorations).

Top
See Also