Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions classes/class_@gdscript.rst
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,9 @@ Returns a single character (as a :ref:`String<class_String>`) of the given Unico

::

a = char(65) # a is "A"
a = char(65 + 32) # a is "a"
a = char(8364) # a is "€"
var upper = char(65) # upper is "A"
var lower = char(65 + 32) # lower is "a"
var euro = char(8364) # euro is "€"

.. rst-class:: classref-item-separator

Expand Down Expand Up @@ -1020,7 +1020,7 @@ Returns ``true`` if ``value`` is an instance of ``type``. The ``type`` value mus

Unlike the right operand of the ``is`` operator, ``type`` can be a non-constant value. The ``is`` operator supports more features (such as typed arrays). Use the operator instead of this method if you do not need dynamic type checking.

Examples:
\ **Examples:**\

::

Expand All @@ -1047,10 +1047,10 @@ Returns the length of the given Variant ``var``. The length can be the character

::

a = [1, 2, 3, 4]
var a = [1, 2, 3, 4]
len(a) # Returns 4

b = "Hello!"
var b = "Hello!"
len(b) # Returns 6

.. rst-class:: classref-item-separator
Expand Down Expand Up @@ -1166,7 +1166,7 @@ Returns an array with the given range. :ref:`range<class_@GDScript_method_range>

\ **Note:** Returns an empty array if no value meets the value constraint (e.g. ``range(2, 5, -1)`` or ``range(5, 5, 1)``).

Examples:
\ **Examples:**\

::

Expand Down
23 changes: 11 additions & 12 deletions classes/class_@globalscope.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3045,9 +3045,7 @@ enum **Error**: :ref:`🔗<enum_@GlobalScope_Error>`

Methods that return :ref:`Error<enum_@GlobalScope_Error>` return :ref:`OK<class_@GlobalScope_constant_OK>` when no error occurred.

Since :ref:`OK<class_@GlobalScope_constant_OK>` has value 0, and all other error constants are positive integers, it can also be used in boolean checks.

\ **Example:**\
Since :ref:`OK<class_@GlobalScope_constant_OK>` has value ``0``, and all other error constants are positive integers, it can also be used in boolean checks.

::

Expand Down Expand Up @@ -3702,7 +3700,7 @@ If a property is :ref:`Array<class_Array>`, hints the editor how to show element



Examples:
\ **Examples:**\


.. tabs::
Expand Down Expand Up @@ -6150,15 +6148,12 @@ See also :ref:`inverse_lerp<class_@GlobalScope_method_inverse_lerp>` which perfo

:ref:`float<class_float>` **linear_to_db**\ (\ lin\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_linear_to_db>`

Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear).
Converts from linear energy to decibels (audio). Since volume is not normally linear, this can be used to implement volume sliders that behave as expected.

\ **Example:**\
\ **Example:** Change the Master bus's volume through a :ref:`Slider<class_Slider>` node, which ranges from ``0.0`` to ``1.0``:

::

# "Slider" refers to a node that inherits Range such as HSlider or VSlider.
# Its range must be configured to go from 0 to 1.
# Change the bus name if you'd like to change the volume of a specific bus only.
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), linear_to_db($Slider.value))

.. rst-class:: classref-item-separator
Expand Down Expand Up @@ -7072,9 +7067,11 @@ Returns the hyperbolic sine of ``x``.

:ref:`float<class_float>` **smoothstep**\ (\ from\: :ref:`float<class_float>`, to\: :ref:`float<class_float>`, x\: :ref:`float<class_float>`\ ) :ref:`🔗<class_@GlobalScope_method_smoothstep>`

Returns the result of smoothly interpolating the value of ``x`` between ``0`` and ``1``, based on the where ``x`` lies with respect to the edges ``from`` and ``to``.
Returns a smooth cubic Hermite interpolation between ``0`` and ``1``.

For positive ranges (when ``from <= to``) the return value is ``0`` when ``x <= from``, and ``1`` when ``x >= to``. If ``x`` lies between ``from`` and ``to``, the return value follows an S-shaped curve that smoothly transitions from ``0`` to ``1``.

The return value is ``0`` if ``x <= from``, and ``1`` if ``x >= to``. If ``x`` lies between ``from`` and ``to``, the returned value follows an S-shaped curve that maps ``x`` between ``0`` and ``1``.
For negative ranges (when ``from > to``) the function is mirrored and returns ``1`` when ``x <= to`` and ``0`` when ``x >= from``.

This S-shaped curve is the cubic Hermite interpolator, given by ``f(y) = 3*y^2 - 2*y^3`` where ``y = (x-from) / (to-from)``.

Expand All @@ -7087,7 +7084,9 @@ This S-shaped curve is the cubic Hermite interpolator, given by ``f(y) = 3*y^2 -

Compared to :ref:`ease<class_@GlobalScope_method_ease>` with a curve value of ``-1.6521``, :ref:`smoothstep<class_@GlobalScope_method_smoothstep>` returns the smoothest possible curve with no sudden changes in the derivative. If you need to perform more advanced transitions, use :ref:`Tween<class_Tween>` or :ref:`AnimationPlayer<class_AnimationPlayer>`.

\ `Comparison between smoothstep() and ease(x, -1.6521) return values <https://raw.githubusercontent.com/godotengine/godot-docs/master/img/smoothstep_ease_comparison.png>`__
\ `Comparison between smoothstep() and ease(x, -1.6521) return values <https://raw.githubusercontent.com/godotengine/godot-docs/master/img/smoothstep_ease_comparison.png>`__\

\ `Smoothstep() return values with positive, zero, and negative ranges <https://raw.githubusercontent.com/godotengine/godot-docs/master/img/smoothstep_range.webp>`__

.. rst-class:: classref-item-separator

Expand Down
4 changes: 2 additions & 2 deletions classes/class_aabb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Methods
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_shortest_axis_size<class_AABB_method_get_shortest_axis_size>`\ (\ ) |const| |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_support<class_AABB_method_get_support>`\ (\ dir\: :ref:`Vector3<class_Vector3>`\ ) |const| |
| :ref:`Vector3<class_Vector3>` | :ref:`get_support<class_AABB_method_get_support>`\ (\ direction\: :ref:`Vector3<class_Vector3>`\ ) |const| |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_volume<class_AABB_method_get_volume>`\ (\ ) |const| |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
Expand Down Expand Up @@ -502,7 +502,7 @@ For an example, see :ref:`get_shortest_axis<class_AABB_method_get_shortest_axis>

.. rst-class:: classref-method

:ref:`Vector3<class_Vector3>` **get_support**\ (\ dir\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_AABB_method_get_support>`
:ref:`Vector3<class_Vector3>` **get_support**\ (\ direction\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_AABB_method_get_support>`

Returns the vertex's position of this bounding box that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms.

Expand Down
7 changes: 2 additions & 5 deletions classes/class_animatedsprite2d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -413,18 +413,15 @@ This method is a shorthand for :ref:`play<class_AnimatedSprite2D_method_play>` w

|void| **set_frame_and_progress**\ (\ frame\: :ref:`int<class_int>`, progress\: :ref:`float<class_float>`\ ) :ref:`🔗<class_AnimatedSprite2D_method_set_frame_and_progress>`

The setter of :ref:`frame<class_AnimatedSprite2D_property_frame>` resets the :ref:`frame_progress<class_AnimatedSprite2D_property_frame_progress>` to ``0.0`` implicitly, but this method avoids that.
Sets :ref:`frame<class_AnimatedSprite2D_property_frame>` the :ref:`frame_progress<class_AnimatedSprite2D_property_frame_progress>` to the given values. Unlike setting :ref:`frame<class_AnimatedSprite2D_property_frame>`, this method does not reset the :ref:`frame_progress<class_AnimatedSprite2D_property_frame_progress>` to ``0.0`` implicitly.

This is useful when you want to carry over the current :ref:`frame_progress<class_AnimatedSprite2D_property_frame_progress>` to another :ref:`frame<class_AnimatedSprite2D_property_frame>`.

\ **Example:**\
\ **Example:** Change the animation while keeping the same :ref:`frame<class_AnimatedSprite2D_property_frame>` and :ref:`frame_progress<class_AnimatedSprite2D_property_frame_progress>`.


.. tabs::

.. code-tab:: gdscript

# Change the animation with keeping the frame index and progress.
var current_frame = animated_sprite.get_frame()
var current_progress = animated_sprite.get_frame_progress()
animated_sprite.play("walk_another_skin")
Expand Down
7 changes: 2 additions & 5 deletions classes/class_animatedsprite3d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -333,18 +333,15 @@ This method is a shorthand for :ref:`play<class_AnimatedSprite3D_method_play>` w

|void| **set_frame_and_progress**\ (\ frame\: :ref:`int<class_int>`, progress\: :ref:`float<class_float>`\ ) :ref:`🔗<class_AnimatedSprite3D_method_set_frame_and_progress>`

The setter of :ref:`frame<class_AnimatedSprite3D_property_frame>` resets the :ref:`frame_progress<class_AnimatedSprite3D_property_frame_progress>` to ``0.0`` implicitly, but this method avoids that.
Sets :ref:`frame<class_AnimatedSprite3D_property_frame>` the :ref:`frame_progress<class_AnimatedSprite3D_property_frame_progress>` to the given values. Unlike setting :ref:`frame<class_AnimatedSprite3D_property_frame>`, this method does not reset the :ref:`frame_progress<class_AnimatedSprite3D_property_frame_progress>` to ``0.0`` implicitly.

This is useful when you want to carry over the current :ref:`frame_progress<class_AnimatedSprite3D_property_frame_progress>` to another :ref:`frame<class_AnimatedSprite3D_property_frame>`.

\ **Example:**\
\ **Example:** Change the animation while keeping the same :ref:`frame<class_AnimatedSprite3D_property_frame>` and :ref:`frame_progress<class_AnimatedSprite3D_property_frame_progress>`.


.. tabs::

.. code-tab:: gdscript

# Change the animation with keeping the frame index and progress.
var current_frame = animated_sprite.get_frame()
var current_progress = animated_sprite.get_frame_progress()
animated_sprite.play("walk_another_skin")
Expand Down
9 changes: 8 additions & 1 deletion classes/class_animationmixer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ Base class for :ref:`AnimationPlayer<class_AnimationPlayer>` and :ref:`Animation

After instantiating the playback information data within the extended class, the blending is processed by the **AnimationMixer**.

.. rst-class:: classref-introduction-group

Tutorials
---------

- `Migrating Animations from Godot 4.0 to 4.3 <https://godotengine.org/article/migrating-animations-from-godot-4-0-to-4-3/>`__

.. rst-class:: classref-reftable-group

Properties
Expand Down Expand Up @@ -665,7 +672,7 @@ The most basic example is applying position to :ref:`CharacterBody3D<class_Chara



By using this in combination with :ref:`get_root_motion_position_accumulator<class_AnimationMixer_method_get_root_motion_position_accumulator>`, you can apply the root motion position more correctly to account for the rotation of the node.
By using this in combination with :ref:`get_root_motion_rotation_accumulator<class_AnimationMixer_method_get_root_motion_rotation_accumulator>`, you can apply the root motion position more correctly to account for the rotation of the node.


.. tabs::
Expand Down
2 changes: 2 additions & 0 deletions classes/class_animationnodeanimation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ Animation to use as an output. It is one of the animations provided by :ref:`Ani

If :ref:`use_custom_timeline<class_AnimationNodeAnimation_property_use_custom_timeline>` is ``true``, override the loop settings of the original :ref:`Animation<class_Animation>` resource with the value.

\ **Note:** If the :ref:`Animation.loop_mode<class_Animation_property_loop_mode>` isn't set to looping, the :ref:`Animation.track_set_interpolation_loop_wrap<class_Animation_method_track_set_interpolation_loop_wrap>` option will not be respected. If you cannot get the expected behavior, consider duplicating the :ref:`Animation<class_Animation>` resource and changing the loop settings.

.. rst-class:: classref-item-separator

----
Expand Down
4 changes: 2 additions & 2 deletions classes/class_animationnodeblendspace2d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Description

A resource used by :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.

\ :ref:`AnimationNodeBlendSpace1D<class_AnimationNodeBlendSpace1D>` represents a virtual 2D space on which :ref:`AnimationRootNode<class_AnimationRootNode>`\ s are placed. Outputs the linear blend of the three adjacent animations using a :ref:`Vector2<class_Vector2>` weight. Adjacent in this context means the three :ref:`AnimationRootNode<class_AnimationRootNode>`\ s making up the triangle that contains the current value.
\ **AnimationNodeBlendSpace2D** represents a virtual 2D space on which :ref:`AnimationRootNode<class_AnimationRootNode>`\ s are placed. Outputs the linear blend of the three adjacent animations using a :ref:`Vector2<class_Vector2>` weight. Adjacent in this context means the three :ref:`AnimationRootNode<class_AnimationRootNode>`\ s making up the triangle that contains the current value.

You can add vertices to the blend space with :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>` and automatically triangulate it by setting :ref:`auto_triangles<class_AnimationNodeBlendSpace2D_property_auto_triangles>` to ``true``. Otherwise, use :ref:`add_triangle<class_AnimationNodeBlendSpace2D_method_add_triangle>` and :ref:`remove_triangle<class_AnimationNodeBlendSpace2D_method_remove_triangle>` to triangulate the blend space by hand.

Expand Down Expand Up @@ -426,7 +426,7 @@ Changes the :ref:`AnimationNode<class_AnimationNode>` referenced by the point at

|void| **set_blend_point_position**\ (\ point\: :ref:`int<class_int>`, pos\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_AnimationNodeBlendSpace2D_method_set_blend_point_position>`

Updates the position of the point at index ``point`` on the blend axis.
Updates the position of the point at index ``point`` in the blend space.

.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
Expand Down
2 changes: 0 additions & 2 deletions classes/class_animationnodestatemachine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ Description

Contains multiple :ref:`AnimationRootNode<class_AnimationRootNode>`\ s representing animation states, connected in a graph. State transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the :ref:`AnimationNodeStateMachinePlayback<class_AnimationNodeStateMachinePlayback>` object from the :ref:`AnimationTree<class_AnimationTree>` node to control it programmatically.

\ **Example:**\


.. tabs::

Expand Down
2 changes: 0 additions & 2 deletions classes/class_animationnodestatemachineplayback.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ Description

Allows control of :ref:`AnimationTree<class_AnimationTree>` state machines created with :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`. Retrieve with ``$AnimationTree.get("parameters/playback")``.

\ **Example:**\


.. tabs::

Expand Down
2 changes: 1 addition & 1 deletion classes/class_animationplayer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ If ``duration`` is a negative value, the duration is set to the interval between

|void| **queue**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_AnimationPlayer_method_queue>`

Queues an animation for playback once the current one is done.
Queues an animation for playback once the current animation and all previously queued animations are done.

\ **Note:** If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow.

Expand Down
10 changes: 4 additions & 6 deletions classes/class_array.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ A built-in data structure that holds a sequence of elements.
Description
-----------

An array data structure that can contain a sequence of elements of any :ref:`Variant<class_Variant>` type. Elements are accessed by a numerical index starting at 0. Negative indices are used to count from the back (-1 is the last element, -2 is the second to last, etc.).

\ **Example:**\
An array data structure that can contain a sequence of elements of any :ref:`Variant<class_Variant>` type. Elements are accessed by a numerical index starting at ``0``. Negative indices are used to count from the back (``-1`` is the last element, ``-2`` is the second to last, etc.).


.. tabs::
Expand Down Expand Up @@ -522,7 +520,7 @@ Appends another ``array`` at the end of this array.
var numbers = [1, 2, 3]
var extra = [4, 5, 6]
numbers.append_array(extra)
print(nums) # Prints [1, 2, 3, 4, 5, 6]
print(numbers) # Prints [1, 2, 3, 4, 5, 6]

.. rst-class:: classref-item-separator

Expand Down Expand Up @@ -1256,7 +1254,7 @@ If ``deep`` is ``true``, all nested **Array** and :ref:`Dictionary<class_Diction

|void| **sort**\ (\ ) :ref:`🔗<class_Array_method_sort>`

Sorts the array in ascending order. The final order is dependent on the "less than" (``>``) comparison between elements.
Sorts the array in ascending order. The final order is dependent on the "less than" (``<``) comparison between elements.


.. tabs::
Expand Down Expand Up @@ -1304,7 +1302,7 @@ Sorts the array using a custom :ref:`Callable<class_Callable>`.
print(my_items) # Prints [["Rice", 4], ["Tomato", 5], ["Apple", 9]]

# Sort descending, using a lambda function.
my_items.sort_custom(func(a, b): return a[0] > b[0])
my_items.sort_custom(func(a, b): return a[1] > b[1])
print(my_items) # Prints [["Apple", 9], ["Tomato", 5], ["Rice", 4]]

It may also be necessary to use this method to sort strings by natural order, with :ref:`String.naturalnocasecmp_to<class_String_method_naturalnocasecmp_to>`, as in the following example:
Expand Down
4 changes: 3 additions & 1 deletion classes/class_arraymesh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ Overrides the :ref:`AABB<class_AABB>` with one defined by user for use with frus
- |void| **set_shadow_mesh**\ (\ value\: :ref:`ArrayMesh<class_ArrayMesh>`\ )
- :ref:`ArrayMesh<class_ArrayMesh>` **get_shadow_mesh**\ (\ )

An optional mesh which is used for rendering shadows and can be used for the depth prepass. Can be used to increase performance of shadow rendering by using a mesh that only contains vertex position data (without normals, UVs, colors, etc.).
An optional mesh which can be used for rendering shadows and the depth prepass. Can be used to increase performance by supplying a mesh with fused vertices and only vertex position data (without normals, UVs, colors, etc.).

\ **Note:** This mesh must have exactly the same vertex positions as the source mesh (including the source mesh's LODs, if present). If vertex positions differ, then the mesh will not draw correctly.

.. rst-class:: classref-section-separator

Expand Down
Loading