Browse Source

Sync classref with 3.2 branch

Rémi Verschelde 5 years ago
parent
commit
859d322e96

+ 8 - 8
classes/[email protected]

@@ -814,14 +814,14 @@ Converts from linear energy to decibels (audio). This can be used to implement v
 
 - :ref:`Resource<class_Resource>` **load** **(** :ref:`String<class_String>` path **)**
 
-Loads a resource from the filesystem located at ``path``.
+Loads a resource from the filesystem located at ``path``. The resource is loaded on the method call (unless it's referenced already elsewhere, e.g. in another script or in the scene), which might cause slight delay, especially when loading scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use :ref:`preload<class_@GDScript_method_preload>`.
 
-**Note:** Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing **Copy Path**.
+**Note:** Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script.
 
 ::
 
-    # Load a scene called main located in the root of the project directory.
-    var main = load("res://main.tscn")
+    # Load a scene called main located in the root of the project directory and cache it in a variable.
+    var main = load("res://main.tscn") # main will contain a PackedScene resource.
 
 **Important:** The path must be absolute, a local path will just return ``null``.
 
@@ -986,14 +986,14 @@ Returns the result of ``x`` raised to the power of ``y``.
 
 - :ref:`Resource<class_Resource>` **preload** **(** :ref:`String<class_String>` path **)**
 
-Returns a resource from the filesystem that is loaded during script parsing.
+Returns a :ref:`Resource<class_Resource>` from the filesystem located at ``path``. The resource is loaded during script parsing, i.e. is loaded with the script and :ref:`preload<class_@GDScript_method_preload>` effectively acts as a reference to that resource. Note that the method requires a constant path. If you want to load a resource from a dynamic/variable path, use :ref:`load<class_@GDScript_method_load>`.
 
-**Note:** Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path".
+**Note:** Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script.
 
 ::
 
-    # Load a scene called main located in the root of the project directory.
-    var main = preload("res://main.tscn")
+    # Instance a scene.
+    var diamond = preload("res://diamond.tscn").instance()
 
 ----
 

+ 2 - 0
classes/class_editorinterface.rst

@@ -93,6 +93,8 @@ Property Descriptions
 | *Getter* | is_distraction_free_mode_enabled() |
 +----------+------------------------------------+
 
+If ``true``, enables distraction-free mode which hides side docks to increase the space available for the main view.
+
 Method Descriptions
 -------------------
 

+ 9 - 0
classes/class_geometry.rst

@@ -367,6 +367,15 @@ Each polygon's vertices will be rounded as determined by ``join_type``, see :ref
 
 The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling :ref:`is_polygon_clockwise<class_Geometry_method_is_polygon_clockwise>`.
 
+**Note:** To translate the polygon's vertices specifically, use the :ref:`Transform2D.xform<class_Transform2D_method_xform>` method:
+
+::
+
+    var polygon = PoolVector2Array([Vector2(0, 0), Vector2(100, 0), Vector2(100, 100), Vector2(0, 100)])
+    var offset = Vector2(50, 50)
+    polygon = Transform2D(0, offset).xform(polygon)
+    print(polygon) # prints [Vector2(50, 50), Vector2(150, 50), Vector2(150, 150), Vector2(50, 150)]
+
 ----
 
 .. _class_Geometry_method_offset_polyline_2d:

+ 10 - 0
classes/class_image.rst

@@ -105,6 +105,8 @@ Methods
 +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | :ref:`Error<enum_@GlobalScope_Error>`     | :ref:`load_png_from_buffer<class_Image_method_load_png_from_buffer>` **(** :ref:`PoolByteArray<class_PoolByteArray>` buffer **)**                                                                                                                                |
 +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| :ref:`Error<enum_@GlobalScope_Error>`     | :ref:`load_tga_from_buffer<class_Image_method_load_tga_from_buffer>` **(** :ref:`PoolByteArray<class_PoolByteArray>` buffer **)**                                                                                                                                |
++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | :ref:`Error<enum_@GlobalScope_Error>`     | :ref:`load_webp_from_buffer<class_Image_method_load_webp_from_buffer>` **(** :ref:`PoolByteArray<class_PoolByteArray>` buffer **)**                                                                                                                              |
 +-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | void                                      | :ref:`lock<class_Image_method_lock>` **(** **)**                                                                                                                                                                                                                 |
@@ -734,6 +736,14 @@ Loads an image from the binary contents of a PNG file.
 
 ----
 
+.. _class_Image_method_load_tga_from_buffer:
+
+- :ref:`Error<enum_@GlobalScope_Error>` **load_tga_from_buffer** **(** :ref:`PoolByteArray<class_PoolByteArray>` buffer **)**
+
+Loads an image from the binary contents of a TGA file.
+
+----
+
 .. _class_Image_method_load_webp_from_buffer:
 
 - :ref:`Error<enum_@GlobalScope_Error>` **load_webp_from_buffer** **(** :ref:`PoolByteArray<class_PoolByteArray>` buffer **)**

+ 14 - 0
classes/class_projectsettings.rst

@@ -78,6 +78,8 @@ Properties
 +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+
 | :ref:`int<class_int>`                         | :ref:`audio/output_latency<class_ProjectSettings_property_audio/output_latency>`                                                                                     | ``15``                                                                                          |
 +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+
+| :ref:`int<class_int>`                         | :ref:`audio/output_latency.web<class_ProjectSettings_property_audio/output_latency.web>`                                                                             | ``50``                                                                                          |
++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+
 | :ref:`int<class_int>`                         | :ref:`audio/video_delay_compensation_ms<class_ProjectSettings_property_audio/video_delay_compensation_ms>`                                                           | ``0``                                                                                           |
 +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+
 | :ref:`int<class_int>`                         | :ref:`compression/formats/gzip/compression_level<class_ProjectSettings_property_compression/formats/gzip/compression_level>`                                         | ``-1``                                                                                          |
@@ -1025,6 +1027,18 @@ Output latency in milliseconds for audio. Lower values will result in lower audi
 
 ----
 
+.. _class_ProjectSettings_property_audio/output_latency.web:
+
+- :ref:`int<class_int>` **audio/output_latency.web**
+
++-----------+--------+
+| *Default* | ``50`` |
++-----------+--------+
+
+Safer override for :ref:`audio/output_latency<class_ProjectSettings_property_audio/output_latency>` in the Web platform, to avoid audio issues especially on mobile devices.
+
+----
+
 .. _class_ProjectSettings_property_audio/video_delay_compensation_ms:
 
 - :ref:`int<class_int>` **audio/video_delay_compensation_ms**

+ 1 - 1
classes/class_string.rst

@@ -419,7 +419,7 @@ Returns a copy of the string with escaped characters replaced by their meanings
 
 - :ref:`String<class_String>` **capitalize** **(** **)**
 
-Changes the case of some letters. Replaces underscores with spaces, converts all letters to lowercase, then capitalizes first and every letter following the space character. For ``capitalize camelCase mixed_with_underscores``, it will return ``Capitalize Camelcase Mixed With Underscores``.
+Changes the case of some letters. Replaces underscores with spaces, adds spaces before in-word uppercase characters, converts all letters to lowercase, then capitalizes the first letter and every letter following a space character. For ``capitalize camelCase mixed_with_underscores``, it will return ``Capitalize Camel Case Mixed With Underscores``.
 
 ----
 

+ 16 - 0
classes/class_textedit.rst

@@ -582,6 +582,8 @@ If ``true``, the line containing the cursor is highlighted.
 | *Getter*  | is_drawing_minimap() |
 +-----------+----------------------+
 
+If ``true``, a minimap is shown, providing an outline of your source code.
+
 ----
 
 .. _class_TextEdit_property_minimap_width:
@@ -596,6 +598,8 @@ If ``true``, the line containing the cursor is highlighted.
 | *Getter*  | get_minimap_width()      |
 +-----------+--------------------------+
 
+The width, in pixels, of the minimap.
+
 ----
 
 .. _class_TextEdit_property_override_selected_font_color:
@@ -674,6 +678,10 @@ The current vertical scroll value.
 | *Getter*  | is_selecting_enabled()       |
 +-----------+------------------------------+
 
+If ``true``, text can be selected.
+
+If ``false``, text can not be selected by the user or by the :ref:`select<class_TextEdit_method_select>` or :ref:`select_all<class_TextEdit_method_select_all>` methods.
+
 ----
 
 .. _class_TextEdit_property_shortcut_keys_enabled:
@@ -688,6 +696,8 @@ The current vertical scroll value.
 | *Getter*  | is_shortcut_keys_enabled()       |
 +-----------+----------------------------------+
 
+If ``true``, shortcut keys for context menu items are enabled, even if the context menu is disabled.
+
 ----
 
 .. _class_TextEdit_property_show_line_numbers:
@@ -815,6 +825,8 @@ Returns if the given line is foldable, that is, it has indented lines right belo
 
 - void **center_viewport_to_cursor** **(** **)**
 
+Centers the viewport on the line the editing cursor is at. This also resets the :ref:`scroll_horizontal<class_TextEdit_property_scroll_horizontal>` value to ``0``.
+
 ----
 
 .. _class_TextEdit_method_clear_colors:
@@ -1095,6 +1107,8 @@ Returns an empty ``PoolIntArray`` if no result was found. Otherwise, the result
 
 Perform selection, from line/column to line/column.
 
+If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
+
 ----
 
 .. _class_TextEdit_method_select_all:
@@ -1103,6 +1117,8 @@ Perform selection, from line/column to line/column.
 
 Select all the text.
 
+If :ref:`selecting_enabled<class_TextEdit_property_selecting_enabled>` is ``false``, no selection will occur.
+
 ----
 
 .. _class_TextEdit_method_set_line:

+ 1 - 1
classes/class_vector2.rst

@@ -194,7 +194,7 @@ Returns a new vector with all components in absolute values (i.e. positive).
 
 Returns the vector's angle in radians with respect to the X axis, or ``(1, 0)`` vector.
 
-Equivalent to the result of :ref:`@GDScript.atan2<class_@GDScript_method_atan2>` when called with the vector's :ref:`x<class_Vector2_property_x>` and :ref:`y<class_Vector2_property_y>` as parameters: ``atan2(x, y)``.
+Equivalent to the result of :ref:`@GDScript.atan2<class_@GDScript_method_atan2>` when called with the vector's :ref:`y<class_Vector2_property_y>` and :ref:`x<class_Vector2_property_x>` as parameters: ``atan2(y, x)``.
 
 ----