2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2019-04-01 10:33:56 +00:00
<class name= "OS" inherits= "Object" category= "Core" version= "3.2" >
2017-09-12 20:42:36 +00:00
<brief_description >
Operating System functions.
</brief_description>
<description >
Operating System functions. OS Wraps the most common functionality to communicate with the host Operating System, such as: mouse grabbing, mouse cursors, clipboard, video mode, date and time, timers, environment variables, execution of binaries, command line, etc.
</description>
<tutorials >
</tutorials>
<methods >
<method name= "alert" >
<return type= "void" >
</return>
<argument index= "0" name= "text" type= "String" >
</argument>
<argument index= "1" name= "title" type= "String" default= ""Alert!"" >
</argument>
<description >
Displays a modal dialog box utilizing the host OS.
</description>
</method>
<method name= "can_draw" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns [code]true[/code] if the host OS allows drawing.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "can_use_threads" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns [code]true[/code] if the current host platform is using multiple threads.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-02-19 09:47:16 +00:00
<method name= "center_window" >
<return type= "void" >
</return>
<description >
2018-04-10 15:05:28 +00:00
Centers the window on the screen if in windowed mode.
2018-02-19 09:47:16 +00:00
</description>
</method>
2018-08-29 20:25:11 +00:00
<method name= "close_midi_inputs" >
<return type= "void" >
</return>
<description >
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "delay_msec" qualifiers= "const" >
<return type= "void" >
</return>
<argument index= "0" name= "msec" type= "int" >
</argument>
<description >
2018-04-10 15:05:28 +00:00
Delay execution of the current thread by given milliseconds.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "delay_usec" qualifiers= "const" >
<return type= "void" >
</return>
<argument index= "0" name= "usec" type= "int" >
</argument>
<description >
2018-04-10 15:05:28 +00:00
Delay execution of the current thread by given microseconds.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "dump_memory_to_file" >
<return type= "void" >
</return>
<argument index= "0" name= "file" type= "String" >
</argument>
<description >
Dumps the memory allocation ringlist to a file (only works in debug).
2018-04-10 15:05:28 +00:00
Entry format per line: "Address - Size - Description".
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "dump_resources_to_file" >
<return type= "void" >
</return>
<argument index= "0" name= "file" type= "String" >
</argument>
<description >
Dumps all used resources to file (only works in debug).
2018-04-10 15:05:28 +00:00
Entry format per line: "Resource Type : Resource Location".
2017-09-12 20:42:36 +00:00
At the end of the file is a statistic of all used Resource Types.
</description>
</method>
<method name= "execute" >
<return type= "int" >
</return>
<argument index= "0" name= "path" type= "String" >
</argument>
<argument index= "1" name= "arguments" type= "PoolStringArray" >
</argument>
<argument index= "2" name= "blocking" type= "bool" >
</argument>
<argument index= "3" name= "output" type= "Array" default= "[ ]" >
</argument>
2019-05-28 16:08:13 +00:00
<argument index= "4" name= "read_stderr" type= "bool" default= "false" >
</argument>
2017-09-12 20:42:36 +00:00
<description >
2018-05-30 10:18:01 +00: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.
2018-09-27 07:34:08 +00: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.
2018-05-30 10:18:01 +00:00
This method has slightly different behaviour based on whether the [code]blocking[/code] mode is enabled.
When [code]blocking[/code] is enabled, 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.
When [code]blocking[/code] is disabled, 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.
The return value also depends on the blocking mode. When blocking, the method will return -2 (no process ID information is available in blocking mode). 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 -1.
Example of blocking mode and retrieving the shell output:
2018-01-20 23:45:21 +00:00
[codeblock]
var output = []
2018-05-30 10:18:01 +00:00
OS.execute('ls', ['-l', '/tmp'], true, output)
2018-01-20 23:45:21 +00:00
[/codeblock]
2018-05-30 10:18:01 +00:00
Example of non-blocking mode, running another instance of the project and storing its process ID:
2018-01-20 23:45:21 +00:00
[codeblock]
2018-05-30 10:18:01 +00: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]
OS.execute('CMD.exe', ['/C', 'cd %TEMP% & & dir'], true, output)
2018-01-20 23:45:21 +00:00
[/codeblock]
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "find_scancode_from_string" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "string" type= "String" >
</argument>
<description >
Returns the scancode of the given string (e.g. "Escape")
</description>
</method>
2018-04-10 08:12:42 +00:00
<method name= "get_audio_driver_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2018-04-10 15:05:28 +00:00
Returns the total number of available audio drivers.
2018-04-10 08:12:42 +00:00
</description>
</method>
<method name= "get_audio_driver_name" qualifiers= "const" >
<return type= "String" >
</return>
2018-03-23 17:57:58 +00:00
<argument index= "0" name= "driver" type= "int" >
2018-04-10 08:12:42 +00:00
</argument>
<description >
2018-04-10 15:05:28 +00:00
Returns the audio driver name for the given index.
2018-04-10 08:12:42 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "get_cmdline_args" >
<return type= "PoolStringArray" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the command line arguments passed to the engine.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-07-26 09:56:21 +00:00
<method name= "get_connected_midi_inputs" >
<return type= "PoolStringArray" >
</return>
<description >
</description>
</method>
2019-02-16 13:40:52 +00:00
<method name= "get_current_video_driver" qualifiers= "const" >
<return type= "int" enum= "OS.VideoDriver" >
</return>
<description >
Returns the currently used video driver, using one of the values from [enum OS.VideoDriver].
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "get_date" qualifiers= "const" >
<return type= "Dictionary" >
</return>
<argument index= "0" name= "utc" type= "bool" default= "false" >
</argument>
<description >
Returns current date as a dictionary of keys: year, month, day, weekday, dst (daylight savings time).
</description>
</method>
<method name= "get_datetime" qualifiers= "const" >
<return type= "Dictionary" >
</return>
<argument index= "0" name= "utc" type= "bool" default= "false" >
</argument>
<description >
Returns current datetime as a dictionary of keys: year, month, day, weekday, dst (daylight savings time), hour, minute, second.
</description>
</method>
<method name= "get_datetime_from_unix_time" qualifiers= "const" >
<return type= "Dictionary" >
</return>
<argument index= "0" name= "unix_time_val" type= "int" >
</argument>
<description >
Get a dictionary of time values when given epoch time.
Dictionary Time values will be a union of values from [method get_time] and [method get_date] dictionaries (with the exception of dst = day light standard time, as it cannot be determined from epoch).
</description>
</method>
<method name= "get_dynamic_memory_usage" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the total amount of dynamic memory used (only works in debug).
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_environment" qualifiers= "const" >
<return type= "String" >
</return>
<argument index= "0" name= "environment" type= "String" >
</argument>
<description >
2017-10-08 17:33:17 +00:00
Returns an environment variable.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_executable_path" qualifiers= "const" >
<return type= "String" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the path to the current engine executable.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-12-13 14:12:25 +00:00
<method name= "get_ime_selection" qualifiers= "const" >
<return type= "Vector2" >
2018-11-23 12:07:48 +00:00
</return>
<description >
2019-06-04 07:30:59 +00:00
Returns IME cursor position (currently edited portion of the string) relative to the characters in the composition string.
[code]NOTIFICATION_OS_IME_UPDATE[/code] is sent to the application to notify it of changes to the IME cursor position.
2018-11-23 12:07:48 +00:00
</description>
</method>
2018-12-13 14:12:25 +00:00
<method name= "get_ime_text" qualifiers= "const" >
<return type= "String" >
2018-11-23 12:07:48 +00:00
</return>
<description >
2019-06-04 07:30:59 +00:00
Returns IME intermediate composition string.
[code]NOTIFICATION_OS_IME_UPDATE[/code] is sent to the application to notify it of changes to the IME composition string.
2018-11-23 12:07:48 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "get_latin_keyboard_variant" qualifiers= "const" >
<return type= "String" >
</return>
<description >
Returns the current latin keyboard variant as a String.
2017-10-24 17:32:40 +00:00
Possible return values are: "QWERTY", "AZERTY", "QZERTY", "DVORAK", "NEO", "COLEMAK" or "ERROR".
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_locale" qualifiers= "const" >
<return type= "String" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the host OS locale.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_model_name" qualifiers= "const" >
<return type= "String" >
</return>
<description >
Returns the model name of the current device.
</description>
</method>
<method name= "get_name" qualifiers= "const" >
<return type= "String" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the name of the host OS. Possible values are: "Android", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "UWP", "X11".
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_power_percent_left" >
<return type= "int" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the amount of battery left in the device as a percentage.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_power_seconds_left" >
<return type= "int" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the time in seconds before the device runs out of battery.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_power_state" >
2017-09-15 23:46:14 +00:00
<return type= "int" enum= "OS.PowerState" >
2017-09-12 20:42:36 +00:00
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the current state of the device regarding battery and power. See [code]POWERSTATE_*[/code] constants.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_process_id" qualifiers= "const" >
<return type= "int" >
</return>
<description >
Returns the game process ID
</description>
</method>
<method name= "get_processor_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
Returns the number of cores available in the host machine.
</description>
</method>
2018-02-19 09:47:16 +00:00
<method name= "get_real_window_size" qualifiers= "const" >
<return type= "Vector2" >
</return>
<description >
2018-04-10 15:05:28 +00:00
Returns the window size including decorations like window borders.
2018-02-19 09:47:16 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "get_scancode_string" qualifiers= "const" >
<return type= "String" >
</return>
<argument index= "0" name= "code" type= "int" >
</argument>
<description >
Returns the given scancode as a string (e.g. Return values: "Escape", "Shift+Escape").
</description>
</method>
<method name= "get_screen_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the number of displays attached to the host machine.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_screen_dpi" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "screen" type= "int" default= "-1" >
</argument>
<description >
Returns the dots per inch density of the specified screen.
On Android Devices, the actual screen densities are grouped into six generalized densities:
ldpi - 120 dpi
mdpi - 160 dpi
hdpi - 240 dpi
xhdpi - 320 dpi
xxhdpi - 480 dpi
xxxhdpi - 640 dpi
</description>
</method>
<method name= "get_screen_position" qualifiers= "const" >
<return type= "Vector2" >
</return>
<argument index= "0" name= "screen" type= "int" default= "-1" >
</argument>
<description >
2017-10-08 17:33:17 +00:00
Returns the position of the specified screen by index. If no screen index is provided, the current screen will be used.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_screen_size" qualifiers= "const" >
<return type= "Vector2" >
</return>
<argument index= "0" name= "screen" type= "int" default= "-1" >
</argument>
<description >
Returns the dimensions in pixels of the specified screen.
</description>
</method>
<method name= "get_splash_tick_msec" qualifiers= "const" >
<return type= "int" >
</return>
<description >
</description>
</method>
<method name= "get_static_memory_peak_usage" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the max amount of static memory used (only works in debug).
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_static_memory_usage" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2017-10-03 03:54:50 +00:00
Returns the amount of static memory being used by the program in bytes.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_system_dir" qualifiers= "const" >
<return type= "String" >
</return>
2017-09-17 16:57:13 +00:00
<argument index= "0" name= "dir" type= "int" enum= "OS.SystemDir" >
2017-09-12 20:42:36 +00:00
</argument>
<description >
2019-01-07 09:02:04 +00:00
Returns the actual path to commonly used folders across different platforms. Available locations are specified in [enum OS.SystemDir].
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-12-27 10:10:09 +00:00
<method name= "get_system_time_msecs" qualifiers= "const" >
2017-09-12 20:42:36 +00:00
<return type= "int" >
</return>
<description >
2018-12-27 10:10:09 +00:00
Returns the epoch time of the operating system in milliseconds.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-12-27 10:10:09 +00:00
<method name= "get_system_time_secs" qualifiers= "const" >
2018-12-19 21:18:52 +00:00
<return type= "int" >
</return>
<description >
2018-12-27 10:10:09 +00:00
Returns the epoch time of the operating system in seconds.
2018-12-19 21:18:52 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "get_ticks_msec" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the amount of time passed in milliseconds since the engine started.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-06-17 16:10:41 +00:00
<method name= "get_ticks_usec" qualifiers= "const" >
<return type= "int" >
</return>
<description >
Returns the amount of time passed in microseconds since the engine started.
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "get_time" qualifiers= "const" >
<return type= "Dictionary" >
</return>
<argument index= "0" name= "utc" type= "bool" default= "false" >
</argument>
<description >
2017-10-08 17:33:17 +00:00
Returns current time as a dictionary of keys: hour, minute, second.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_time_zone_info" qualifiers= "const" >
<return type= "Dictionary" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns the current time zone as a dictionary with the keys: bias and name.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_unique_id" qualifiers= "const" >
<return type= "String" >
</return>
<description >
2018-01-20 15:17:39 +00:00
Returns a string that is unique to the device.
Returns empty string on HTML5 and UWP which are not supported yet.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_unix_time" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2018-04-10 15:05:28 +00:00
Returns the current unix epoch timestamp.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_unix_time_from_datetime" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "datetime" type= "Dictionary" >
</argument>
<description >
Get an epoch time value from a dictionary of time values.
[code]datetime[/code] must be populated with the following keys: year, month, day, hour, minute, second.
You can pass the output from [method get_datetime_from_unix_time] directly into this function. Daylight savings time (dst), if present, is ignored.
</description>
</method>
2017-11-24 08:16:27 +00:00
<method name= "get_user_data_dir" qualifiers= "const" >
<return type= "String" >
</return>
<description >
Returns the absolute directory path where user data is written ([code]user://[/code]).
2018-02-23 14:58:14 +00: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.
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.
If the project name is empty, [code]user://[/code] falls back to [code]res://[/code].
2017-11-24 08:16:27 +00:00
</description>
</method>
2018-04-10 08:12:42 +00:00
<method name= "get_video_driver_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2019-02-16 13:40:52 +00:00
Returns the number of video drivers supported on the current platform.
2018-04-10 08:12:42 +00:00
</description>
</method>
<method name= "get_video_driver_name" qualifiers= "const" >
<return type= "String" >
</return>
2019-02-16 13:40:52 +00:00
<argument index= "0" name= "driver" type= "int" enum= "OS.VideoDriver" >
2018-04-10 08:12:42 +00:00
</argument>
<description >
2019-02-16 13:40:52 +00:00
Returns the name of the video driver matching the given [code]driver[/code] index. This index is a value from [enum OS.VideoDriver], and you can use [method get_current_video_driver] to get the current backend's index.
2018-04-10 08:12:42 +00:00
</description>
</method>
2017-10-11 21:54:43 +00:00
<method name= "get_virtual_keyboard_height" >
<return type= "int" >
</return>
<description >
2018-04-10 15:05:28 +00:00
Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or it is currently hidden.
2017-10-11 21:54:43 +00:00
</description>
</method>
2018-05-12 07:38:00 +00:00
<method name= "get_window_safe_area" qualifiers= "const" >
<return type= "Rect2" >
</return>
<description >
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "has_environment" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "environment" type= "String" >
</argument>
<description >
2017-10-08 17:33:17 +00:00
Returns [code]true[/code] if an environment variable exists.
2017-09-12 20:42:36 +00:00
</description>
</method>
2017-10-11 21:54:43 +00:00
<method name= "has_feature" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "tag_name" type= "String" >
</argument>
<description >
2018-04-10 15:05:28 +00:00
Returns [code]true[/code] if the feature for the given feature tag is supported in the currently running instance, depending on platform, build etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. See feature tags documentation.
2017-10-11 21:54:43 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "has_touchscreen_ui_hint" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns [code]true[/code] if the device has a touchscreen or emulates one.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "has_virtual_keyboard" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns [code]true[/code] if the platform has a virtual keyboard, [code]false[/code] otherwise.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "hide_virtual_keyboard" >
<return type= "void" >
</return>
<description >
Hides the virtual keyboard if it is shown, does nothing otherwise.
</description>
</method>
<method name= "is_debug_build" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2017-10-03 03:54:50 +00:00
Returns [code]true[/code] if the build is a debug build.
Returns [code]true[/code] when running in the editor.
Returns [code]false[/code] if the build is a release build.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "is_ok_left_and_cancel_right" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2017-10-11 21:54:43 +00:00
Returns [code]true[/code] if the "Okay" button should appear on the left and "Cancel" on the right.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "is_scancode_unicode" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "code" type= "int" >
</argument>
<description >
2017-10-08 17:33:17 +00:00
Returns [code]true[/code] if the input code has a unicode character.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "is_stdout_verbose" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns [code]true[/code] if the engine was executed with -v (verbose stdout).
2017-09-12 20:42:36 +00:00
</description>
</method>
2017-10-02 14:09:24 +00:00
<method name= "is_userfs_persistent" qualifiers= "const" >
<return type= "bool" >
</return>
<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 09:47:16 +00:00
<method name= "is_window_always_on_top" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
2018-04-10 15:05:28 +00:00
Returns [code]true[/code] if the window should always be on top of other windows.
2018-02-19 09:47:16 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "kill" >
<return type= "int" enum= "Error" >
</return>
<argument index= "0" name= "pid" type= "int" >
</argument>
<description >
2018-05-30 10:18:01 +00: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.
Note that this method can also be used to kill processes that were not spawned by the game.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-11-07 14:13:02 +00:00
<method name= "move_window_to_foreground" >
<return type= "void" >
</return>
<description >
Moves the window to the front.
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "native_video_is_playing" >
<return type= "bool" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Returns [code]true[/code] if native video is playing.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "native_video_pause" >
<return type= "void" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Pauses native video playback.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "native_video_play" >
<return type= "int" enum= "Error" >
</return>
<argument index= "0" name= "path" type= "String" >
</argument>
<argument index= "1" name= "volume" type= "float" >
</argument>
<argument index= "2" name= "audio_track" type= "String" >
</argument>
<argument index= "3" name= "subtitle_track" type= "String" >
</argument>
<description >
2017-10-08 17:33:17 +00:00
Plays native video from the specified path, at the given volume and with audio and subtitle tracks.
2018-10-03 13:14:54 +00:00
Note: This method is only implemented on Android and iOS, and the current Android implementation does not support the [code]volume[/code], [code]audio_track[/code] and [code]subtitle_track[/code] options.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "native_video_stop" >
<return type= "void" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Stops native video playback.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "native_video_unpause" >
<return type= "void" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Resumes native video playback.
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-08-29 20:25:11 +00:00
<method name= "open_midi_inputs" >
<return type= "void" >
</return>
<description >
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "print_all_resources" >
<return type= "void" >
</return>
<argument index= "0" name= "tofile" type= "String" default= """" >
</argument>
<description >
2017-10-08 17:33:17 +00:00
Shows all resources in the game. Optionally the list can be written to a file.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "print_all_textures_by_size" >
<return type= "void" >
</return>
<description >
2017-10-08 17:33:17 +00:00
Shows the list of loaded textures sorted by size in memory.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "print_resources_by_type" >
<return type= "void" >
</return>
<argument index= "0" name= "types" type= "PoolStringArray" >
</argument>
<description >
2017-10-08 17:33:17 +00:00
Shows the number of resources loaded by the game of the given types.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "print_resources_in_use" >
<return type= "void" >
</return>
<argument index= "0" name= "short" type= "bool" default= "false" >
</argument>
<description >
2017-10-08 17:33:17 +00:00
Shows all resources currently used by the game.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "request_attention" >
<return type= "void" >
</return>
<description >
Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX.
</description>
</method>
2019-03-05 02:06:37 +00:00
<method name= "request_permission" >
<return type= "bool" >
</return>
2019-03-10 10:28:09 +00:00
<argument index= "0" name= "name" type= "String" >
</argument>
2019-03-05 02:06:37 +00:00
<description >
2019-03-10 10:28:09 +00: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 02:06:37 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "set_icon" >
<return type= "void" >
</return>
<argument index= "0" name= "icon" type= "Image" >
</argument>
<description >
2019-05-17 13:43:56 +00: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.
</description>
</method>
2018-11-23 12:07:48 +00:00
<method name= "set_ime_active" >
<return type= "void" >
</return>
<argument index= "0" name= "active" type= "bool" >
</argument>
<description >
Sets whether IME input mode should be enabled.
2019-06-04 07:30:59 +00: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.
2018-11-23 12:07:48 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "set_ime_position" >
<return type= "void" >
</return>
<argument index= "0" name= "position" type= "Vector2" >
</argument>
<description >
2018-11-23 12:07:48 +00:00
Sets position of IME suggestion list popup (in window coordinates).
2017-09-12 20:42:36 +00:00
</description>
</method>
2019-05-28 16:08:13 +00:00
<method name= "set_native_icon" >
<return type= "void" >
</return>
<argument index= "0" name= "filename" type= "String" >
</argument>
<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.
Note: This method is only implemented on macOS and Windows.
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "set_thread_name" >
<return type= "int" enum= "Error" >
</return>
<argument index= "0" name= "name" type= "String" >
</argument>
<description >
2017-10-08 17:33:17 +00:00
Sets the name of the current thread.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_use_file_access_save_and_swap" >
<return type= "void" >
</return>
<argument index= "0" name= "enabled" type= "bool" >
</argument>
<description >
2017-10-08 17:33:17 +00:00
Enables backup saves if [code]enabled[/code] is [code]true[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-02-19 09:47:16 +00:00
<method name= "set_window_always_on_top" >
<return type= "void" >
</return>
<argument index= "0" name= "enabled" type= "bool" >
</argument>
<description >
2018-04-10 15:05:28 +00:00
Sets whether the window should always be on top.
2018-02-19 09:47:16 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "set_window_title" >
<return type= "void" >
</return>
<argument index= "0" name= "title" type= "String" >
</argument>
<description >
Sets the window title to the specified string.
</description>
</method>
<method name= "shell_open" >
<return type= "int" enum= "Error" >
</return>
<argument index= "0" name= "uri" type= "String" >
</argument>
<description >
2017-10-08 17:33:17 +00: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 downloads folders of the user.
2019-01-07 10:46:26 +00:00
[code]OS.shell_open("https://godotengine.org")[/code] opens the default web browser on the official Godot website.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "show_virtual_keyboard" >
<return type= "void" >
</return>
<argument index= "0" name= "existing_text" type= "String" default= """" >
</argument>
<description >
Shows the virtual keyboard if the platform has one. The [i]existing_text[/i] parameter is useful for implementing your own LineEdit, as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions).
</description>
</method>
</methods>
2018-01-11 22:38:35 +00:00
<members >
<member name= "clipboard" type= "String" setter= "set_clipboard" getter= "get_clipboard" >
The clipboard from the host OS. Might be unavailable on some platforms.
</member>
<member name= "current_screen" type= "int" setter= "set_current_screen" getter= "get_current_screen" >
The current screen index (starting from 0).
</member>
<member name= "exit_code" type= "int" setter= "set_exit_code" getter= "get_exit_code" >
2018-04-10 15:05:28 +00:00
The exit code passed to the OS when the main loop exits.
2018-01-11 22:38:35 +00:00
</member>
<member name= "keep_screen_on" type= "bool" setter= "set_keep_screen_on" getter= "is_keep_screen_on" >
2018-12-20 12:46:54 +00:00
If [code]true[/code], the engine tries to keep the screen on while the game is running. Useful on mobile.
2018-01-11 22:38:35 +00:00
</member>
<member name= "low_processor_usage_mode" type= "bool" setter= "set_low_processor_usage_mode" getter= "is_in_low_processor_usage_mode" >
2018-12-20 12:46:54 +00: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 22:38:35 +00:00
</member>
2018-05-12 07:38:00 +00:00
<member name= "screen_orientation" type= "int" setter= "set_screen_orientation" getter= "get_screen_orientation" enum= "_OS.ScreenOrientation" >
2018-01-11 22:38:35 +00:00
The current screen orientation.
</member>
<member name= "vsync_enabled" type= "bool" setter= "set_use_vsync" getter= "is_vsync_enabled" >
2018-12-20 12:46:54 +00:00
If [code]true[/code], vertical synchronization (Vsync) is enabled.
2018-01-11 22:38:35 +00:00
</member>
<member name= "window_borderless" type= "bool" setter= "set_borderless_window" getter= "get_borderless_window" >
2018-12-20 12:46:54 +00:00
If [code]true[/code], removes the window frame.
2018-01-11 22:38:35 +00:00
</member>
<member name= "window_fullscreen" type= "bool" setter= "set_window_fullscreen" getter= "is_window_fullscreen" >
2018-12-20 12:46:54 +00:00
If [code]true[/code], the window is fullscreen.
2018-01-11 22:38:35 +00:00
</member>
<member name= "window_maximized" type= "bool" setter= "set_window_maximized" getter= "is_window_maximized" >
2018-12-20 12:46:54 +00:00
If [code]true[/code], the window is maximized.
2018-01-11 22:38:35 +00:00
</member>
<member name= "window_minimized" type= "bool" setter= "set_window_minimized" getter= "is_window_minimized" >
2018-12-20 12:46:54 +00:00
If [code]true[/code], the window is minimized.
2018-01-11 22:38:35 +00:00
</member>
2018-05-12 07:38:00 +00:00
<member name= "window_per_pixel_transparency_enabled" type= "bool" setter= "set_window_per_pixel_transparency_enabled" getter= "get_window_per_pixel_transparency_enabled" >
</member>
2018-01-11 22:38:35 +00:00
<member name= "window_position" type= "Vector2" setter= "set_window_position" getter= "get_window_position" >
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>
<member name= "window_resizable" type= "bool" setter= "set_window_resizable" getter= "is_window_resizable" >
If [code]true[/code], the window is resizable by the user.
</member>
<member name= "window_size" type= "Vector2" setter= "set_window_size" getter= "get_window_size" >
The size of the window (without counting window manager decorations).
</member>
</members>
2017-09-12 20:42:36 +00:00
<constants >
2019-02-16 13:40:52 +00: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 22:16:30 +00:00
<constant name= "DAY_SUNDAY" value= "0" enum= "Weekday" >
2018-04-10 15:05:28 +00:00
Sunday.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "DAY_MONDAY" value= "1" enum= "Weekday" >
2018-04-10 15:05:28 +00:00
Monday.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "DAY_TUESDAY" value= "2" enum= "Weekday" >
2018-04-10 15:05:28 +00:00
Tuesday.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "DAY_WEDNESDAY" value= "3" enum= "Weekday" >
2018-04-10 15:05:28 +00:00
Wednesday.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "DAY_THURSDAY" value= "4" enum= "Weekday" >
2018-04-10 15:05:28 +00:00
Thursday.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "DAY_FRIDAY" value= "5" enum= "Weekday" >
2018-04-10 15:05:28 +00:00
Friday.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "DAY_SATURDAY" value= "6" enum= "Weekday" >
2018-04-10 15:05:28 +00:00
Saturday.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_JANUARY" value= "1" enum= "Month" >
2018-04-10 15:05:28 +00:00
January.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_FEBRUARY" value= "2" enum= "Month" >
2018-04-10 15:05:28 +00:00
February.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_MARCH" value= "3" enum= "Month" >
2018-04-10 15:05:28 +00:00
March.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_APRIL" value= "4" enum= "Month" >
2018-04-10 15:05:28 +00:00
April.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_MAY" value= "5" enum= "Month" >
2018-04-10 15:05:28 +00:00
May.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_JUNE" value= "6" enum= "Month" >
2018-04-10 15:05:28 +00:00
June.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_JULY" value= "7" enum= "Month" >
2018-04-10 15:05:28 +00:00
July.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_AUGUST" value= "8" enum= "Month" >
2018-04-10 15:05:28 +00:00
August.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_SEPTEMBER" value= "9" enum= "Month" >
2018-04-10 15:05:28 +00:00
September.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_OCTOBER" value= "10" enum= "Month" >
2018-04-10 15:05:28 +00:00
October.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_NOVEMBER" value= "11" enum= "Month" >
2018-04-10 15:05:28 +00:00
November.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "MONTH_DECEMBER" value= "12" enum= "Month" >
2018-04-10 15:05:28 +00:00
December.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SCREEN_ORIENTATION_LANDSCAPE" value= "0" enum= "ScreenOrientation" >
2018-04-10 15:05:28 +00:00
Landscape screen orientation.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SCREEN_ORIENTATION_PORTRAIT" value= "1" enum= "ScreenOrientation" >
2018-04-10 15:05:28 +00:00
Portrait screen orientation.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SCREEN_ORIENTATION_REVERSE_LANDSCAPE" value= "2" enum= "ScreenOrientation" >
2018-04-10 15:05:28 +00:00
Reverse landscape screen orientation.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SCREEN_ORIENTATION_REVERSE_PORTRAIT" value= "3" enum= "ScreenOrientation" >
2018-04-10 15:05:28 +00:00
Reverse portrait screen orientation.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SCREEN_ORIENTATION_SENSOR_LANDSCAPE" value= "4" enum= "ScreenOrientation" >
2018-04-10 15:05:28 +00:00
Uses landscape or reverse landscape based on the hardware sensor.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SCREEN_ORIENTATION_SENSOR_PORTRAIT" value= "5" enum= "ScreenOrientation" >
2018-04-10 15:05:28 +00:00
Uses portrait or reverse portrait based on the hardware sensor.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SCREEN_ORIENTATION_SENSOR" value= "6" enum= "ScreenOrientation" >
2018-04-10 15:05:28 +00:00
Uses most suitable orientation based on the hardware sensor.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SYSTEM_DIR_DESKTOP" value= "0" enum= "SystemDir" >
2018-04-10 15:05:28 +00:00
Desktop directory path.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SYSTEM_DIR_DCIM" value= "1" enum= "SystemDir" >
2018-04-10 15:05:28 +00:00
DCIM (Digital Camera Images) directory path.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SYSTEM_DIR_DOCUMENTS" value= "2" enum= "SystemDir" >
2018-04-10 15:05:28 +00:00
Documents directory path.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SYSTEM_DIR_DOWNLOADS" value= "3" enum= "SystemDir" >
2018-04-10 15:05:28 +00:00
Downloads directory path.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SYSTEM_DIR_MOVIES" value= "4" enum= "SystemDir" >
2018-04-10 15:05:28 +00:00
Movies directory path.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SYSTEM_DIR_MUSIC" value= "5" enum= "SystemDir" >
2018-04-10 15:05:28 +00:00
Music directory path.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SYSTEM_DIR_PICTURES" value= "6" enum= "SystemDir" >
2018-04-10 15:05:28 +00:00
Pictures directory path.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "SYSTEM_DIR_RINGTONES" value= "7" enum= "SystemDir" >
2018-04-10 15:05:28 +00:00
Ringtones directory path.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "POWERSTATE_UNKNOWN" value= "0" enum= "PowerState" >
2018-04-10 15:05:28 +00:00
Unknown powerstate.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "POWERSTATE_ON_BATTERY" value= "1" enum= "PowerState" >
2018-04-10 15:05:28 +00:00
Unplugged, running on battery.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "POWERSTATE_NO_BATTERY" value= "2" enum= "PowerState" >
2018-04-10 15:05:28 +00:00
Plugged in, no battery available.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "POWERSTATE_CHARGING" value= "3" enum= "PowerState" >
2018-04-10 15:05:28 +00:00
Plugged in, battery charging.
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "POWERSTATE_CHARGED" value= "4" enum= "PowerState" >
2018-04-10 15:05:28 +00:00
Plugged in, battery fully charged.
2017-09-12 20:42:36 +00:00
</constant>
</constants>
</class>