classref: Sync with current master branch (c64afeb)

This commit is contained in:
Godot Organization
2023-05-13 03:19:02 +00:00
parent 0757559a3a
commit 6febc8ee06
274 changed files with 16684 additions and 4675 deletions
+41 -7
View File
@@ -133,7 +133,7 @@ Mark the following property as exported (editable in the Inspector dock and save
@export var string = ""
@export var int_number = 5
@export var float_number: float = 5
@export var image : Image
@export var image: Image
.. rst-class:: classref-item-separator
@@ -173,7 +173,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_COLOR_NO_ALPHA<class_@GlobalScope_cons
::
@export_color_no_alpha var dye_color : Color
@export_color_no_alpha var dye_color: Color
.. rst-class:: classref-item-separator
@@ -418,6 +418,24 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_3D_RENDER<class_@GlobalScope_co
----
.. _class_@GDScript_annotation_@export_flags_avoidance:
.. rst-class:: classref-annotation
**@export_flags_avoidance** **(** **)**
Export an integer property as a bit flag field for navigation avoidance layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/avoidance/layer_1<class_ProjectSettings_property_layer_names/avoidance/layer_1>`.
See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_AVOIDANCE<class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_AVOIDANCE>`.
::
@export_flags_avoidance var avoidance_layers: int
.. rst-class:: classref-item-separator
----
.. _class_@GDScript_annotation_@export_global_dir:
.. rst-class:: classref-annotation
@@ -465,7 +483,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_GLOBAL_FILE<class_@GlobalScope_constan
Define a new group for the following exported properties. This helps to organize properties in the Inspector dock. Groups can be added with an optional ``prefix``, which would make group to only consider properties that have this prefix. The grouping will break on the first property that doesn't have a prefix. The prefix is also removed from the property's name in the Inspector dock.
If no ``prefix`` is provided, the every following property is added to the group. The group ends when then next group or category is defined. You can also force end a group by using this annotation with empty strings for parameters, ``@export_group("", "")``.
If no ``prefix`` is provided, then every following property will be added to the group. The group ends when then next group or category is defined. You can also force end a group by using this annotation with empty strings for parameters, ``@export_group("", "")``.
Groups cannot be nested, use :ref:`@export_subgroup<class_@GDScript_annotation_@export_subgroup>` to add subgroups within groups.
@@ -662,6 +680,18 @@ The order of ``mode``, ``sync`` and ``transfer_mode`` does not matter and all ar
----
.. _class_@GDScript_annotation_@static_unload:
.. rst-class:: classref-annotation
**@static_unload** **(** **)**
Make a script with static variables to not persist after all references are lost. If the script is loaded again the static variables will revert to their default values.
.. rst-class:: classref-item-separator
----
.. _class_@GDScript_annotation_@tool:
.. rst-class:: classref-annotation
@@ -712,7 +742,7 @@ Method Descriptions
:ref:`Color<class_Color>` **Color8** **(** :ref:`int<class_int>` r8, :ref:`int<class_int>` g8, :ref:`int<class_int>` b8, :ref:`int<class_int>` a8=255 **)**
Returns a :ref:`Color<class_Color>` constructed from red (``r8``), green (``g8``), blue (``b8``), and optionally alpha (``a8``) integer channels, each divided by ``255.0`` for their final value.
Returns a :ref:`Color<class_Color>` constructed from red (``r8``), green (``g8``), blue (``b8``), and optionally alpha (``a8``) integer channels, each divided by ``255.0`` for their final value. Using :ref:`Color8<class_@GDScript_method_Color8>` instead of the standard :ref:`Color<class_Color>` constructor is useful when you need to match exact color values in an :ref:`Image<class_Image>`.
::
@@ -720,6 +750,8 @@ Returns a :ref:`Color<class_Color>` constructed from red (``r8``), green (``g8``
var dark_blue = Color8(0, 0, 51) # Same as Color(0, 0, 0.2).
var my_color = Color8(306, 255, 0, 102) # Same as Color(1.2, 1, 0, 0.4).
\ **Note:** Due to the lower precision of :ref:`Color8<class_@GDScript_method_Color8>` compared to the standard :ref:`Color<class_Color>` constructor, a color created with :ref:`Color8<class_@GDScript_method_Color8>` will generally not be equal to the same color created with the standard :ref:`Color<class_Color>` constructor. Use :ref:`Color.is_equal_approx<class_Color_method_is_equal_approx>` for comparisons to avoid issues with floating-point precision error.
.. rst-class:: classref-item-separator
----
@@ -887,7 +919,7 @@ Examples:
print(is_instance_of(a, MyClass))
print(is_instance_of(a, MyClass.InnerClass))
\ **Note:** If ``value`` and/or ``type`` are freed objects (see :ref:`@GlobalScope.is_instance_valid<class_@GlobalScope_method_is_instance_valid>`), or ``type`` is not one of the above options, this method will raise an runtime error.
\ **Note:** If ``value`` and/or ``type`` are freed objects (see :ref:`@GlobalScope.is_instance_valid<class_@GlobalScope_method_is_instance_valid>`), or ``type`` is not one of the above options, this method will raise a runtime error.
See also :ref:`@GlobalScope.typeof<class_@GlobalScope_method_typeof>`, :ref:`type_exists<class_@GDScript_method_type_exists>`, :ref:`Array.is_same_typed<class_Array_method_is_same_typed>` (and other :ref:`Array<class_Array>` methods).
@@ -936,6 +968,8 @@ This function is a simplified version of :ref:`ResourceLoader.load<class_Resourc
\ **Note:** Files have to be imported into the engine first to load them using this function. If you want to load :ref:`Image<class_Image>`\ s at run-time, you may use :ref:`Image.load<class_Image_method_load>`. If you want to import audio files, you can use the snippet described in :ref:`AudioStreamMP3.data<class_AudioStreamMP3_property_data>`.
\ **Note:** If :ref:`ProjectSettings.editor/export/convert_text_resources_to_binary<class_ProjectSettings_property_editor/export/convert_text_resources_to_binary>` is ``true``, :ref:`load<class_@GDScript_method_load>` will not be able to read converted files in an exported project. If you rely on run-time loading of files present within the PCK, set :ref:`ProjectSettings.editor/export/convert_text_resources_to_binary<class_ProjectSettings_property_editor/export/convert_text_resources_to_binary>` to ``false``.
.. rst-class:: classref-item-separator
----
@@ -1034,8 +1068,8 @@ To iterate over an :ref:`Array<class_Array>` backwards, use:
::
var array = [3, 6, 9]
for i in range(array.size(), 0, -1):
print(array[i - 1])
for i in range(array.size() - 1, -1, -1):
print(array[i])
Output: