You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>`.
428
+
429
+
See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_AVOIDANCE<class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_AVOIDANCE>`.
@@ -465,7 +483,7 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_GLOBAL_FILE<class_@GlobalScope_constan
465
483
466
484
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.
467
485
468
-
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("", "")``.
486
+
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("", "")``.
469
487
470
488
Groups cannot be nested, use :ref:`@export_subgroup<class_@GDScript_annotation_@export_subgroup>` to add subgroups within groups.
471
489
@@ -662,6 +680,18 @@ The order of ``mode``, ``sync`` and ``transfer_mode`` does not matter and all ar
662
680
663
681
----
664
682
683
+
.. _class_@GDScript_annotation_@static_unload:
684
+
685
+
.. rst-class:: classref-annotation
686
+
687
+
**@static_unload** **(** **)**
688
+
689
+
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.
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.
745
+
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>`.
716
746
717
747
::
718
748
719
749
var red = Color8(255, 0, 0) # Same as Color(1, 0, 0).
720
750
var dark_blue = Color8(0, 0, 51) # Same as Color(0, 0, 0.2).
721
751
var my_color = Color8(306, 255, 0, 102) # Same as Color(1.2, 1, 0, 0.4).
722
752
753
+
\ **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.
754
+
723
755
.. rst-class:: classref-item-separator
724
756
725
757
----
@@ -887,7 +919,7 @@ Examples:
887
919
print(is_instance_of(a, MyClass))
888
920
print(is_instance_of(a, MyClass.InnerClass))
889
921
890
-
\ **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.
922
+
\ **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.
891
923
892
924
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).
893
925
@@ -936,6 +968,8 @@ This function is a simplified version of :ref:`ResourceLoader.load<class_Resourc
936
968
937
969
\ **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>`.
938
970
971
+
\ **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``.
972
+
939
973
.. rst-class:: classref-item-separator
940
974
941
975
----
@@ -1034,8 +1068,8 @@ To iterate over an :ref:`Array<class_Array>` backwards, use:
@@ -5114,7 +5130,7 @@ Returns the absolute value of int parameter ``x`` (i.e. positive value).
5114
5130
5115
5131
:ref:`float<class_float>` **acos** **(** :ref:`float<class_float>` x **)**
5116
5132
5117
-
Returns the arc cosine of ``x`` in radians. Use to get the angle of cosine ``x``. ``x`` must be between ``-1.0`` and ``1.0`` (inclusive), otherwise, :ref:`acos<class_@GlobalScope_method_acos>` will return:ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`.
5133
+
Returns the arc cosine of ``x`` in radians. Use to get the angle of cosine ``x``. ``x`` will be clamped between ``-1.0`` and ``1.0`` (inclusive), in order to prevent :ref:`acos<class_@GlobalScope_method_acos>` from returning:ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`.
5118
5134
5119
5135
::
5120
5136
@@ -5131,7 +5147,7 @@ Returns the arc cosine of ``x`` in radians. Use to get the angle of cosine ``x``
5131
5147
5132
5148
:ref:`float<class_float>` **asin** **(** :ref:`float<class_float>` x **)**
5133
5149
5134
-
Returns the arc sine of ``x`` in radians. Use to get the angle of sine ``x``. ``x`` must be between ``-1.0`` and ``1.0`` (inclusive), otherwise, :ref:`asin<class_@GlobalScope_method_asin>` will return:ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`.
5150
+
Returns the arc sine of ``x`` in radians. Use to get the angle of sine ``x``. ``x`` will be clamped between ``-1.0`` and ``1.0`` (inclusive), in order to prevent :ref:`asin<class_@GlobalScope_method_asin>` from returning:ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`.
5135
5151
5136
5152
::
5137
5153
@@ -5904,7 +5920,7 @@ Linearly interpolates between two values by the factor defined in ``weight``. To
5904
5920
5905
5921
::
5906
5922
5907
-
lerp(0, 4, 0.75) # Returns 3.0
5923
+
lerpf(0, 4, 0.75) # Returns 3.0
5908
5924
5909
5925
See also :ref:`inverse_lerp<class_@GlobalScope_method_inverse_lerp>` which performs the reverse of this operation. To perform eased interpolation with :ref:`lerp<class_@GlobalScope_method_lerp>`, combine it with :ref:`ease<class_@GlobalScope_method_ease>` or :ref:`smoothstep<class_@GlobalScope_method_smoothstep>`.
5910
5926
@@ -5939,9 +5955,9 @@ Converts from linear energy to decibels (audio). This can be used to implement v
5939
5955
5940
5956
:ref:`float<class_float>` **log** **(** :ref:`float<class_float>` x **)**
5941
5957
5942
-
Returns the natural logarithm of ``x``. This is the amount of time needed to reach a certain level of continuous growth.
5958
+
Returns the `natural logarithm <https://en.wikipedia.org/wiki/Natural_logarithm>`__ of ``x`` (base `[i]e[/i] <https://en.wikipedia.org/wiki/E_(mathematical_constant)>`__, with *e* being approximately 2.71828). This is the amount of time needed to reach a certain level of continuous growth.
5943
5959
5944
-
\ **Note:** This is not the same as the "log" function on most calculators, which uses a base 10 logarithm.
5960
+
\ **Note:** This is not the same as the "log" function on most calculators, which uses a base 10 logarithm. To use base 10 logarithm, use ``log(x) / log(10)``.
5945
5961
5946
5962
::
5947
5963
@@ -6208,25 +6224,33 @@ Converts one or more arguments of any type to string in the best way possible an
6208
6224
6209
6225
void **print_rich** **(** ... **)** |vararg|
6210
6226
6211
-
Converts one or more arguments of any type to string in the best way possible and prints them to the console. The following BBCode tags are supported: b, i, u, s, indent, code, url, center, right, color, bgcolor, fgcolor. Color tags only support named colors such as ``red``, *not* hexadecimal color codes. Unsupported tags will be left as-is in standard output.
6227
+
Converts one or more arguments of any type to string in the best way possible and prints them to the console.
6228
+
6229
+
The following BBCode tags are supported: ``b``, ``i``, ``u``, ``s``, ``indent``, ``code``, ``url``, ``center``, ``right``, ``color``, ``bgcolor``, ``fgcolor``.
6212
6230
6213
-
When printing to standard output, the supported subset of BBCode is converted to ANSI escape codes for the terminal emulator to display. Displaying ANSI escape codes is currently only supported on Linux and macOS. Support for ANSI escape codes may vary across terminal emulators, especially for italic and strikethrough.
6231
+
Color tags only support the following named colors: ``black``, ``red``, ``green``, ``yellow``, ``blue``, ``magenta``, ``pink``, ``purple``, ``cyan``, ``white``, ``orange``, ``gray``. Hexadecimal color codes are not supported.
6232
+
6233
+
URL tags only support URLs wrapped by an URL tag, not URLs with a different title.
6234
+
6235
+
When printing to standard output, the supported subset of BBCode is converted to ANSI escape codes for the terminal emulator to display. Support for ANSI escape codes varies across terminal emulators, especially for italic and strikethrough. In standard output, ``code`` is represented with faint text but without any font change. Unsupported tags are left as-is in standard output.
6214
6236
6215
6237
6216
6238
.. tabs::
6217
6239
6218
6240
.. code-tab:: gdscript
6219
6241
6220
-
print_rich("[code][b]Hello world![/b][/code]") # Prints out: [b]Hello world![/b]
6242
+
print_rich("[color=green][b]Hello world![/b][/color]") # Prints out "Hello world!" in green with a bold font
6221
6243
6222
6244
.. code-tab:: csharp
6223
6245
6224
-
GD.PrintRich("[code][b]Hello world![/b][/code]"); // Prints out: [b]Hello world![/b]
6246
+
GD.PrintRich("[color=green][b]Hello world![/b][/color]"); // Prints out "Hello world!" in green with a bold font
6225
6247
6226
6248
6227
6249
6228
6250
\ **Note:** Consider using :ref:`push_error<class_@GlobalScope_method_push_error>` and :ref:`push_warning<class_@GlobalScope_method_push_warning>` to print error and warning messages instead of :ref:`print<class_@GlobalScope_method_print>` or :ref:`print_rich<class_@GlobalScope_method_print_rich>`. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed.
6229
6251
6252
+
\ **Note:** On Windows, only Windows 10 and later correctly displays ANSI escape codes in standard output.
6253
+
6230
6254
.. rst-class:: classref-item-separator
6231
6255
6232
6256
----
@@ -6735,9 +6759,9 @@ Returns ``-1.0`` if ``x`` is negative, ``1.0`` if ``x`` is positive, and ``0.0``
6735
6759
6736
6760
::
6737
6761
6738
-
sign(-6.5) # Returns -1.0
6739
-
sign(0.0) # Returns 0.0
6740
-
sign(6.5) # Returns 1.0
6762
+
signf(-6.5) # Returns -1.0
6763
+
signf(0.0) # Returns 0.0
6764
+
signf(6.5) # Returns 1.0
6741
6765
6742
6766
.. rst-class:: classref-item-separator
6743
6767
@@ -6753,9 +6777,9 @@ Returns ``-1`` if ``x`` is negative, ``1`` if ``x`` is positive, and ``0`` if if
6753
6777
6754
6778
::
6755
6779
6756
-
sign(-6) # Returns -1
6757
-
sign(0) # Returns 0
6758
-
sign(6) # Returns 1
6780
+
signi(-6) # Returns -1
6781
+
signi(0) # Returns 0
6782
+
signi(6) # Returns 1
6759
6783
6760
6784
.. rst-class:: classref-item-separator
6761
6785
@@ -6859,8 +6883,8 @@ A type-safe version of :ref:`snapped<class_@GlobalScope_method_snapped>`, return
6859
6883
6860
6884
::
6861
6885
6862
-
snapped(32.0, 2.5) # Returns 32.5
6863
-
snapped(3.14159, 0.01) # Returns 3.14
6886
+
snappedf(32.0, 2.5) # Returns 32.5
6887
+
snappedf(3.14159, 0.01) # Returns 3.14
6864
6888
6865
6889
.. rst-class:: classref-item-separator
6866
6890
@@ -6878,8 +6902,8 @@ A type-safe version of :ref:`snapped<class_@GlobalScope_method_snapped>`, return
Copy file name to clipboardExpand all lines: classes/class_aabb.rst
+3-3
Original file line number
Diff line number
Diff line change
@@ -502,7 +502,7 @@ Returns ``true`` if the **AABB** is on both sides of a plane.
502
502
503
503
:ref:`Variant<class_Variant>` **intersects_ray** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` dir **)** |const|
504
504
505
-
Returns ``true`` if the given ray intersects with this **AABB**. Ray length is infinite.
505
+
Returns the point of intersection of the given ray with this **AABB** or ``null`` if there is no intersection. Ray length is infinite.
506
506
507
507
.. rst-class:: classref-item-separator
508
508
@@ -514,7 +514,7 @@ Returns ``true`` if the given ray intersects with this **AABB**. Ray length is i
514
514
515
515
:ref:`Variant<class_Variant>` **intersects_segment** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to **)** |const|
516
516
517
-
Returns ``true`` if the **AABB** intersects the line segment between ``from`` and ``to``.
517
+
Returns the point of intersection between ``from`` and ``to`` with this **AABB** or ``null`` if there is no intersection.
518
518
519
519
.. rst-class:: classref-item-separator
520
520
@@ -567,7 +567,7 @@ Operator Descriptions
567
567
568
568
:ref:`bool<class_bool>` **operator !=** **(** :ref:`AABB<class_AABB>` right **)**
569
569
570
-
Returns ``true`` if the vectors are not equal.
570
+
Returns ``true`` if the AABBs are not equal.
571
571
572
572
\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx<class_AABB_method_is_equal_approx>` instead, which is more reliable.
0 commit comments