Operating System functions.
Operating System functions. OS Wraps the most common functionality to communicate with the host Operating System, such as: mouse grabbing, mouse cursors, clipboard, video mode, date and time, timers, environment variables, execution of binaries, command line, etc.
Displays a modal dialog box utilizing the host OS.
Return true if the host OS allows drawing.
Returns if the current host platform is using multiple threads.
Delay executing of the current thread by given milliseconds.
Delay executing of the current thread by given microseconds.
Dumps the memory allocation ringlist to a file (only works in debug).
Entry format per line: "Address - Size - Description"
Dumps all used resources to file (only works in debug).
Entry format per line: "Resource Type : Resource Location"
At the end of the file is a statistic of all used Resource Types.
Execute the binary file in given path, optionally blocking until it returns. A process ID is returned.
Returns the scancode of the given string (e.g. "Escape")
Returns true if the current window is borderless.
Get clipboard from the host OS.
Return the commandline passed to the engine.
Returns the current screen index (0 padded).
Return the absolute directory path of user data path([user://]).
Returns current date as a dictionary of keys: year, month, day, weekday, dst (daylight savings time).
Returns current datetime as a dictionary of keys: year, month, day, weekday, dst (daylight savings time), hour, minute, second.
Get a dictionary of time values when given epoch time.
Dictionary Time values will be a union of values from [method get_time] and [method get_date] dictionaries (with the exception of dst = day light standard time, as it cannot be determined from epoch).
Return the total amount of dynamic memory used (only works in debug).
Return an environment variable.
Return the path to the current engine executable.
Returns the current latin keyboard variant as a String.
Possible return values are: "QWERTY", "AZERTY", "QZERTY", "DVORAK", "NEO" or "ERROR"
Return the host OS locale.
Returns the model name of the current device.
Return the name of the host OS. Possible values are: "Android", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "UWP", "X11".
Returns the game process ID
Returns the number of cores available in the host machine.
Returns the given scancode as a string (e.g. Return values: "Escape", "Shift+Escape").
Returns the number of displays attached to the host machine
Returns the dots per inch density of the specified screen.
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
Returns the current screen orientation, the return value will be one of the SCREEN_ORIENTATION constants in this class.
Returns the dimensions in pixels of the specified screen.
Return the max amount of static memory used (only works in debug).
Return the amount of time passed in milliseconds since the engine started.
Returns current time as a dictionary of keys: hour, minute, second
Return the current unix timestamp.
Get an epoch time value from a dictionary of time values.
[code]datetime[/code] must be populated with the following keys: year, month, day, hour, minute, second.
You can pass the output from [method get_datetime_from_unix_time] directly into this function. Daylight savings time (dst), if present, is ignored.
Returns 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.
Returns the size of the window (without counting window manager decorations).
Return true if an environment variable exists.
Returns true if the platform has a virtual keyboard, false otherwise.
Hides the virtual keyboard if it is shown, does nothing otherwise.
Return true if low cpu usage mode is enabled.
Returns whether the screen is being kept on or not.
Return true if the engine was executed with -v (verbose stdout).
Returns whether the window is in fullscreen mode or not.
Return true if the window is maximized.
Return true if the window is minimized.
Returns whether the window is resizable or not.
Kill a process ID (this method can be used to kill processes that were not spawned by the game).
Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX.
Set clipboard to the OS.
Set keep screen on if true, or goes to sleep by device setting if false. (for Android/iOS)
Set to true to enable the low cpu usage mode. In this mode, the screen only redraws when there are changes, and a considerable sleep time is inserted between frames. This way, editors using the engine UI only use very little cpu.
Sets the current screen orientation, the argument value must be one of the SCREEN_ORIENTATION constants in this class.
Sets window fullscreen mode to the [i]enabled[/i] argument, [i]enabled[/i] is a toggle for the fullscreen mode, calling the function with [i]enabled[/i] true when the screen is not on fullscreen mode will cause the screen to go to fullscreen mode, calling the function with [i]enabled[/i] false when the screen is in fullscreen mode will cause the window to exit the fullscreen mode.
Set the window size to maximized.
Set whether the window is minimized.
Sets the position of the window to the specified position (this function could be restricted by the window manager, meaning that there could be some unreachable areas of the screen).
Set the window resizable state, if the window is not resizable it will preserve the dimensions specified in the project settings.
Sets the window size to the specified size.
Sets the window title to the specified string.
Shows the virtual keyboard if the platform has one. The [i]existing_text[/i] parameter is useful for implementing your own LineEdit, as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).