2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-08-05 18:51:38 +02:00
<class name= "OS" inherits= "Object" version= "3.6" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 22:42:36 +02:00
<brief_description >
Operating System functions.
</brief_description>
<description >
2019-06-22 01:04:47 +02:00
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.
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
2020-10-01 10:34:47 +02:00
<link title= "OS Test Demo" > https://godotengine.org/asset-library/asset/677</link>
2017-09-12 22:42:36 +02:00
</tutorials>
<methods >
<method name= "alert" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "text" type= "String" />
<argument index= "1" name= "title" type= "String" default= ""Alert!"" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Displays a modal dialog box using the host OS' facilities. Execution is blocked until the dialog is closed.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "can_draw" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Returns [code]true[/code] if the host OS allows drawing.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "can_use_threads" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Returns [code]true[/code] if the current host platform is using multiple threads.
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-02-19 10:47:16 +01:00
<method name= "center_window" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2018-02-19 10:47:16 +01:00
<description >
2018-04-10 17:05:28 +02:00
Centers the window on the screen if in windowed mode.
2018-02-19 10:47:16 +01:00
</description>
</method>
2018-08-29 22:25:11 +02:00
<method name= "close_midi_inputs" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2018-08-29 22:25:11 +02:00
<description >
2019-12-03 16:19:55 +01:00
Shuts down system MIDI driver.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
2018-08-29 22:25:11 +02:00
</description>
</method>
2021-12-04 01:40:56 +01:00
<method name= "crash" >
<return type= "void" />
<argument index= "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>
2017-09-12 22:42:36 +02:00
<method name= "delay_msec" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "msec" type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2021-04-12 00:10:17 +02:00
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).
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "delay_usec" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "usec" type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2021-04-12 00:10:17 +02:00
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).
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "dump_memory_to_file" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "file" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
Dumps the memory allocation ringlist to a file (only works in debug).
2018-04-10 17:05:28 +02:00
Entry format per line: "Address - Size - Description".
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "dump_resources_to_file" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "file" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
Dumps all used resources to file (only works in debug).
2018-04-10 17:05:28 +02:00
Entry format per line: "Resource Type : Resource Location".
2017-09-12 22:42:36 +02:00
At the end of the file is a statistic of all used Resource Types.
</description>
</method>
<method name= "execute" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
<argument index= "0" name= "path" type= "String" />
<argument index= "1" name= "arguments" type= "PoolStringArray" />
<argument index= "2" name= "blocking" type= "bool" default= "true" />
<argument index= "3" name= "output" type= "Array" default= "[ ]" />
<argument index= "4" name= "read_stderr" type= "bool" default= "false" />
2021-12-16 12:08:09 +01:00
<argument index= "5" name= "open_console" type= "bool" default= "false" />
2017-09-12 22:42:36 +02:00
<description >
2018-05-30 12:18:01 +02:00
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.
2019-06-22 01:04:47 +02:00
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.
2019-06-26 15:57:13 +02:00
This method has slightly different behavior based on whether the [code]blocking[/code] mode is enabled.
2019-06-22 01:04:47 +02:00
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.
2021-12-16 12:08:09 +01:00
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.
2019-09-07 19:39:24 +02:00
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.
2018-05-30 12:18:01 +02:00
Example of blocking mode and retrieving the shell output:
2018-01-21 00:45:21 +01:00
[codeblock]
var output = []
2019-09-07 19:39:24 +02:00
var exit_code = OS.execute("ls", ["-l", "/tmp"], true, output)
2018-01-21 00:45:21 +01:00
[/codeblock]
2018-05-30 12:18:01 +02:00
Example of non-blocking mode, running another instance of the project and storing its process ID:
2018-01-21 00:45:21 +01:00
[codeblock]
2018-05-30 12:18:01 +02:00
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:
[codeblock]
2019-06-22 01:04:47 +02:00
OS.execute("CMD.exe", ["/C", "cd %TEMP% & & dir"], true, output)
2018-01-21 00:45:21 +01:00
[/codeblock]
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
2022-01-17 13:53:28 +01:00
[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.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "find_scancode_from_string" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
<argument index= "0" name= "string" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Returns the scancode of the given string (e.g. "Escape").
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-04-10 10:12:42 +02:00
<method name= "get_audio_driver_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2018-04-10 10:12:42 +02:00
<description >
2018-04-10 17:05:28 +02:00
Returns the total number of available audio drivers.
2018-04-10 10:12:42 +02:00
</description>
</method>
<method name= "get_audio_driver_name" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "driver" type= "int" />
2018-04-10 10:12:42 +02:00
<description >
2018-04-10 17:05:28 +02:00
Returns the audio driver name for the given index.
2018-04-10 10:12:42 +02:00
</description>
</method>
2021-05-07 19:36:32 +02:00
<method name= "get_cache_dir" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2021-05-07 19:36:32 +02:00
<description >
2021-11-15 17:11:20 +01:00
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].
2021-05-07 19:36:32 +02:00
Not to be confused with [method get_user_data_dir], which returns the [i]project-specific[/i] user data path.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_cmdline_args" >
2021-07-30 15:28:05 +02:00
<return type= "PoolStringArray" />
2017-09-12 22:42:36 +02:00
<description >
2020-07-19 23:19:05 +02:00
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.
2020-02-07 19:51:50 +01:00
You can set [member ProjectSettings.editor/main_run_args] to define command-line arguments to be passed by the editor when running the project.
2020-07-19 23:19:05 +02:00
Here's a minimal example on how to parse command-line arguments into a dictionary using the [code]--key=value[/code] form for arguments:
[codeblock]
var arguments = {}
for argument in OS.get_cmdline_args():
2020-07-28 11:50:39 +02:00
if argument.find("=") > -1:
2020-07-19 23:19:05 +02:00
var key_value = argument.split("=")
arguments[key_value[0].lstrip("--")] = key_value[1]
2022-05-05 19:11:30 +02:00
else:
# Options without an argument will be present in the dictionary,
# with the value set to an empty string.
arguments[argument.lstrip("--")] = ""
2020-07-19 23:19:05 +02:00
[/codeblock]
2017-09-12 22:42:36 +02:00
</description>
</method>
2021-05-07 19:36:32 +02:00
<method name= "get_config_dir" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2021-05-07 19:36:32 +02:00
<description >
2021-11-15 17:11:20 +01:00
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].
2021-05-07 19:36:32 +02:00
Not to be confused with [method get_user_data_dir], which returns the [i]project-specific[/i] user data path.
</description>
</method>
2018-07-26 11:56:21 +02:00
<method name= "get_connected_midi_inputs" >
2021-07-30 15:28:05 +02:00
<return type= "PoolStringArray" />
2018-07-26 11:56:21 +02:00
<description >
2019-10-31 16:19:39 +01:00
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].
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
2018-07-26 11:56:21 +02:00
</description>
</method>
2019-02-16 14:40:52 +01:00
<method name= "get_current_video_driver" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "OS.VideoDriver" />
2019-02-16 14:40:52 +01:00
<description >
2019-06-27 11:44:37 +02:00
Returns the currently used video driver, using one of the values from [enum VideoDriver].
2019-02-16 14:40:52 +01:00
</description>
</method>
2021-05-07 19:36:32 +02:00
<method name= "get_data_dir" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2021-05-07 19:36:32 +02:00
<description >
2021-11-15 17:11:20 +01:00
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].
2021-05-07 19:36:32 +02:00
Not to be confused with [method get_user_data_dir], which returns the [i]project-specific[/i] user data path.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_date" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Dictionary" />
<argument index= "0" name= "utc" type= "bool" default= "false" />
2017-09-12 22:42:36 +02:00
<description >
2021-10-21 05:14:41 +02:00
Deprecated, use [method Time.get_date_dict_from_system] instead.
2019-06-22 01:04:47 +02:00
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).
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_datetime" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Dictionary" />
<argument index= "0" name= "utc" type= "bool" default= "false" />
2017-09-12 22:42:36 +02:00
<description >
2021-10-21 05:14:41 +02:00
Deprecated, use [method Time.get_datetime_dict_from_system] instead.
2019-06-22 01:04:47 +02:00
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].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_datetime_from_unix_time" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Dictionary" />
<argument index= "0" name= "unix_time_val" type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2021-10-21 05:14:41 +02:00
Deprecated, use [method Time.get_datetime_dict_from_unix_time] instead.
2019-06-22 01:04:47 +02:00
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.
2017-09-12 22:42:36 +02:00
</description>
</method>
2022-04-24 19:04:05 +02:00
<method name= "get_display_cutouts" qualifiers= "const" >
<return type= "Array" />
<description >
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.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_dynamic_memory_usage" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Returns the total amount of dynamic memory used (only works in debug).
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_environment" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "variable" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2021-02-25 15:12:43 +01:00
Returns the value of an environment variable. Returns an empty string if the environment variable doesn't exist.
[b]Note:[/b] Double-check the casing of [code]variable[/code]. Environment variable names are case-sensitive on all platforms except Windows.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_executable_path" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Returns the path to the current engine executable.
2017-09-12 22:42:36 +02:00
</description>
</method>
2019-10-26 16:40:31 +02:00
<method name= "get_granted_permissions" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "PoolStringArray" />
2019-10-06 20:17:44 +02:00
<description >
2021-07-23 16:24:57 +02:00
With this function, you can get the list of dangerous permissions that have been granted to the Android application.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Android.
2019-10-06 20:17:44 +02:00
</description>
</method>
2018-12-13 15:12:25 +01:00
<method name= "get_ime_selection" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2" />
2018-11-23 13:07:48 +01:00
<description >
2019-06-22 01:04:47 +02:00
Returns the IME cursor position (the currently-edited portion of the string) relative to the characters in the composition string.
2019-06-26 15:57:13 +02:00
[constant MainLoop.NOTIFICATION_OS_IME_UPDATE] is sent to the application to notify it of changes to the IME cursor position.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on macOS.
2018-11-23 13:07:48 +01:00
</description>
</method>
2018-12-13 15:12:25 +01:00
<method name= "get_ime_text" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2018-11-23 13:07:48 +01:00
<description >
2019-06-22 01:04:47 +02:00
Returns the IME intermediate composition string.
2019-06-26 15:57:13 +02:00
[constant MainLoop.NOTIFICATION_OS_IME_UPDATE] is sent to the application to notify it of changes to the IME composition string.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on macOS.
2018-11-23 13:07:48 +01:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_latin_keyboard_variant" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2017-09-12 22:42:36 +02:00
<description >
Returns the current latin keyboard variant as a String.
2019-06-22 01:04:47 +02:00
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].
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Linux, macOS and Windows. Returns [code]"QWERTY"[/code] on unsupported platforms.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_locale" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2021-09-16 09:27:56 +02:00
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.
2020-07-25 22:42:11 +02:00
[code]extra[/code] - optional, semicolon separated list of additional key words. Currency, calendar, sort order and numbering system information.
2017-09-12 22:42:36 +02:00
</description>
</method>
2021-09-16 09:27:56 +02:00
<method name= "get_locale_language" qualifiers= "const" >
<return type= "String" />
<description >
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].
</description>
</method>
2021-11-13 01:10:33 +01:00
<method name= "get_main_thread_id" qualifiers= "const" >
<return type= "int" />
<description >
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>
2017-09-12 22:42:36 +02:00
<method name= "get_model_name" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2017-09-12 22:42:36 +02:00
<description >
Returns the model name of the current device.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Android and iOS. Returns [code]"GenericDevice"[/code] on unsupported platforms.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_name" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2020-06-20 17:59:38 +02:00
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].
2017-09-12 22:42:36 +02:00
</description>
</method>
2020-10-03 14:13:39 +02:00
<method name= "get_native_handle" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
<argument index= "0" name= "handle_type" type= "int" enum= "OS.HandleType" />
2020-10-03 14:13:39 +02:00
<description >
Returns internal structure pointers for use in GDNative plugins.
[b]Note:[/b] This method is implemented on Linux and Windows (other OSs will soon be supported).
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_power_percent_left" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2019-12-03 16:19:55 +01:00
Returns the amount of battery left in the device as a percentage. Returns [code]-1[/code] if power state is unknown.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_power_seconds_left" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2019-12-03 16:19:55 +01:00
Returns an estimate of the time left in seconds before the device runs out of battery. Returns [code]-1[/code] if power state is unknown.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_power_state" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "OS.PowerState" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-26 15:57:13 +02:00
Returns the current state of the device regarding battery and power. See [enum PowerState] constants.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_process_id" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Returns the project's process ID.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_processor_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2022-02-15 22:25:51 +01:00
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.
</description>
</method>
<method name= "get_processor_name" qualifiers= "const" >
<return type= "String" />
<description >
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.
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-02-19 10:47:16 +01:00
<method name= "get_real_window_size" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2" />
2018-02-19 10:47:16 +01:00
<description >
2018-04-10 17:05:28 +02:00
Returns the window size including decorations like window borders.
2018-02-19 10:47:16 +01:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_scancode_string" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "code" type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Returns the given scancode as a string (e.g. Return values: [code]"Escape"[/code], [code]"Shift+Escape"[/code]).
2020-01-25 20:09:04 +01:00
See also [member InputEventKey.scancode] and [method InputEventKey.get_scancode_with_modifiers].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_screen_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Returns the number of displays attached to the host machine.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_screen_dpi" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
2017-09-12 22:42:36 +02:00
<description >
2021-11-05 10:23:37 +01:00
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.
2020-10-01 21:55:54 +02:00
[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:
2019-06-22 01:04:47 +02:00
[codeblock]
ldpi - 120 dpi
mdpi - 160 dpi
hdpi - 240 dpi
xhdpi - 320 dpi
xxhdpi - 480 dpi
xxxhdpi - 640 dpi
[/codeblock]
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. Returns [code]72[/code] on unsupported platforms.
2017-09-12 22:42:36 +02:00
</description>
</method>
2020-07-07 20:37:05 +02:00
<method name= "get_screen_max_scale" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "float" />
2020-07-07 20:37:05 +02:00
<description >
Return the greatest scale factor of all screens.
[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.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_screen_position" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
2017-09-12 22:42:36 +02:00
<description >
2021-11-05 10:23:37 +01:00
Returns the position of the specified screen by index. If [code]screen[/code] is [code]-1[/code] (the default value), the current screen will be used.
2017-09-12 22:42:36 +02:00
</description>
</method>
2022-03-06 00:34:56 +01:00
<method name= "get_screen_refresh_rate" qualifiers= "const" >
<return type= "float" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
<description >
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:
[codeblock]
var refresh_rate = OS.get_screen_refresh_rate()
if refresh_rate < 0:
refresh_rate = 60.0
[/codeblock]
</description>
</method>
2020-07-07 20:37:05 +02:00
<method name= "get_screen_scale" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "float" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
2020-07-07 20:37:05 +02:00
<description >
2021-11-05 10:23:37 +01:00
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.
2020-07-07 20:37:05 +02:00
[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.
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_screen_size" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Vector2" />
<argument index= "0" name= "screen" type= "int" default= "-1" />
2017-09-12 22:42:36 +02:00
<description >
2021-11-05 10:23:37 +01:00
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.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_splash_tick_msec" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-29 13:51:25 +02:00
Returns the amount of time in milliseconds it took for the boot logo to appear.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_static_memory_peak_usage" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Returns the maximum amount of static memory used (only works in debug).
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_static_memory_usage" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2021-12-26 21:19:14 +01:00
Returns the amount of static memory being used by the program in bytes (only works in debug).
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_system_dir" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "dir" type= "int" enum= "OS.SystemDir" />
2021-07-11 03:39:31 +02:00
<argument index= "1" name= "shared_storage" type= "bool" default= "true" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-27 11:44:37 +02:00
Returns the actual path to commonly used folders across different platforms. Available locations are specified in [enum SystemDir].
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows.
2021-07-11 03:39:31 +02:00
[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.
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-12-27 11:10:09 +01:00
<method name= "get_system_time_msecs" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2018-12-27 11:10:09 +01:00
Returns the epoch time of the operating system in milliseconds.
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-12-27 11:10:09 +01:00
<method name= "get_system_time_secs" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2018-12-19 22:18:52 +01:00
<description >
2018-12-27 11:10:09 +01:00
Returns the epoch time of the operating system in seconds.
2018-12-19 22:18:52 +01:00
</description>
</method>
2020-05-19 22:28:57 +02:00
<method name= "get_tablet_driver_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2020-05-19 22:28:57 +02:00
<description >
Returns the total number of available tablet drivers.
[b]Note:[/b] This method is implemented on Windows.
</description>
</method>
<method name= "get_tablet_driver_name" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "idx" type= "int" />
2020-05-19 22:28:57 +02:00
<description >
Returns the tablet driver name for the given index.
[b]Note:[/b] This method is implemented on Windows.
</description>
</method>
2020-12-27 16:49:46 +01:00
<method name= "get_thread_caller_id" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2020-12-27 16:49:46 +01:00
<description >
Returns the ID of the current thread. This can be used in logs to ease debugging of multi-threaded applications.
[b]Note:[/b] Thread IDs are not deterministic and may be reused across application restarts.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_ticks_msec" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2021-10-21 05:14:41 +02:00
Deprecated, use [method Time.get_ticks_msec] instead.
2017-10-08 19:33:17 +02:00
Returns the amount of time passed in milliseconds since the engine started.
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-06-17 18:10:41 +02:00
<method name= "get_ticks_usec" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2018-06-17 18:10:41 +02:00
<description >
2021-10-21 05:14:41 +02:00
Deprecated, use [method Time.get_ticks_usec] instead.
2018-06-17 18:10:41 +02:00
Returns the amount of time passed in microseconds since the engine started.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_time" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Dictionary" />
<argument index= "0" name= "utc" type= "bool" default= "false" />
2017-09-12 22:42:36 +02:00
<description >
2021-10-21 05:14:41 +02:00
Deprecated, use [method Time.get_time_dict_from_system] instead.
2017-10-08 19:33:17 +02:00
Returns current time as a dictionary of keys: hour, minute, second.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_time_zone_info" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Dictionary" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Returns the current time zone as a dictionary with the keys: bias and name.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_unique_id" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2018-01-20 16:17:39 +01:00
Returns a string that is unique to the device.
2021-07-23 16:24:57 +02:00
[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.
2019-06-22 01:04:47 +02:00
[b]Note:[/b] Returns an empty string on HTML5 and UWP, as this method isn't implemented on those platforms yet.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_unix_time" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2021-03-24 13:21:32 +01:00
Returns the current UNIX epoch timestamp in seconds.
2021-05-20 12:47:34 +02:00
[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).
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_unix_time_from_datetime" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
<argument index= "0" name= "datetime" type= "Dictionary" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
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].
2021-05-24 12:25:17 +02:00
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).
2019-06-22 01:04:47 +02:00
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.
2017-09-12 22:42:36 +02:00
</description>
</method>
2017-11-24 09:16:27 +01:00
<method name= "get_user_data_dir" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
2017-11-24 09:16:27 +01:00
<description >
Returns the absolute directory path where user data is written ([code]user://[/code]).
2018-02-23 15:58:14 +01:00
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.
2019-07-09 05:25:50 +02:00
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].
2018-02-23 15:58:14 +01:00
If the project name is empty, [code]user://[/code] falls back to [code]res://[/code].
2021-05-07 19:36:32 +02:00
Not to be confused with [method get_data_dir], which returns the [i]global[/i] (non-project-specific) user data directory.
2017-11-24 09:16:27 +01:00
</description>
</method>
2018-04-10 10:12:42 +02:00
<method name= "get_video_driver_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2018-04-10 10:12:42 +02:00
<description >
2019-02-16 14:40:52 +01:00
Returns the number of video drivers supported on the current platform.
2018-04-10 10:12:42 +02:00
</description>
</method>
<method name= "get_video_driver_name" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "driver" type= "int" enum= "OS.VideoDriver" />
2018-04-10 10:12:42 +02:00
<description >
2019-06-27 11:44:37 +02:00
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.
2018-04-10 10:12:42 +02:00
</description>
</method>
2017-10-11 23:54:43 +02:00
<method name= "get_virtual_keyboard_height" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2017-10-11 23:54:43 +02:00
<description >
2019-06-22 01:04:47 +02:00
Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden.
2017-10-11 23:54:43 +02:00
</description>
</method>
2018-05-12 09:38:00 +02:00
<method name= "get_window_safe_area" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "Rect2" />
2018-05-12 09:38:00 +02:00
<description >
2019-06-29 13:51:25 +02:00
Returns unobscured area of the window where interactive controls should be rendered.
2018-05-12 09:38:00 +02:00
</description>
</method>
2019-02-06 14:57:06 +01:00
<method name= "global_menu_add_item" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu" type= "String" />
<argument index= "1" name= "label" type= "String" />
<argument index= "2" name= "id" type= "Variant" />
<argument index= "3" name= "meta" type= "Variant" />
2019-02-06 14:57:06 +01:00
<description >
Add a new item with text "label" to global menu. Use "_dock" menu to add item to the macOS dock icon menu.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on macOS.
2019-02-06 14:57:06 +01:00
</description>
</method>
<method name= "global_menu_add_separator" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu" type= "String" />
2019-02-06 14:57:06 +01:00
<description >
Add a separator between items. Separators also occupy an index.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on macOS.
2019-02-06 14:57:06 +01:00
</description>
</method>
<method name= "global_menu_clear" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu" type= "String" />
2019-02-06 14:57:06 +01:00
<description >
Clear the global menu, in effect removing all items.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on macOS.
2019-02-06 14:57:06 +01:00
</description>
</method>
<method name= "global_menu_remove_item" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "menu" type= "String" />
<argument index= "1" name= "idx" type= "int" />
2019-02-06 14:57:06 +01:00
<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.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on macOS.
2019-02-06 14:57:06 +01:00
</description>
</method>
2022-01-19 13:06:44 +01:00
<method name= "has_clipboard" qualifiers= "const" >
<return type= "bool" />
<description >
Returns [code]true[/code] if there is content on the clipboard.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "has_environment" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "variable" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2021-02-25 15:12:43 +01:00
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.
2017-09-12 22:42:36 +02:00
</description>
</method>
2017-10-11 23:54:43 +02:00
<method name= "has_feature" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "tag_name" type= "String" />
2017-10-11 23:54:43 +02:00
<description >
2021-12-10 11:29:38 +01:00
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.
2019-06-22 01:04:47 +02:00
[b]Note:[/b] Tag names are case-sensitive.
2017-10-11 23:54:43 +02:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "has_touchscreen_ui_hint" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Returns [code]true[/code] if the device has a touchscreen or emulates one.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "has_virtual_keyboard" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Returns [code]true[/code] if the platform has a virtual keyboard, [code]false[/code] otherwise.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "hide_virtual_keyboard" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2017-09-12 22:42:36 +02:00
<description >
Hides the virtual keyboard if it is shown, does nothing otherwise.
</description>
</method>
<method name= "is_debug_build" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2017-09-12 22:42:36 +02:00
<description >
2020-01-10 14:47:27 +01:00
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.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "is_ok_left_and_cancel_right" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Returns [code]true[/code] if the [b]OK[/b] button should appear on the left and [b]Cancel[/b] on the right.
2017-09-12 22:42:36 +02:00
</description>
</method>
2021-08-13 05:36:23 +02:00
<method name= "is_process_running" qualifiers= "const" >
<return type= "bool" />
<argument index= "0" name= "pid" type= "int" />
<description >
Returns [code]true[/code] if the child process ID ([code]pid[/code]) is still running or [code]false[/code] if it has terminated.
Must be a valid ID generated from [method execute].
[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "is_scancode_unicode" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "code" type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Returns [code]true[/code] if the input scancode corresponds to a Unicode character.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "is_stdout_verbose" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Returns [code]true[/code] if the engine was executed with [code]-v[/code] (verbose stdout).
2017-09-12 22:42:36 +02:00
</description>
</method>
2017-10-02 16:09:24 +02:00
<method name= "is_userfs_persistent" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2017-10-02 16:09:24 +02:00
<description >
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.
</description>
</method>
2018-02-19 10:47:16 +01:00
<method name= "is_window_always_on_top" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2018-02-19 10:47:16 +01:00
<description >
2018-04-10 17:05:28 +02:00
Returns [code]true[/code] if the window should always be on top of other windows.
2018-02-19 10:47:16 +01:00
</description>
</method>
2019-11-28 13:41:07 +01:00
<method name= "is_window_focused" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2019-11-28 13:41:07 +01:00
<description >
Returns [code]true[/code] if the window is currently focused.
[b]Note:[/b] Only implemented on desktop platforms. On other platforms, it will always return [code]true[/code].
</description>
</method>
2020-06-12 14:51:51 +02:00
<method name= "keyboard_get_current_layout" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2020-06-12 14:51:51 +02:00
<description >
Returns active keyboard layout index.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name= "keyboard_get_layout_count" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "int" />
2020-06-12 14:51:51 +02:00
<description >
Returns the number of keyboard layouts.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name= "keyboard_get_layout_language" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "index" type= "int" />
2020-06-12 14:51:51 +02:00
<description >
Returns the ISO-639/BCP-47 language code of the keyboard layout at position [code]index[/code].
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
<method name= "keyboard_get_layout_name" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "String" />
<argument index= "0" name= "index" type= "int" />
2020-06-12 14:51:51 +02:00
<description >
Returns the localized name of the keyboard layout at position [code]index[/code].
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
2021-12-17 11:39:40 +01:00
<method name= "keyboard_get_scancode_from_physical" qualifiers= "const" >
<return type= "int" />
<argument index= "0" name= "scancode" type= "int" />
<description >
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>
2020-06-12 14:51:51 +02:00
<method name= "keyboard_set_current_layout" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "index" type= "int" />
2020-06-12 14:51:51 +02:00
<description >
Sets active keyboard layout.
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "kill" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "Error" />
<argument index= "0" name= "pid" type= "int" />
2017-09-12 22:42:36 +02:00
<description >
2021-12-04 01:40:56 +01:00
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].
2019-06-22 01:04:47 +02:00
[b]Note:[/b] This method can also be used to kill processes that were not spawned by the game.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows.
2017-09-12 22:42:36 +02:00
</description>
</method>
2022-04-26 23:52:20 +02:00
<method name= "move_to_trash" qualifiers= "const" >
<return type= "int" enum= "Error" />
<argument index= "0" name= "path" type= "String" />
<description >
Moves the file or directory to the system's recycle bin. See also [method Directory.remove].
2022-06-11 23:05:07 +02:00
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.
2022-04-26 23:52:20 +02:00
[b]Note:[/b] If the user has disabled the recycle bin on their system, the file will be permanently deleted instead.
2022-06-11 23:05:07 +02:00
[codeblock]
var file_to_remove = "user://slot1.sav"
OS.move_to_trash(ProjectSettings.globalize_path(file_to_remove))
[/codeblock]
2022-04-26 23:52:20 +02:00
</description>
</method>
2018-11-07 15:13:02 +01:00
<method name= "move_window_to_foreground" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2018-11-07 15:13:02 +01:00
<description >
Moves the window to the front.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
2018-11-07 15:13:02 +01:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "native_video_is_playing" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Returns [code]true[/code] if native video is playing.
2021-05-07 16:42:17 +02:00
[b]Note:[/b] This method is only implemented on iOS.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "native_video_pause" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Pauses native video playback.
2021-05-07 16:42:17 +02:00
[b]Note:[/b] This method is only implemented on iOS.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "native_video_play" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "Error" />
<argument index= "0" name= "path" type= "String" />
<argument index= "1" name= "volume" type= "float" />
<argument index= "2" name= "audio_track" type= "String" />
<argument index= "3" name= "subtitle_track" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Plays native video from the specified path, at the given volume and with audio and subtitle tracks.
2021-05-07 16:42:17 +02:00
[b]Note:[/b] This method is only implemented on iOS.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "native_video_stop" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Stops native video playback.
2021-05-07 16:42:17 +02:00
[b]Note:[/b] This method is implemented on iOS.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "native_video_unpause" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Resumes native video playback.
2021-05-07 16:42:17 +02:00
[b]Note:[/b] This method is implemented on iOS.
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-08-29 22:25:11 +02:00
<method name= "open_midi_inputs" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2018-08-29 22:25:11 +02:00
<description >
2019-10-31 16:19:39 +01:00
Initialises the singleton for the system MIDI driver.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
2018-08-29 22:25:11 +02:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "print_all_resources" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "tofile" type= "String" default= """" />
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Shows all resources in the game. Optionally, the list can be written to a file by specifying a file path in [code]tofile[/code].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "print_all_textures_by_size" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Shows the list of loaded textures sorted by size in memory.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "print_resources_by_type" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "types" type= "PoolStringArray" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Shows the number of resources loaded by the game of the given types.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "print_resources_in_use" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "short" type= "bool" default= "false" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Shows all resources currently used by the game.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "request_attention" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2017-09-12 22:42:36 +02:00
<description >
Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
2017-09-12 22:42:36 +02:00
</description>
</method>
2019-03-05 03:06:37 +01:00
<method name= "request_permission" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "name" type= "String" />
2019-03-05 03:06:37 +01:00
<description >
2019-03-10 11:28:09 +01:00
At the moment this function is only used by [code]AudioDriverOpenSL[/code] to request permission for [code]RECORD_AUDIO[/code] on Android.
2019-03-05 03:06:37 +01:00
</description>
</method>
2019-10-06 20:17:44 +02:00
<method name= "request_permissions" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2019-10-06 20:17:44 +02:00
<description >
2021-07-23 16:24:57 +02:00
With this function, you can request dangerous permissions since normal permissions are automatically granted at install time in Android applications.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Android.
2019-10-06 20:17:44 +02:00
</description>
</method>
2021-02-25 12:05:16 +01:00
<method name= "set_environment" qualifiers= "const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
<argument index= "0" name= "variable" type= "String" />
<argument index= "1" name= "value" type= "String" />
2021-02-25 12:05:16 +01:00
<description >
2021-02-25 15:12:43 +01:00
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.
2021-02-25 12:05:16 +01:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "set_icon" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "icon" type= "Image" />
2017-09-12 22:42:36 +02:00
<description >
2019-05-17 15:43:56 +02:00
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.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on HTML5, Linux, macOS and Windows.
2019-05-17 15:43:56 +02:00
</description>
</method>
2018-11-23 13:07:48 +01:00
<method name= "set_ime_active" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "active" type= "bool" />
2018-11-23 13:07:48 +01:00
<description >
Sets whether IME input mode should be enabled.
2019-06-04 09:30:59 +02:00
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.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
2018-11-23 13:07:48 +01:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "set_ime_position" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "position" type= "Vector2" />
2017-09-12 22:42:36 +02:00
<description >
2018-11-23 13:07:48 +01:00
Sets position of IME suggestion list popup (in window coordinates).
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
2017-09-12 22:42:36 +02:00
</description>
</method>
2019-05-28 18:08:13 +02:00
<method name= "set_native_icon" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "filename" type= "String" />
2019-05-28 18:08:13 +02:00
<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.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on macOS and Windows.
2019-05-28 18:08:13 +02:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "set_thread_name" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "Error" />
<argument index= "0" name= "name" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Sets the name of the current thread.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "set_use_file_access_save_and_swap" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "enabled" type= "bool" />
2017-09-12 22:42:36 +02:00
<description >
2017-10-08 19:33:17 +02:00
Enables backup saves if [code]enabled[/code] is [code]true[/code].
2017-09-12 22:42:36 +02:00
</description>
</method>
2018-02-19 10:47:16 +01:00
<method name= "set_window_always_on_top" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "enabled" type= "bool" />
2018-02-19 10:47:16 +01:00
<description >
2018-04-10 17:05:28 +02:00
Sets whether the window should always be on top.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Linux, macOS and Windows.
2018-02-19 10:47:16 +01:00
</description>
</method>
2020-06-29 11:31:13 +02:00
<method name= "set_window_mouse_passthrough" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "region" type= "PoolVector2Array" />
2020-06-29 11:31:13 +02:00
<description >
Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through.
Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior).
[codeblock]
# Set region, using Path2D node.
OS.set_window_mouse_passthrough($Path2D.curve.get_baked_points())
# Set region, using Polygon2D node.
OS.set_window_mouse_passthrough($Polygon2D.polygon)
# Reset region to default.
OS.set_window_mouse_passthrough([])
[/codeblock]
[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>
2017-09-12 22:42:36 +02:00
<method name= "set_window_title" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "title" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
Sets the window title to the specified string.
2019-09-22 19:00:33 +02:00
[b]Note:[/b] This should be used sporadically. Don't set this every frame, as that will negatively affect performance on some window managers.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on HTML5, Linux, macOS and Windows.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "shell_open" >
2021-07-30 15:28:05 +02:00
<return type= "int" enum= "Error" />
<argument index= "0" name= "uri" type= "String" />
2017-09-12 22:42:36 +02:00
<description >
2019-09-23 18:30:12 +02:00
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.
2022-06-08 11:42:51 +02:00
- [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://datatracker.ietf.org/doc/html/rfc2368]RFC 2368 - The [code]mailto[/code] URL scheme[/url] for a list of fields that can be added.
2020-04-28 19:25:02 +02:00
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.
2019-12-03 16:19:55 +01:00
[b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "show_virtual_keyboard" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
<argument index= "0" name= "existing_text" type= "String" default= """" />
<argument index= "1" name= "multiline" type= "bool" default= "false" />
2017-09-12 22:42:36 +02:00
<description >
2020-07-17 17:44:13 +02:00
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].
2022-07-07 20:22:28 +02:00
[b]Note:[/b] This method is equivalent to calling [method show_virtual_keyboard_type] with either default or multiline keyboard type. It is kept for compatibility with previous Godot releases and should be considered [i]deprecated[/i] and replaced by [method show_virtual_keyboard_type].
[b]Note:[/b] This method is implemented on Android, iOS, UWP, and HTML5.
</description>
</method>
<method name= "show_virtual_keyboard_type" >
<return type= "void" />
<argument index= "0" name= "existing_text" type= "String" default= """" />
<argument index= "1" name= "type" type= "int" enum= "OS.VirtualKeyboardType" default= "0" />
<description >
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]type[/code] parameter allows selecting which virtual keyboard to show.
[b]Note:[/b] This method is implemented on Android, iOS, UWP, and HTML5.
2017-09-12 22:42:36 +02:00
</description>
</method>
</methods>
2018-01-11 23:38:35 +01:00
<members >
2019-06-30 13:19:00 +02:00
<member name= "clipboard" type= "String" setter= "set_clipboard" getter= "get_clipboard" default= """" >
2018-01-11 23:38:35 +01:00
The clipboard from the host OS. Might be unavailable on some platforms.
</member>
2019-06-29 12:38:01 +02:00
<member name= "current_screen" type= "int" setter= "set_current_screen" getter= "get_current_screen" default= "0" >
2018-01-11 23:38:35 +01:00
The current screen index (starting from 0).
</member>
2021-04-30 20:48:08 +02:00
<member name= "delta_smoothing" type= "bool" setter= "set_delta_smoothing" getter= "is_delta_smoothing_enabled" default= "true" >
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.
</member>
2019-06-29 12:38:01 +02:00
<member name= "exit_code" type= "int" setter= "set_exit_code" getter= "get_exit_code" default= "0" >
2019-12-29 16:55:16 +01:00
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).
2019-12-29 16:39:24 +01:00
[b]Note:[/b] This value will be ignored if using [method SceneTree.quit] with an [code]exit_code[/code] argument passed.
2018-01-11 23:38:35 +01:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "keep_screen_on" type= "bool" setter= "set_keep_screen_on" getter= "is_keep_screen_on" default= "true" >
2018-12-20 13:46:54 +01:00
If [code]true[/code], the engine tries to keep the screen on while the game is running. Useful on mobile.
2018-01-11 23:38:35 +01:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "low_processor_usage_mode" type= "bool" setter= "set_low_processor_usage_mode" getter= "is_in_low_processor_usage_mode" default= "false" >
2018-12-20 13:46:54 +01:00
If [code]true[/code], the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile.
2018-01-11 23:38:35 +01:00
</member>
2019-11-08 18:36:06 +01:00
<member name= "low_processor_usage_mode_sleep_usec" type= "int" setter= "set_low_processor_usage_mode_sleep_usec" getter= "get_low_processor_usage_mode_sleep_usec" default= "6900" >
The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage.
</member>
2019-06-29 12:38:01 +02:00
<member name= "max_window_size" type= "Vector2" setter= "set_max_window_size" getter= "get_max_window_size" default= "Vector2( 0, 0 )" >
2019-06-13 14:31:08 +02:00
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.
</member>
2019-06-29 12:38:01 +02:00
<member name= "min_window_size" type= "Vector2" setter= "set_min_window_size" getter= "get_min_window_size" default= "Vector2( 0, 0 )" >
2021-08-22 09:11:21 +02:00
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.
2019-06-18 15:07:31 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "screen_orientation" type= "int" setter= "set_screen_orientation" getter= "get_screen_orientation" enum= "_OS.ScreenOrientation" default= "0" >
2018-01-11 23:38:35 +01:00
The current screen orientation.
</member>
2020-05-25 17:00:22 +02:00
<member name= "tablet_driver" type= "String" setter= "set_current_tablet_driver" getter= "get_current_tablet_driver" default= """" >
2020-09-18 14:09:51 +02:00
The current tablet driver in use.
2020-05-19 22:28:57 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "vsync_enabled" type= "bool" setter= "set_use_vsync" getter= "is_vsync_enabled" default= "true" >
2018-12-20 13:46:54 +01:00
If [code]true[/code], vertical synchronization (Vsync) is enabled.
2018-01-11 23:38:35 +01:00
</member>
2020-01-13 09:27:06 +01:00
<member name= "vsync_via_compositor" type= "bool" setter= "set_vsync_via_compositor" getter= "is_vsync_via_compositor_enabled" default= "false" >
2019-11-07 03:18:55 +01:00
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.
2020-01-13 09:27:06 +01:00
[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.
2020-01-09 22:20:00 +01:00
[b]Note:[/b] This property is only implemented on Windows.
2019-11-07 03:18:55 +01:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "window_borderless" type= "bool" setter= "set_borderless_window" getter= "get_borderless_window" default= "false" >
2018-12-20 13:46:54 +01:00
If [code]true[/code], removes the window frame.
2019-06-22 01:04:47 +02:00
[b]Note:[/b] Setting [code]window_borderless[/code] to [code]false[/code] disables per-pixel transparency.
2018-01-11 23:38:35 +01:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "window_fullscreen" type= "bool" setter= "set_window_fullscreen" getter= "is_window_fullscreen" default= "false" >
2018-12-20 13:46:54 +01:00
If [code]true[/code], the window is fullscreen.
2018-01-11 23:38:35 +01:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "window_maximized" type= "bool" setter= "set_window_maximized" getter= "is_window_maximized" default= "false" >
2018-12-20 13:46:54 +01:00
If [code]true[/code], the window is maximized.
2018-01-11 23:38:35 +01:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "window_minimized" type= "bool" setter= "set_window_minimized" getter= "is_window_minimized" default= "false" >
2018-12-20 13:46:54 +01:00
If [code]true[/code], the window is minimized.
2018-01-11 23:38:35 +01:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "window_per_pixel_transparency_enabled" type= "bool" setter= "set_window_per_pixel_transparency_enabled" getter= "get_window_per_pixel_transparency_enabled" default= "false" >
2021-08-07 02:10:28 +02:00
If [code]true[/code], the window background is transparent and the window frame is removed.
2019-06-04 10:21:29 +02:00
Use [code]get_tree().get_root().set_transparent_background(true)[/code] to disable main viewport background rendering.
2021-08-07 02:10:28 +02:00
[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.
2018-05-12 09:38:00 +02:00
</member>
2019-06-30 13:19:00 +02:00
<member name= "window_position" type= "Vector2" setter= "set_window_position" getter= "get_window_position" default= "Vector2( 0, 0 )" >
2018-01-11 23:38:35 +01:00
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.
</member>
2019-06-29 12:38:01 +02:00
<member name= "window_resizable" type= "bool" setter= "set_window_resizable" getter= "is_window_resizable" default= "true" >
2018-01-11 23:38:35 +01:00
If [code]true[/code], the window is resizable by the user.
</member>
2019-06-30 13:19:00 +02:00
<member name= "window_size" type= "Vector2" setter= "set_window_size" getter= "get_window_size" default= "Vector2( 0, 0 )" >
2018-01-11 23:38:35 +01:00
The size of the window (without counting window manager decorations).
</member>
</members>
2017-09-12 22:42:36 +02:00
<constants >
2019-02-16 14:40:52 +01:00
<constant name= "VIDEO_DRIVER_GLES2" value= "1" enum= "VideoDriver" >
The GLES2 rendering backend. It uses OpenGL ES 2.0 on mobile devices, OpenGL 2.1 on desktop platforms and WebGL 1.0 on the web.
</constant>
<constant name= "VIDEO_DRIVER_GLES3" value= "0" enum= "VideoDriver" >
The GLES3 rendering backend. It uses OpenGL ES 3.0 on mobile devices, OpenGL 3.3 on desktop platforms and WebGL 2.0 on the web.
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "DAY_SUNDAY" value= "0" enum= "Weekday" >
2018-04-10 17:05:28 +02:00
Sunday.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "DAY_MONDAY" value= "1" enum= "Weekday" >
2018-04-10 17:05:28 +02:00
Monday.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "DAY_TUESDAY" value= "2" enum= "Weekday" >
2018-04-10 17:05:28 +02:00
Tuesday.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "DAY_WEDNESDAY" value= "3" enum= "Weekday" >
2018-04-10 17:05:28 +02:00
Wednesday.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "DAY_THURSDAY" value= "4" enum= "Weekday" >
2018-04-10 17:05:28 +02:00
Thursday.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "DAY_FRIDAY" value= "5" enum= "Weekday" >
2018-04-10 17:05:28 +02:00
Friday.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "DAY_SATURDAY" value= "6" enum= "Weekday" >
2018-04-10 17:05:28 +02:00
Saturday.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_JANUARY" value= "1" enum= "Month" >
2018-04-10 17:05:28 +02:00
January.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_FEBRUARY" value= "2" enum= "Month" >
2018-04-10 17:05:28 +02:00
February.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_MARCH" value= "3" enum= "Month" >
2018-04-10 17:05:28 +02:00
March.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_APRIL" value= "4" enum= "Month" >
2018-04-10 17:05:28 +02:00
April.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_MAY" value= "5" enum= "Month" >
2018-04-10 17:05:28 +02:00
May.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_JUNE" value= "6" enum= "Month" >
2018-04-10 17:05:28 +02:00
June.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_JULY" value= "7" enum= "Month" >
2018-04-10 17:05:28 +02:00
July.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_AUGUST" value= "8" enum= "Month" >
2018-04-10 17:05:28 +02:00
August.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_SEPTEMBER" value= "9" enum= "Month" >
2018-04-10 17:05:28 +02:00
September.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_OCTOBER" value= "10" enum= "Month" >
2018-04-10 17:05:28 +02:00
October.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_NOVEMBER" value= "11" enum= "Month" >
2018-04-10 17:05:28 +02:00
November.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MONTH_DECEMBER" value= "12" enum= "Month" >
2018-04-10 17:05:28 +02:00
December.
2017-09-12 22:42:36 +02:00
</constant>
2020-10-03 14:13:39 +02:00
<constant name= "APPLICATION_HANDLE" value= "0" enum= "HandleType" >
Application handle:
- Windows: [code]HINSTANCE[/code] of the application
- MacOS: [code]NSApplication*[/code] of the application (not yet implemented)
- Android: [code]JNIEnv*[/code] of the application (not yet implemented)
</constant>
<constant name= "DISPLAY_HANDLE" value= "1" enum= "HandleType" >
Display handle:
- Linux: [code]X11::Display*[/code] for the display
</constant>
<constant name= "WINDOW_HANDLE" value= "2" enum= "HandleType" >
Window handle:
- Windows: [code]HWND[/code] of the main window
- Linux: [code]X11::Window*[/code] of the main window
- MacOS: [code]NSWindow*[/code] of the main window (not yet implemented)
- Android: [code]jObject[/code] the main android activity (not yet implemented)
</constant>
<constant name= "WINDOW_VIEW" value= "3" enum= "HandleType" >
Window view:
- Windows: [code]HDC[/code] of the main window drawing context
- MacOS: [code]NSView*[/code] of the main windows view (not yet implemented)
</constant>
<constant name= "OPENGL_CONTEXT" value= "4" enum= "HandleType" >
OpenGL Context:
- Windows: [code]HGLRC[/code]
- Linux: [code]X11::GLXContext[/code]
- MacOS: [code]NSOpenGLContext*[/code] (not yet implemented)
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SCREEN_ORIENTATION_LANDSCAPE" value= "0" enum= "ScreenOrientation" >
2018-04-10 17:05:28 +02:00
Landscape screen orientation.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SCREEN_ORIENTATION_PORTRAIT" value= "1" enum= "ScreenOrientation" >
2018-04-10 17:05:28 +02:00
Portrait screen orientation.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SCREEN_ORIENTATION_REVERSE_LANDSCAPE" value= "2" enum= "ScreenOrientation" >
2018-04-10 17:05:28 +02:00
Reverse landscape screen orientation.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SCREEN_ORIENTATION_REVERSE_PORTRAIT" value= "3" enum= "ScreenOrientation" >
2018-04-10 17:05:28 +02:00
Reverse portrait screen orientation.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SCREEN_ORIENTATION_SENSOR_LANDSCAPE" value= "4" enum= "ScreenOrientation" >
2018-04-10 17:05:28 +02:00
Uses landscape or reverse landscape based on the hardware sensor.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SCREEN_ORIENTATION_SENSOR_PORTRAIT" value= "5" enum= "ScreenOrientation" >
2018-04-10 17:05:28 +02:00
Uses portrait or reverse portrait based on the hardware sensor.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SCREEN_ORIENTATION_SENSOR" value= "6" enum= "ScreenOrientation" >
2018-04-10 17:05:28 +02:00
Uses most suitable orientation based on the hardware sensor.
2017-09-12 22:42:36 +02:00
</constant>
2022-07-07 20:22:28 +02:00
<constant name= "KEYBOARD_TYPE_DEFAULT" value= "0" enum= "VirtualKeyboardType" >
Default text virtual keyboard.
</constant>
<constant name= "KEYBOARD_TYPE_MULTILINE" value= "1" enum= "VirtualKeyboardType" >
Multiline virtual keyboard.
</constant>
<constant name= "KEYBOARD_TYPE_NUMBER" value= "2" enum= "VirtualKeyboardType" >
Virtual number keypad, useful for PIN entry.
</constant>
<constant name= "KEYBOARD_TYPE_NUMBER_DECIMAL" value= "3" enum= "VirtualKeyboardType" >
Virtual number keypad, useful for entering fractional numbers.
</constant>
<constant name= "KEYBOARD_TYPE_PHONE" value= "4" enum= "VirtualKeyboardType" >
Virtual phone number keypad.
</constant>
<constant name= "KEYBOARD_TYPE_EMAIL_ADDRESS" value= "5" enum= "VirtualKeyboardType" >
Virtual keyboard with additional keys to assist with typing email addresses.
</constant>
<constant name= "KEYBOARD_TYPE_PASSWORD" value= "6" enum= "VirtualKeyboardType" >
Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization.
[b]Note:[/b] This is not supported on HTML5 or below iOS version 11.0. Instead, this will behave identically to [constant KEYBOARD_TYPE_DEFAULT].
</constant>
<constant name= "KEYBOARD_TYPE_URL" value= "7" enum= "VirtualKeyboardType" >
Virtual keyboard with additional keys to assist with typing URLs.
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SYSTEM_DIR_DESKTOP" value= "0" enum= "SystemDir" >
2018-04-10 17:05:28 +02:00
Desktop directory path.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SYSTEM_DIR_DCIM" value= "1" enum= "SystemDir" >
2018-04-10 17:05:28 +02:00
DCIM (Digital Camera Images) directory path.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SYSTEM_DIR_DOCUMENTS" value= "2" enum= "SystemDir" >
2018-04-10 17:05:28 +02:00
Documents directory path.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SYSTEM_DIR_DOWNLOADS" value= "3" enum= "SystemDir" >
2018-04-10 17:05:28 +02:00
Downloads directory path.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SYSTEM_DIR_MOVIES" value= "4" enum= "SystemDir" >
2018-04-10 17:05:28 +02:00
Movies directory path.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SYSTEM_DIR_MUSIC" value= "5" enum= "SystemDir" >
2018-04-10 17:05:28 +02:00
Music directory path.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SYSTEM_DIR_PICTURES" value= "6" enum= "SystemDir" >
2018-04-10 17:05:28 +02:00
Pictures directory path.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "SYSTEM_DIR_RINGTONES" value= "7" enum= "SystemDir" >
2018-04-10 17:05:28 +02:00
Ringtones directory path.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "POWERSTATE_UNKNOWN" value= "0" enum= "PowerState" >
2018-04-10 17:05:28 +02:00
Unknown powerstate.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "POWERSTATE_ON_BATTERY" value= "1" enum= "PowerState" >
2018-04-10 17:05:28 +02:00
Unplugged, running on battery.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "POWERSTATE_NO_BATTERY" value= "2" enum= "PowerState" >
2018-04-10 17:05:28 +02:00
Plugged in, no battery available.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "POWERSTATE_CHARGING" value= "3" enum= "PowerState" >
2018-04-10 17:05:28 +02:00
Plugged in, battery charging.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "POWERSTATE_CHARGED" value= "4" enum= "PowerState" >
2018-04-10 17:05:28 +02:00
Plugged in, battery fully charged.
2017-09-12 22:42:36 +02:00
</constant>
</constants>
</class>