[DOCS] - Completes the docs for the OS class

This commit is contained in:
David Saltares 2017-10-08 18:33:17 +01:00
parent 84e7bbafb7
commit ee513aba44

View file

@ -26,14 +26,14 @@
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return true if the host OS allows drawing. Returns [code]true[/code] if the host OS allows drawing.
</description> </description>
</method> </method>
<method name="can_use_threads" qualifiers="const"> <method name="can_use_threads" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns if the current host platform is using multiple threads. Returns [code]true[/code] if the current host platform is using multiple threads.
</description> </description>
</method> </method>
<method name="delay_msec" qualifiers="const"> <method name="delay_msec" qualifiers="const">
@ -117,7 +117,7 @@
<return type="PoolStringArray"> <return type="PoolStringArray">
</return> </return>
<description> <description>
Return the commandline passed to the engine. Returns the command line arguments passed to the engine.
</description> </description>
</method> </method>
<method name="get_current_screen" qualifiers="const"> <method name="get_current_screen" qualifiers="const">
@ -131,7 +131,7 @@
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Return the absolute directory path of user data path([user://]). Returns the absolute directory path of user data path([user://]).
</description> </description>
</method> </method>
<method name="get_date" qualifiers="const"> <method name="get_date" qualifiers="const">
@ -166,7 +166,7 @@
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the total amount of dynamic memory used (only works in debug). Returns the total amount of dynamic memory used (only works in debug).
</description> </description>
</method> </method>
<method name="get_environment" qualifiers="const"> <method name="get_environment" qualifiers="const">
@ -175,14 +175,14 @@
<argument index="0" name="environment" type="String"> <argument index="0" name="environment" type="String">
</argument> </argument>
<description> <description>
Return an environment variable. Returns an environment variable.
</description> </description>
</method> </method>
<method name="get_executable_path" qualifiers="const"> <method name="get_executable_path" qualifiers="const">
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Return the path to the current engine executable. Returns the path to the current engine executable.
</description> </description>
</method> </method>
<method name="get_exit_code" qualifiers="const"> <method name="get_exit_code" qualifiers="const">
@ -203,7 +203,7 @@
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Return the host OS locale. Returns the host OS locale.
</description> </description>
</method> </method>
<method name="get_model_name" qualifiers="const"> <method name="get_model_name" qualifiers="const">
@ -217,25 +217,28 @@
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Return the name of the host OS. Possible values are: "Android", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "UWP", "X11". Returns the name of the host OS. Possible values are: "Android", "Haiku", "iOS", "HTML5", "OSX", "Server", "Windows", "UWP", "X11".
</description> </description>
</method> </method>
<method name="get_power_percent_left"> <method name="get_power_percent_left">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the amount of battery left in the device as a percentage.
</description> </description>
</method> </method>
<method name="get_power_seconds_left"> <method name="get_power_seconds_left">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the time in seconds before the device runs out of battery.
</description> </description>
</method> </method>
<method name="get_power_state"> <method name="get_power_state">
<return type="int" enum="OS.PowerState"> <return type="int" enum="OS.PowerState">
</return> </return>
<description> <description>
Returns the current state of the device regarding battery and power. See [code]POWERSTATE_*[/code] constants.
</description> </description>
</method> </method>
<method name="get_process_id" qualifiers="const"> <method name="get_process_id" qualifiers="const">
@ -265,7 +268,7 @@
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the number of displays attached to the host machine Returns the number of displays attached to the host machine.
</description> </description>
</method> </method>
<method name="get_screen_dpi" qualifiers="const"> <method name="get_screen_dpi" qualifiers="const">
@ -298,6 +301,7 @@
<argument index="0" name="screen" type="int" default="-1"> <argument index="0" name="screen" type="int" default="-1">
</argument> </argument>
<description> <description>
Returns the position of the specified screen by index. If no screen index is provided, the current screen will be used.
</description> </description>
</method> </method>
<method name="get_screen_size" qualifiers="const"> <method name="get_screen_size" qualifiers="const">
@ -319,7 +323,7 @@
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the max amount of static memory used (only works in debug). Returns the max amount of static memory used (only works in debug).
</description> </description>
</method> </method>
<method name="get_static_memory_usage" qualifiers="const"> <method name="get_static_memory_usage" qualifiers="const">
@ -335,6 +339,7 @@
<argument index="0" name="dir" type="int" enum="OS.SystemDir"> <argument index="0" name="dir" type="int" enum="OS.SystemDir">
</argument> </argument>
<description> <description>
Returns the actual path to commonly used folders across different platforms. Available locations are specified in [OS.SystemDir].
</description> </description>
</method> </method>
<method name="get_system_time_secs" qualifiers="const"> <method name="get_system_time_secs" qualifiers="const">
@ -348,7 +353,7 @@
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the amount of time passed in milliseconds since the engine started. Returns the amount of time passed in milliseconds since the engine started.
</description> </description>
</method> </method>
<method name="get_time" qualifiers="const"> <method name="get_time" qualifiers="const">
@ -357,19 +362,21 @@
<argument index="0" name="utc" type="bool" default="false"> <argument index="0" name="utc" type="bool" default="false">
</argument> </argument>
<description> <description>
Returns current time as a dictionary of keys: hour, minute, second Returns current time as a dictionary of keys: hour, minute, second.
</description> </description>
</method> </method>
<method name="get_time_zone_info" qualifiers="const"> <method name="get_time_zone_info" qualifiers="const">
<return type="Dictionary"> <return type="Dictionary">
</return> </return>
<description> <description>
Returns the current time zone as a dictionary with the keys: bias and name.
</description> </description>
</method> </method>
<method name="get_unique_id" qualifiers="const"> <method name="get_unique_id" qualifiers="const">
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Returns a unique string.
</description> </description>
</method> </method>
<method name="get_unix_time" qualifiers="const"> <method name="get_unix_time" qualifiers="const">
@ -410,20 +417,21 @@
<argument index="0" name="environment" type="String"> <argument index="0" name="environment" type="String">
</argument> </argument>
<description> <description>
Return true if an environment variable exists. Returns [code]true[/code] if an environment variable exists.
</description> </description>
</method> </method>
<method name="has_touchscreen_ui_hint" qualifiers="const"> <method name="has_touchscreen_ui_hint" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns [code]true[/code] if the device has a touchscreen or emulates one.
</description> </description>
</method> </method>
<method name="has_virtual_keyboard" qualifiers="const"> <method name="has_virtual_keyboard" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns true if the platform has a virtual keyboard, false otherwise. Returns [code]true[/code] if the platform has a virtual keyboard, [code]false[/code] otherwise.
</description> </description>
</method> </method>
<method name="hide_virtual_keyboard"> <method name="hide_virtual_keyboard">
@ -446,20 +454,21 @@
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return true if low cpu usage mode is enabled. Returns [code]true[/code] if low cpu usage mode is enabled.
</description> </description>
</method> </method>
<method name="is_keep_screen_on" qualifiers="const"> <method name="is_keep_screen_on" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns whether the screen is being kept on or not. Returns [code]true[/code] if the screen is being kept on.
</description> </description>
</method> </method>
<method name="is_ok_left_and_cancel_right" qualifiers="const"> <method name="is_ok_left_and_cancel_right" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns [code]true[/code] if the "Okay" button should appear on the left and "Cancel" on the right.
</description> </description>
</method> </method>
<method name="is_scancode_unicode" qualifiers="const"> <method name="is_scancode_unicode" qualifiers="const">
@ -468,13 +477,14 @@
<argument index="0" name="code" type="int"> <argument index="0" name="code" type="int">
</argument> </argument>
<description> <description>
Returns [code]true[/code] if the input code has a unicode character.
</description> </description>
</method> </method>
<method name="is_stdout_verbose" qualifiers="const"> <method name="is_stdout_verbose" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return true if the engine was executed with -v (verbose stdout). Returns [code]true[/code] if the engine was executed with -v (verbose stdout).
</description> </description>
</method> </method>
<method name="is_userfs_persistent" qualifiers="const"> <method name="is_userfs_persistent" qualifiers="const">
@ -495,28 +505,28 @@
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns whether the window is in fullscreen mode or not. Returns [code]true[/code] if the window is in fullscreen mode.
</description> </description>
</method> </method>
<method name="is_window_maximized" qualifiers="const"> <method name="is_window_maximized" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return true if the window is maximized. Returns [code]true[/code] if the window is maximized.
</description> </description>
</method> </method>
<method name="is_window_minimized" qualifiers="const"> <method name="is_window_minimized" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return true if the window is minimized. Returns [code]true[/code] if the window is minimized.
</description> </description>
</method> </method>
<method name="is_window_resizable" qualifiers="const"> <method name="is_window_resizable" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns whether the window is resizable or not. Returns [code]true[/code] if the window is resizable.
</description> </description>
</method> </method>
<method name="kill"> <method name="kill">
@ -532,12 +542,14 @@
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns [code]true[/code] if native video is playing.
</description> </description>
</method> </method>
<method name="native_video_pause"> <method name="native_video_pause">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Pauses native video playback.
</description> </description>
</method> </method>
<method name="native_video_play"> <method name="native_video_play">
@ -552,18 +564,21 @@
<argument index="3" name="subtitle_track" type="String"> <argument index="3" name="subtitle_track" type="String">
</argument> </argument>
<description> <description>
Plays native video from the specified path, at the given volume and with audio and subtitle tracks.
</description> </description>
</method> </method>
<method name="native_video_stop"> <method name="native_video_stop">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Stops native video playback.
</description> </description>
</method> </method>
<method name="native_video_unpause"> <method name="native_video_unpause">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Resumes native video playback.
</description> </description>
</method> </method>
<method name="print_all_resources"> <method name="print_all_resources">
@ -572,12 +587,14 @@
<argument index="0" name="tofile" type="String" default="&quot;&quot;"> <argument index="0" name="tofile" type="String" default="&quot;&quot;">
</argument> </argument>
<description> <description>
Shows all resources in the game. Optionally the list can be written to a file.
</description> </description>
</method> </method>
<method name="print_all_textures_by_size"> <method name="print_all_textures_by_size">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Shows the list of loaded textures sorted by size in memory.
</description> </description>
</method> </method>
<method name="print_resources_by_type"> <method name="print_resources_by_type">
@ -586,6 +603,7 @@
<argument index="0" name="types" type="PoolStringArray"> <argument index="0" name="types" type="PoolStringArray">
</argument> </argument>
<description> <description>
Shows the number of resources loaded by the game of the given types.
</description> </description>
</method> </method>
<method name="print_resources_in_use"> <method name="print_resources_in_use">
@ -594,6 +612,7 @@
<argument index="0" name="short" type="bool" default="false"> <argument index="0" name="short" type="bool" default="false">
</argument> </argument>
<description> <description>
Shows all resources currently used by the game.
</description> </description>
</method> </method>
<method name="request_attention"> <method name="request_attention">
@ -609,6 +628,7 @@
<argument index="0" name="borderless" type="bool"> <argument index="0" name="borderless" type="bool">
</argument> </argument>
<description> <description>
Removes the window frame.
</description> </description>
</method> </method>
<method name="set_clipboard"> <method name="set_clipboard">
@ -617,7 +637,7 @@
<argument index="0" name="clipboard" type="String"> <argument index="0" name="clipboard" type="String">
</argument> </argument>
<description> <description>
Set clipboard to the OS. Sets clipboard to the OS.
</description> </description>
</method> </method>
<method name="set_current_screen"> <method name="set_current_screen">
@ -626,6 +646,7 @@
<argument index="0" name="screen" type="int"> <argument index="0" name="screen" type="int">
</argument> </argument>
<description> <description>
Sets the current screen by index.
</description> </description>
</method> </method>
<method name="set_exit_code"> <method name="set_exit_code">
@ -634,6 +655,7 @@
<argument index="0" name="code" type="int"> <argument index="0" name="code" type="int">
</argument> </argument>
<description> <description>
Sets the exit code that will be returned by the game.
</description> </description>
</method> </method>
<method name="set_icon"> <method name="set_icon">
@ -642,6 +664,7 @@
<argument index="0" name="icon" type="Image"> <argument index="0" name="icon" type="Image">
</argument> </argument>
<description> <description>
Sets the game's icon.
</description> </description>
</method> </method>
<method name="set_ime_position"> <method name="set_ime_position">
@ -658,7 +681,7 @@
<argument index="0" name="enabled" type="bool"> <argument index="0" name="enabled" type="bool">
</argument> </argument>
<description> <description>
Set keep screen on if true, or goes to sleep by device setting if false. (for Android/iOS) Sets keep screen on if true, or goes to sleep by device setting if false. (for Android/iOS)
</description> </description>
</method> </method>
<method name="set_low_processor_usage_mode"> <method name="set_low_processor_usage_mode">
@ -667,7 +690,7 @@
<argument index="0" name="enable" type="bool"> <argument index="0" name="enable" type="bool">
</argument> </argument>
<description> <description>
Set to true to enable the low cpu usage mode. In this mode, the screen only redraws when there are changes, and a considerable sleep time is inserted between frames. This way, editors using the engine UI only use very little cpu. Set to [code]true[/code] to enable the low cpu usage mode. In this mode, the screen only redraws when there are changes, and a considerable sleep time is inserted between frames. Use this in tool mode to reduce CPU usage.
</description> </description>
</method> </method>
<method name="set_screen_orientation"> <method name="set_screen_orientation">
@ -685,6 +708,7 @@
<argument index="0" name="name" type="String"> <argument index="0" name="name" type="String">
</argument> </argument>
<description> <description>
Sets the name of the current thread.
</description> </description>
</method> </method>
<method name="set_use_file_access_save_and_swap"> <method name="set_use_file_access_save_and_swap">
@ -693,6 +717,7 @@
<argument index="0" name="enabled" type="bool"> <argument index="0" name="enabled" type="bool">
</argument> </argument>
<description> <description>
Enables backup saves if [code]enabled[/code] is [code]true[/code].
</description> </description>
</method> </method>
<method name="set_use_vsync"> <method name="set_use_vsync">
@ -719,7 +744,7 @@
<argument index="0" name="enabled" type="bool"> <argument index="0" name="enabled" type="bool">
</argument> </argument>
<description> <description>
Set the window size to maximized. Set [code]true[/code] to maximize the window.
</description> </description>
</method> </method>
<method name="set_window_minimized"> <method name="set_window_minimized">
@ -728,7 +753,7 @@
<argument index="0" name="enabled" type="bool"> <argument index="0" name="enabled" type="bool">
</argument> </argument>
<description> <description>
Set whether the window is minimized. Set [code]true[/code] to minimize the window.
</description> </description>
</method> </method>
<method name="set_window_position"> <method name="set_window_position">
@ -746,7 +771,7 @@
<argument index="0" name="enabled" type="bool"> <argument index="0" name="enabled" type="bool">
</argument> </argument>
<description> <description>
Set the window resizable state, if the window is not resizable it will preserve the dimensions specified in the project settings. Sets the window resizable state, if the window is not resizable it will preserve the dimensions specified in the project settings.
</description> </description>
</method> </method>
<method name="set_window_size"> <method name="set_window_size">
@ -773,6 +798,9 @@
<argument index="0" name="uri" type="String"> <argument index="0" name="uri" type="String">
</argument> </argument>
<description> <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.
</description> </description>
</method> </method>
<method name="show_virtual_keyboard"> <method name="show_virtual_keyboard">