summaryrefslogtreecommitdiff
path: root/doc/classes/OS.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/OS.xml')
-rw-r--r--doc/classes/OS.xml95
1 files changed, 81 insertions, 14 deletions
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index e218949757..dd0fcd63e7 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="OS" inherits="Object" category="Core" version="3.1">
+<class name="OS" inherits="Object" category="Core" version="3.2">
<brief_description>
Operating System functions.
</brief_description>
@@ -8,8 +8,6 @@
</description>
<tutorials>
</tutorials>
- <demos>
- </demos>
<methods>
<method name="alert">
<return type="void">
@@ -99,6 +97,8 @@
</argument>
<argument index="3" name="output" type="Array" default="[ ]">
</argument>
+ <argument index="4" name="read_stderr" type="bool" default="false">
+ </argument>
<description>
Execute the file at the given path with the arguments passed as an array of strings. Platform path resolution will take place. The resolved file must exist and be executable.
The arguments are used in the given order and separated by a space, so [code]OS.execute('ping', ['-w', '3', 'godotengine.org'], false)[/code] will resolve to [code]ping -w 3 godotengine.org[/code] in the system's shell.
@@ -159,6 +159,13 @@
<description>
</description>
</method>
+ <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>
<method name="get_date" qualifiers="const">
<return type="Dictionary">
</return>
@@ -210,6 +217,20 @@
Returns the path to the current engine executable.
</description>
</method>
+ <method name="get_ime_selection" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <description>
+ Returns IME selection range.
+ </description>
+ </method>
+ <method name="get_ime_text" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ Returns IME intermediate text.
+ </description>
+ </method>
<method name="get_latin_keyboard_variant" qualifiers="const">
<return type="String">
</return>
@@ -357,7 +378,14 @@
<argument index="0" name="dir" type="int" enum="OS.SystemDir">
</argument>
<description>
- Returns the actual path to commonly used folders across different platforms. Available locations are specified in [OS.SystemDir].
+ Returns the actual path to commonly used folders across different platforms. Available locations are specified in [enum OS.SystemDir].
+ </description>
+ </method>
+ <method name="get_system_time_msecs" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the epoch time of the operating system in milliseconds.
</description>
</method>
<method name="get_system_time_secs" qualifiers="const">
@@ -438,14 +466,16 @@
<return type="int">
</return>
<description>
+ Returns the number of video drivers supported on the current platform.
</description>
</method>
<method name="get_video_driver_name" qualifiers="const">
<return type="String">
</return>
- <argument index="0" name="driver" type="int">
+ <argument index="0" name="driver" type="int" enum="OS.VideoDriver">
</argument>
<description>
+ 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.
</description>
</method>
<method name="get_virtual_keyboard_height">
@@ -654,13 +684,32 @@
Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX.
</description>
</method>
+ <method name="request_permission">
+ <return type="bool">
+ </return>
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ At the moment this function is only used by [code]AudioDriverOpenSL[/code] to request permission for [code]RECORD_AUDIO[/code] on Android.
+ </description>
+ </method>
<method name="set_icon">
<return type="void">
</return>
<argument index="0" name="icon" type="Image">
</argument>
<description>
- Sets the game's icon.
+ 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>
+ <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.
</description>
</method>
<method name="set_ime_position">
@@ -669,6 +718,18 @@
<argument index="0" name="position" type="Vector2">
</argument>
<description>
+ Sets position of IME suggestion list popup (in window coordinates).
+ </description>
+ </method>
+ <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>
<method name="set_thread_name">
@@ -715,7 +776,7 @@
<description>
Requests the OS to open a resource with the most appropriate program. For example.
[code]OS.shell_open("C:\\Users\name\Downloads")[/code] on Windows opens the file explorer at the downloads folders of the user.
- [code]OS.shell_open("http://godotengine.org")[/code] opens the default web browser on the official Godot website.
+ [code]OS.shell_open("https://godotengine.org")[/code] opens the default web browser on the official Godot website.
</description>
</method>
<method name="show_virtual_keyboard">
@@ -739,28 +800,28 @@
The exit code passed to the OS when the main loop exits.
</member>
<member name="keep_screen_on" type="bool" setter="set_keep_screen_on" getter="is_keep_screen_on">
- If [code]true[/code] the engine tries to keep the screen on while the game is running. Useful on mobile.
+ If [code]true[/code], the engine tries to keep the screen on while the game is running. Useful on mobile.
</member>
<member name="low_processor_usage_mode" type="bool" setter="set_low_processor_usage_mode" getter="is_in_low_processor_usage_mode">
- If [code]true[/code] the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile.
+ If [code]true[/code], the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile.
</member>
<member name="screen_orientation" type="int" setter="set_screen_orientation" getter="get_screen_orientation" enum="_OS.ScreenOrientation">
The current screen orientation.
</member>
<member name="vsync_enabled" type="bool" setter="set_use_vsync" getter="is_vsync_enabled">
- If [code]true[/code] vertical synchronization (Vsync) is enabled.
+ If [code]true[/code], vertical synchronization (Vsync) is enabled.
</member>
<member name="window_borderless" type="bool" setter="set_borderless_window" getter="get_borderless_window">
- If [code]true[/code] removes the window frame.
+ If [code]true[/code], removes the window frame.
</member>
<member name="window_fullscreen" type="bool" setter="set_window_fullscreen" getter="is_window_fullscreen">
- If [code]true[/code] the window is fullscreen.
+ If [code]true[/code], the window is fullscreen.
</member>
<member name="window_maximized" type="bool" setter="set_window_maximized" getter="is_window_maximized">
- If [code]true[/code] the window is maximized.
+ If [code]true[/code], the window is maximized.
</member>
<member name="window_minimized" type="bool" setter="set_window_minimized" getter="is_window_minimized">
- If [code]true[/code] the window is minimized.
+ If [code]true[/code], the window is minimized.
</member>
<member name="window_per_pixel_transparency_enabled" type="bool" setter="set_window_per_pixel_transparency_enabled" getter="get_window_per_pixel_transparency_enabled">
</member>
@@ -775,6 +836,12 @@
</member>
</members>
<constants>
+ <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>
<constant name="DAY_SUNDAY" value="0" enum="Weekday">
Sunday.
</constant>