Operating System functions. OS wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, date and time, timers, environment variables, execution of binaries, command line, etc.
</description>
<tutorials>
<linktitle="OS Test Demo">https://godotengine.org/asset-library/asset/677</link>
Displays a modal dialog box using the host OS' facilities. Execution is blocked until the dialog is closed.
</description>
</method>
<methodname="can_draw"qualifiers="const">
<returntype="bool"/>
<description>
Returns [code]true[/code] if the host OS allows drawing.
</description>
</method>
<methodname="can_use_threads"qualifiers="const">
<returntype="bool"/>
<description>
Returns [code]true[/code] if the current host platform is using multiple threads.
</description>
</method>
<methodname="center_window">
<returntype="void"/>
<description>
Centers the window on the screen if in windowed mode.
</description>
</method>
<methodname="close_midi_inputs">
<returntype="void"/>
<description>
Shuts down system MIDI driver.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<methodname="crash">
<returntype="void"/>
<argumentindex="0"name="message"type="String"/>
<description>
Crashes the engine (or the editor if called within a [code]tool[/code] script). This should [i]only[/i] be used for testing the system's crash handler, not for any other purpose. For general error reporting, use (in order of preference) [method @GDScript.assert], [method @GDScript.push_error] or [method alert]. See also [method kill].
</description>
</method>
<methodname="delay_msec"qualifiers="const">
<returntype="void"/>
<argumentindex="0"name="msec"type="int"/>
<description>
Delays execution of the current thread by [code]msec[/code] milliseconds. [code]msec[/code] must be greater than or equal to [code]0[/code]. Otherwise, [method delay_msec] will do nothing and will print an error message.
[b]Note:[/b] [method delay_msec] is a [i]blocking[/i] way to delay code execution. To delay code execution in a non-blocking way, see [method SceneTree.create_timer]. Yielding with [method SceneTree.create_timer] will delay the execution of code placed below the [code]yield[/code] without affecting the rest of the project (or editor, for [EditorPlugin]s and [EditorScript]s).
[b]Note:[/b] When [method delay_msec] is called on the main thread, it will freeze the project and will prevent it from redrawing and registering input until the delay has passed. When using [method delay_msec] as part of an [EditorPlugin] or [EditorScript], it will freeze the editor but won't freeze the project if it is currently running (since the project is an independent child process).
</description>
</method>
<methodname="delay_usec"qualifiers="const">
<returntype="void"/>
<argumentindex="0"name="usec"type="int"/>
<description>
Delays execution of the current thread by [code]usec[/code] microseconds. [code]usec[/code] must be greater than or equal to [code]0[/code]. Otherwise, [method delay_usec] will do nothing and will print an error message.
[b]Note:[/b] [method delay_usec] is a [i]blocking[/i] way to delay code execution. To delay code execution in a non-blocking way, see [method SceneTree.create_timer]. Yielding with [method SceneTree.create_timer] will delay the execution of code placed below the [code]yield[/code] without affecting the rest of the project (or editor, for [EditorPlugin]s and [EditorScript]s).
[b]Note:[/b] When [method delay_usec] is called on the main thread, it will freeze the project and will prevent it from redrawing and registering input until the delay has passed. When using [method delay_usec] as part of an [EditorPlugin] or [EditorScript], it will freeze the editor but won't freeze the project if it is currently running (since the project is an independent child process).
</description>
</method>
<methodname="dump_memory_to_file">
<returntype="void"/>
<argumentindex="0"name="file"type="String"/>
<description>
Dumps the memory allocation ringlist to a file (only works in debug).
Entry format per line: "Address - Size - Description".
</description>
</method>
<methodname="dump_resources_to_file">
<returntype="void"/>
<argumentindex="0"name="file"type="String"/>
<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 file at the given path with the arguments passed as an array of strings. Platform path resolution will take place. The resolved file must exist and be executable.
The arguments are used in the given order and separated by a space, so [code]OS.execute("ping", ["-w", "3", "godotengine.org"], false)[/code] will resolve to [code]ping -w 3 godotengine.org[/code] in the system's shell.
This method has slightly different behavior based on whether the [code]blocking[/code] mode is enabled.
If [code]blocking[/code] is [code]true[/code], the Godot thread will pause its execution while waiting for the process to terminate. The shell output of the process will be written to the [code]output[/code] array as a single string. When the process terminates, the Godot thread will resume execution.
If [code]blocking[/code] is [code]false[/code], the Godot thread will continue while the new process runs. It is not possible to retrieve the shell output in non-blocking mode, so [code]output[/code] will be empty.
On Windows, if [code]open_console[/code] is [code]true[/code] and process is console app, new terminal window will be opened, it's ignored on other platforms.
The return value also depends on the blocking mode. When blocking, the method will return an exit code of the process. When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with [method kill]). If the process forking (non-blocking) or opening (blocking) fails, the method will return [code]-1[/code] or another exit code.
Example of blocking mode and retrieving the shell output:
[codeblock]
var output = []
var exit_code = OS.execute("ls", ["-l", "/tmp"], true, output)
[/codeblock]
Example of non-blocking mode, running another instance of the project and storing its process ID:
[codeblock]
var pid = OS.execute(OS.get_executable_path(), [], false)
[/codeblock]
If you wish to access a shell built-in or perform a composite command, a platform-specific shell can be invoked. For example:
[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
[b]Note:[/b] To execute a Windows command interpreter built-in command, specify [code]cmd.exe[/code] in [code]path[/code], [code]/c[/code] as the first argument, and the desired command as the second argument.
[b]Note:[/b] To execute a PowerShell built-in command, specify [code]powershell.exe[/code] in [code]path[/code], [code]-Command[/code] as the first argument, and the desired command as the second argument.
[b]Note:[/b] To execute a Unix shell built-in command, specify shell executable name in [code]path[/code], [code]-c[/code] as the first argument, and the desired command as the second argument.
Returns the audio driver name for the given index.
</description>
</method>
<methodname="get_cache_dir"qualifiers="const">
<returntype="String"/>
<description>
Returns the [i]global[/i] cache data directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the [code]XDG_CACHE_HOME[/code] environment variable before starting the project. See [url=$DOCS_URL/tutorials/io/data_paths.html]File paths in Godot projects[/url] in the documentation for more information. See also [method get_config_dir] and [method get_data_dir].
Not to be confused with [method get_user_data_dir], which returns the [i]project-specific[/i] user data path.
</description>
</method>
<methodname="get_cmdline_args">
<returntype="PoolStringArray"/>
<description>
Returns the command-line arguments passed to the engine.
Command-line arguments can be written in any form, including both [code]--key value[/code] and [code]--key=value[/code] forms so they can be properly parsed, as long as custom command-line arguments do not conflict with engine arguments.
You can also incorporate environment variables using the [method get_environment] method.
You can set [member ProjectSettings.editor/main_run_args] to define command-line arguments to be passed by the editor when running the project.
Here's a minimal example on how to parse command-line arguments into a dictionary using the [code]--key=value[/code] form for arguments:
Returns the [i]global[/i] user configuration directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the [code]XDG_CONFIG_HOME[/code] environment variable before starting the project. See [url=$DOCS_URL/tutorials/io/data_paths.html]File paths in Godot projects[/url] in the documentation for more information. See also [method get_cache_dir] and [method get_data_dir].
Not to be confused with [method get_user_data_dir], which returns the [i]project-specific[/i] user data path.
</description>
</method>
<methodname="get_connected_midi_inputs">
<returntype="PoolStringArray"/>
<description>
Returns an array of MIDI device names.
The returned array will be empty if the system MIDI driver has not previously been initialised with [method open_midi_inputs].
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
Returns the currently used video driver, using one of the values from [enum VideoDriver].
</description>
</method>
<methodname="get_data_dir"qualifiers="const">
<returntype="String"/>
<description>
Returns the [i]global[/i] user data directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the [code]XDG_DATA_HOME[/code] environment variable before starting the project. See [url=$DOCS_URL/tutorials/io/data_paths.html]File paths in Godot projects[/url] in the documentation for more information. See also [method get_cache_dir] and [method get_config_dir].
Not to be confused with [method get_user_data_dir], which returns the [i]project-specific[/i] user data path.
Deprecated, use [method Time.get_date_dict_from_system] instead.
Returns current date as a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], [code]weekday[/code], [code]dst[/code] (Daylight Savings Time).
Deprecated, use [method Time.get_datetime_dict_from_system] instead.
Returns current datetime as a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], [code]weekday[/code], [code]dst[/code] (Daylight Savings Time), [code]hour[/code], [code]minute[/code], [code]second[/code].
Deprecated, use [method Time.get_datetime_dict_from_unix_time] instead.
Gets a dictionary of time values corresponding to the given UNIX epoch time (in seconds).
The returned Dictionary's values will be the same as [method get_datetime], with the exception of Daylight Savings Time as it cannot be determined from the epoch.
Returns an [Array] of [Rect2], each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also [method get_window_safe_area].
[b]Note:[/b] Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
Returns the current latin keyboard variant as a String.
Possible return values are: [code]"QWERTY"[/code], [code]"AZERTY"[/code], [code]"QZERTY"[/code], [code]"DVORAK"[/code], [code]"NEO"[/code], [code]"COLEMAK"[/code] or [code]"ERROR"[/code].
[b]Note:[/b] This method is implemented on Linux, macOS and Windows. Returns [code]"QWERTY"[/code] on unsupported platforms.
</description>
</method>
<methodname="get_locale"qualifiers="const">
<returntype="String"/>
<description>
Returns the host OS locale as a string of the form [code]language_Script_COUNTRY_VARIANT@extra[/code]. If you want only the language code and not the fully specified locale from the OS, you can use [method get_locale_language].
[code]language[/code] - 2 or 3-letter [url=https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes]language code[/url], in lower case.
[code]Script[/code] - optional, 4-letter [url=https://en.wikipedia.org/wiki/ISO_15924]script code[/url], in title case.
[code]COUNTRY[/code] - optional, 2 or 3-letter [url=https://en.wikipedia.org/wiki/ISO_3166-1]country code[/url], in upper case.
[code]VARIANT[/code] - optional, language variant, region and sort order. Variant can have any number of underscored keywords.
[code]extra[/code] - optional, semicolon separated list of additional key words. Currency, calendar, sort order and numbering system information.
Returns the host OS locale's 2 or 3-letter [url=https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes]language code[/url] as a string which should be consistent on all platforms. This is equivalent to extracting the [code]language[/code] part of the [method get_locale] string.
This can be used to narrow down fully specified locale strings to only the "common" language code, when you don't need the additional information about country code or variants. For example, for a French Canadian user with [code]fr_CA[/code] locale, this would return [code]fr[/code].
Returns the ID of the main thread. See [method get_thread_caller_id].
[b]Note:[/b] Thread IDs are not deterministic and may be reused across application restarts.
</description>
</method>
<methodname="get_model_name"qualifiers="const">
<returntype="String"/>
<description>
Returns the model name of the current device.
[b]Note:[/b] This method is implemented on Android and iOS. Returns [code]"GenericDevice"[/code] on unsupported platforms.
</description>
</method>
<methodname="get_name"qualifiers="const">
<returntype="String"/>
<description>
Returns the name of the host OS. Possible values are: [code]"Android"[/code], [code]"iOS"[/code], [code]"HTML5"[/code], [code]"OSX"[/code], [code]"Server"[/code], [code]"Windows"[/code], [code]"UWP"[/code], [code]"X11"[/code].
Returns the number of [i]logical[/i] CPU cores available on the host machine. On CPUs with HyperThreading enabled, this number will be greater than the number of [i]physical[/i] CPU cores.
Returns the name of the CPU model on the host machine (e.g. "Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz").
[b]Note:[/b] This method is only implemented on Windows, macOS, Linux and iOS. On Android, HTML5 and UWP, [method get_processor_name] returns an empty string.
Returns the dots per inch density of the specified screen. If [code]screen[/code] is [code]-1[/code] (the default value), the current screen 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.
[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.
Returns the current refresh rate of the specified screen. If [code]screen[/code] is [code]-1[/code] (the default value), the current screen will be used.
[b]Note:[/b] Returns [code]-1.0[/code] if Godot fails to find the refresh rate for the specified screen. On HTML5, [method get_screen_refresh_rate] will always return [code]-1.0[/code] as there is no way to retrieve the refresh rate on that platform.
To fallback to a default refresh rate if the method fails, try:
Return the scale factor of the specified screen by index. If [code]screen[/code] is [code]-1[/code] (the default value), the current screen will be used.
[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.
Returns the dimensions in pixels of the specified screen. If [code]screen[/code] is [code]-1[/code] (the default value), the current screen will be used.
Returns the actual path to commonly used folders across different platforms. Available locations are specified in [enum SystemDir].
[b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows.
[b]Note:[/b] Shared storage is implemented on Android and allows to differentiate between app specific and shared directories. Shared directories have additional restrictions on Android.
Returns the current time zone as a dictionary with the keys: bias and name.
</description>
</method>
<methodname="get_unique_id"qualifiers="const">
<returntype="String"/>
<description>
Returns a string that is unique to the device.
[b]Note:[/b] This string may change without notice if the user reinstalls/upgrades their operating system or changes their hardware. This means it should generally not be used to encrypt persistent data as the data saved before an unexpected ID change would become inaccessible. The returned string may also be falsified using external programs, so do not rely on the string returned by [method get_unique_id] for security purposes.
[b]Note:[/b] Returns an empty string on HTML5 and UWP, as this method isn't implemented on those platforms yet.
</description>
</method>
<methodname="get_unix_time"qualifiers="const">
<returntype="int"/>
<description>
Returns the current UNIX epoch timestamp in seconds.
[b]Important:[/b] This is the system clock that the user can manually set. [b]Never use[/b] this method for precise time calculation since its results are also subject to automatic adjustments by the operating system. [b]Always use[/b] [method get_ticks_usec] or [method get_ticks_msec] for precise time calculation instead, since they are guaranteed to be monotonic (i.e. never decrease).
Gets an epoch time value from a dictionary of time values.
[code]datetime[/code] must be populated with the following keys: [code]year[/code], [code]month[/code], [code]day[/code], [code]hour[/code], [code]minute[/code], [code]second[/code].
If the dictionary is empty [code]0[/code] is returned. If some keys are omitted, they default to the equivalent values for the UNIX epoch timestamp 0 (1970-01-01 at 00:00:00 UTC).
You can pass the output from [method get_datetime_from_unix_time] directly into this function. Daylight Savings Time ([code]dst[/code]), if present, is ignored.
Returns the absolute directory path where user data is written ([code]user://[/code]).
On Linux, this is [code]~/.local/share/godot/app_userdata/[project_name][/code], or [code]~/.local/share/[custom_name][/code] if [code]use_custom_user_dir[/code] is set.
On macOS, this is [code]~/Library/Application Support/Godot/app_userdata/[project_name][/code], or [code]~/Library/Application Support/[custom_name][/code] if [code]use_custom_user_dir[/code] is set.
On Windows, this is [code]%APPDATA%\Godot\app_userdata\[project_name][/code], or [code]%APPDATA%\[custom_name][/code] if [code]use_custom_user_dir[/code] is set. [code]%APPDATA%[/code] expands to [code]%USERPROFILE%\AppData\Roaming[/code].
If the project name is empty, [code]user://[/code] falls back to [code]res://[/code].
Not to be confused with [method get_data_dir], which returns the [i]global[/i] (non-project-specific) user data directory.
Returns the name of the video driver matching the given [code]driver[/code] index. This index is a value from [enum VideoDriver], and you can use [method get_current_video_driver] to get the current backend's index.
</description>
</method>
<methodname="get_virtual_keyboard_height">
<returntype="int"/>
<description>
Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
Returns unobscured area of the window where interactive controls should be rendered.
</description>
</method>
<methodname="global_menu_add_item">
<returntype="void"/>
<argumentindex="0"name="menu"type="String"/>
<argumentindex="1"name="label"type="String"/>
<argumentindex="2"name="id"type="Variant"/>
<argumentindex="3"name="meta"type="Variant"/>
<description>
Add a new item with text "label" to global menu. Use "_dock" menu to add item to the macOS dock icon menu.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<methodname="global_menu_add_separator">
<returntype="void"/>
<argumentindex="0"name="menu"type="String"/>
<description>
Add a separator between items. Separators also occupy an index.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<methodname="global_menu_clear">
<returntype="void"/>
<argumentindex="0"name="menu"type="String"/>
<description>
Clear the global menu, in effect removing all items.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<methodname="global_menu_remove_item">
<returntype="void"/>
<argumentindex="0"name="menu"type="String"/>
<argumentindex="1"name="idx"type="int"/>
<description>
Removes the item at index "idx" from the global menu. Note that the indexes of items after the removed item are going to be shifted by one.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
<methodname="has_clipboard"qualifiers="const">
<returntype="bool"/>
<description>
Returns [code]true[/code] if there is content on the clipboard.
</description>
</method>
<methodname="has_environment"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="variable"type="String"/>
<description>
Returns [code]true[/code] if the environment variable with the name [code]variable[/code] exists.
[b]Note:[/b] Double-check the casing of [code]variable[/code]. Environment variable names are case-sensitive on all platforms except Windows.
</description>
</method>
<methodname="has_feature"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="tag_name"type="String"/>
<description>
Returns [code]true[/code] if the feature for the given feature tag is supported in the currently running instance, depending on the platform, build etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the [url=$DOCS_URL/tutorials/export/feature_tags.html]Feature Tags[/url] documentation for more details.
Returns [code]true[/code] if the platform has a virtual keyboard, [code]false[/code] otherwise.
</description>
</method>
<methodname="hide_virtual_keyboard">
<returntype="void"/>
<description>
Hides the virtual keyboard if it is shown, does nothing otherwise.
</description>
</method>
<methodname="is_debug_build"qualifiers="const">
<returntype="bool"/>
<description>
Returns [code]true[/code] if the Godot binary used to run the project is a [i]debug[/i] export template, or when running in the editor.
Returns [code]false[/code] if the Godot binary used to run the project is a [i]release[/i] export template.
To check whether the Godot binary used to run the project is an export template (debug or release), use [code]OS.has_feature("standalone")[/code] instead.
If [code]true[/code], the [code]user://[/code] file system is persistent, so that its state is the same after a player quits and starts the game again. Relevant to the HTML5 platform, where this persistence may be unavailable.
Converts a physical (US QWERTY) [code]scancode[/code] to one in the active keyboard layout.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<methodname="keyboard_set_current_layout">
<returntype="void"/>
<argumentindex="0"name="index"type="int"/>
<description>
Sets active keyboard layout.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<methodname="kill">
<returntype="int"enum="Error"/>
<argumentindex="0"name="pid"type="int"/>
<description>
Kill (terminate) the process identified by the given process ID ([code]pid[/code]), e.g. the one returned by [method execute] in non-blocking mode. See also [method crash].
[b]Note:[/b] This method can also be used to kill processes that were not spawned by the game.
[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
The method takes only global paths, so you may need to use [method ProjectSettings.globalize_path]. Do not use it for files in [code]res://[/code] as it will not work in exported project.
Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<methodname="request_permission">
<returntype="bool"/>
<argumentindex="0"name="name"type="String"/>
<description>
At the moment this function is only used by [code]AudioDriverOpenSL[/code] to request permission for [code]RECORD_AUDIO[/code] on Android.
</description>
</method>
<methodname="request_permissions">
<returntype="bool"/>
<description>
With this function, you can request dangerous permissions since normal permissions are automatically granted at install time in Android applications.
[b]Note:[/b] This method is implemented on Android.
</description>
</method>
<methodname="set_environment"qualifiers="const">
<returntype="bool"/>
<argumentindex="0"name="variable"type="String"/>
<argumentindex="1"name="value"type="String"/>
<description>
Sets the value of the environment variable [code]variable[/code] to [code]value[/code]. The environment variable will be set for the Godot process and any process executed with [method execute] after running [method set_environment]. The environment variable will [i]not[/i] persist to processes run after the Godot process was terminated.
[b]Note:[/b] Double-check the casing of [code]variable[/code]. Environment variable names are case-sensitive on all platforms except Windows.
</description>
</method>
<methodname="set_icon">
<returntype="void"/>
<argumentindex="0"name="icon"type="Image"/>
<description>
Sets the game's icon using an [Image] resource.
The same image is used for window caption, taskbar/dock and window selection dialog. Image is scaled as needed.
[b]Note:[/b] This method is implemented on HTML5, Linux, macOS and Windows.
</description>
</method>
<methodname="set_ime_active">
<returntype="void"/>
<argumentindex="0"name="active"type="bool"/>
<description>
Sets whether IME input mode should be enabled.
If active IME handles key events before the application and creates an composition string and suggestion list.
Application can retrieve the composition status by using [method get_ime_selection] and [method get_ime_text] functions.
Completed composition string is committed when input is finished.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<methodname="set_ime_position">
<returntype="void"/>
<argumentindex="0"name="position"type="Vector2"/>
<description>
Sets position of IME suggestion list popup (in window coordinates).
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<methodname="set_native_icon">
<returntype="void"/>
<argumentindex="0"name="filename"type="String"/>
<description>
Sets the game's icon using a multi-size platform-specific icon file ([code]*.ico[/code] on Windows and [code]*.icns[/code] on macOS).
Appropriate size sub-icons are used for window caption, taskbar/dock and window selection dialog.
[b]Note:[/b] This method is implemented on macOS and Windows.
</description>
</method>
<methodname="set_thread_name">
<returntype="int"enum="Error"/>
<argumentindex="0"name="name"type="String"/>
<description>
Sets the name of the current thread.
</description>
</method>
<methodname="set_use_file_access_save_and_swap">
<returntype="void"/>
<argumentindex="0"name="enabled"type="bool"/>
<description>
Enables backup saves if [code]enabled[/code] is [code]true[/code].
</description>
</method>
<methodname="set_window_always_on_top">
<returntype="void"/>
<argumentindex="0"name="enabled"type="bool"/>
<description>
Sets whether the window should always be on top.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
[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.
</description>
</method>
<methodname="set_window_title">
<returntype="void"/>
<argumentindex="0"name="title"type="String"/>
<description>
Sets the window title to the specified string.
[b]Note:[/b] This should be used sporadically. Don't set this every frame, as that will negatively affect performance on some window managers.
[b]Note:[/b] This method is implemented on HTML5, Linux, macOS and Windows.
</description>
</method>
<methodname="shell_open">
<returntype="int"enum="Error"/>
<argumentindex="0"name="uri"type="String"/>
<description>
Requests the OS to open a resource with the most appropriate program. For example:
- [code]OS.shell_open("C:\\Users\name\Downloads")[/code] on Windows opens the file explorer at the user's Downloads folder.
- [code]OS.shell_open("https://godotengine.org")[/code] opens the default web browser on the official Godot website.
- [code]OS.shell_open("mailto:example@example.com")[/code] opens the default email client with the "To" field set to [code]example@example.com[/code]. See [url=https://blog.escapecreative.com/customizing-mailto-links/]Customizing [code]mailto:[/code] Links[/url] for a list of fields that can be added.
Use [method ProjectSettings.globalize_path] to convert a [code]res://[/code] or [code]user://[/code] path into a system path for use with this method.
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows.
Shows the virtual keyboard if the platform has one.
The [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).
The [code]multiline[/code] parameter needs to be set to [code]true[/code] to be able to enter multiple lines of text, as in [TextEdit].
[b]Note:[/b] This method is implemented on Android, iOS and UWP.
If [code]true[/code], the engine filters the time delta measured between each frame, and attempts to compensate for random variation. This will only operate on systems where V-Sync is active.
The exit code passed to the OS when the main loop exits. By convention, an exit code of [code]0[/code] 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).
[b]Note:[/b] This value will be ignored if using [method SceneTree.quit] with an [code]exit_code[/code] argument passed.
The maximum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to [code](0, 0)[/code] to reset to the system default value.
The minimum size of the window in pixels (without counting window manager decorations). Does not affect fullscreen mode. Set to [code](0, 0)[/code] to reset to the system's default value.
[b]Note:[/b] By default, the project window has a minimum size of [code]Vector2(64, 64)[/code]. This prevents issues that can arise when the window is resized to a near-zero size.
If [code]true[/code] and [code]vsync_enabled[/code] 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.
[b]Note:[/b] 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.
[b]Note:[/b] This property is only implemented on Windows.
If [code]true[/code], the window background is transparent and the window frame is removed.
Use [code]get_tree().get_root().set_transparent_background(true)[/code] to disable main viewport background rendering.
[b]Note:[/b] This property has no effect if [member ProjectSettings.display/window/per_pixel_transparency/allowed] setting is disabled.
[b]Note:[/b] This property is implemented on HTML5, Linux, macOS, Windows, and Android. It can't be changed at runtime for Android. Use [member ProjectSettings.display/window/per_pixel_transparency/enabled] to set it at startup instead.