classref: Sync with current 3.x branch (995c24415)

This commit is contained in:
Yuri Sizov
2023-04-13 18:01:11 +02:00
parent f15871e2b2
commit 99c2ec8fb3
709 changed files with 116000 additions and 57747 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -12,14 +12,18 @@ AABB
Axis-Aligned Bounding Box.
.. rst-class:: classref-introduction-group
Description
-----------
``AABB`` consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
**AABB** consists of a position, a size, and several utility functions. It is typically used for fast overlap tests.
It uses floating-point coordinates. The 2D counterpart to ``AABB`` is :ref:`Rect2<class_Rect2>`.
It uses floating-point coordinates. The 2D counterpart to **AABB** is :ref:`Rect2<class_Rect2>`.
\ **Note:** Unlike :ref:`Rect2<class_Rect2>`, ``AABB`` does not have a variant that uses integer coordinates.
\ **Note:** Unlike :ref:`Rect2<class_Rect2>`, **AABB** does not have a variant that uses integer coordinates.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -30,141 +34,175 @@ Tutorials
- :doc:`Advanced vector math <../tutorials/math/vectors_advanced>`
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------------+-----------------------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`end<class_AABB_property_end>` | ``Vector3( 0, 0, 0 )`` |
+-------------------------------+-----------------------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`position<class_AABB_property_position>` | ``Vector3( 0, 0, 0 )`` |
+-------------------------------+-----------------------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`size<class_AABB_property_size>` | ``Vector3( 0, 0, 0 )`` |
+-------------------------------+-----------------------------------------------+------------------------+
.. table::
:widths: auto
+-------------------------------+-----------------------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`end<class_AABB_property_end>` | ``Vector3( 0, 0, 0 )`` |
+-------------------------------+-----------------------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`position<class_AABB_property_position>` | ``Vector3( 0, 0, 0 )`` |
+-------------------------------+-----------------------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`size<class_AABB_property_size>` | ``Vector3( 0, 0, 0 )`` |
+-------------------------------+-----------------------------------------------+------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`AABB<class_AABB_method_AABB>` **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` size **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`abs<class_AABB_method_abs>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`encloses<class_AABB_method_encloses>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`expand<class_AABB_method_expand>` **(** :ref:`Vector3<class_Vector3>` to_point **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_area<class_AABB_method_get_area>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_center<class_AABB_method_get_center>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_endpoint<class_AABB_method_get_endpoint>` **(** :ref:`int<class_int>` idx **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_longest_axis<class_AABB_method_get_longest_axis>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_longest_axis_index<class_AABB_method_get_longest_axis_index>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_longest_axis_size<class_AABB_method_get_longest_axis_size>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_shortest_axis<class_AABB_method_get_shortest_axis>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_shortest_axis_index<class_AABB_method_get_shortest_axis_index>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_shortest_axis_size<class_AABB_method_get_shortest_axis_size>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_support<class_AABB_method_get_support>` **(** :ref:`Vector3<class_Vector3>` dir **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`grow<class_AABB_method_grow>` **(** :ref:`float<class_float>` by **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_no_area<class_AABB_method_has_no_area>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_no_surface<class_AABB_method_has_no_surface>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_point<class_AABB_method_has_point>` **(** :ref:`Vector3<class_Vector3>` point **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`intersection<class_AABB_method_intersection>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`intersects<class_AABB_method_intersects>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`intersects_plane<class_AABB_method_intersects_plane>` **(** :ref:`Plane<class_Plane>` plane **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`intersects_segment<class_AABB_method_intersects_segment>` **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_AABB_method_is_equal_approx>` **(** :ref:`AABB<class_AABB>` aabb **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`merge<class_AABB_method_merge>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`AABB<class_AABB_method_AABB>` **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` size **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`abs<class_AABB_method_abs>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`encloses<class_AABB_method_encloses>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`expand<class_AABB_method_expand>` **(** :ref:`Vector3<class_Vector3>` to_point **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_area<class_AABB_method_get_area>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_center<class_AABB_method_get_center>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_endpoint<class_AABB_method_get_endpoint>` **(** :ref:`int<class_int>` idx **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_longest_axis<class_AABB_method_get_longest_axis>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_longest_axis_index<class_AABB_method_get_longest_axis_index>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_longest_axis_size<class_AABB_method_get_longest_axis_size>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_shortest_axis<class_AABB_method_get_shortest_axis>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_shortest_axis_index<class_AABB_method_get_shortest_axis_index>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_shortest_axis_size<class_AABB_method_get_shortest_axis_size>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_support<class_AABB_method_get_support>` **(** :ref:`Vector3<class_Vector3>` dir **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`grow<class_AABB_method_grow>` **(** :ref:`float<class_float>` by **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_no_area<class_AABB_method_has_no_area>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_no_surface<class_AABB_method_has_no_surface>` **(** **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_point<class_AABB_method_has_point>` **(** :ref:`Vector3<class_Vector3>` point **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`intersection<class_AABB_method_intersection>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`intersects<class_AABB_method_intersects>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`intersects_plane<class_AABB_method_intersects_plane>` **(** :ref:`Plane<class_Plane>` plane **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`intersects_segment<class_AABB_method_intersects_segment>` **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_AABB_method_is_equal_approx>` **(** :ref:`AABB<class_AABB>` aabb **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`merge<class_AABB_method_merge>` **(** :ref:`AABB<class_AABB>` with **)** |
+-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AABB_property_end:
- :ref:`Vector3<class_Vector3>` **end**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``Vector3( 0, 0, 0 )`` |
+-----------+------------------------+
:ref:`Vector3<class_Vector3>` **end** = ``Vector3( 0, 0, 0 )``
Ending corner. This is calculated as ``position + size``. Setting this value will change the size.
.. rst-class:: classref-item-separator
----
.. _class_AABB_property_position:
- :ref:`Vector3<class_Vector3>` **position**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``Vector3( 0, 0, 0 )`` |
+-----------+------------------------+
:ref:`Vector3<class_Vector3>` **position** = ``Vector3( 0, 0, 0 )``
Beginning corner. Typically has values lower than :ref:`end<class_AABB_property_end>`.
.. rst-class:: classref-item-separator
----
.. _class_AABB_property_size:
- :ref:`Vector3<class_Vector3>` **size**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``Vector3( 0, 0, 0 )`` |
+-----------+------------------------+
:ref:`Vector3<class_Vector3>` **size** = ``Vector3( 0, 0, 0 )``
Size from :ref:`position<class_AABB_property_position>` to :ref:`end<class_AABB_property_end>`. Typically, all components are positive.
If the size is negative, you can use :ref:`abs<class_AABB_method_abs>` to fix it.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AABB_method_AABB:
- :ref:`AABB<class_AABB>` **AABB** **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` size **)**
.. rst-class:: classref-method
Constructs an ``AABB`` from a position and size.
:ref:`AABB<class_AABB>` **AABB** **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` size **)**
Constructs an **AABB** from a position and size.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_abs:
- :ref:`AABB<class_AABB>` **abs** **(** **)**
.. rst-class:: classref-method
:ref:`AABB<class_AABB>` **abs** **(** **)**
Returns an AABB with equivalent position and size, modified so that the most-negative corner is the origin and the size is positive.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_encloses:
- :ref:`bool<class_bool>` **encloses** **(** :ref:`AABB<class_AABB>` with **)**
.. rst-class:: classref-method
Returns ``true`` if this ``AABB`` completely encloses another one.
:ref:`bool<class_bool>` **encloses** **(** :ref:`AABB<class_AABB>` with **)**
Returns ``true`` if this **AABB** completely encloses another one.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_expand:
- :ref:`AABB<class_AABB>` **expand** **(** :ref:`Vector3<class_Vector3>` to_point **)**
.. rst-class:: classref-method
Returns a copy of this ``AABB`` expanded to include a given point.
:ref:`AABB<class_AABB>` **expand** **(** :ref:`Vector3<class_Vector3>` to_point **)**
Returns a copy of this **AABB** expanded to include a given point.
\ **Example:**\
@@ -175,166 +213,247 @@ Returns a copy of this ``AABB`` expanded to include a given point.
# position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB and Vector3(0, -1, 2)
var box2 = box.expand(Vector3(0, -1, 2))
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_get_area:
- :ref:`float<class_float>` **get_area** **(** **)**
.. rst-class:: classref-method
Returns the volume of the ``AABB``.
:ref:`float<class_float>` **get_area** **(** **)**
Returns the volume of the **AABB**.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_get_center:
- :ref:`Vector3<class_Vector3>` **get_center** **(** **)**
.. rst-class:: classref-method
Returns the center of the ``AABB``, which is equal to :ref:`position<class_AABB_property_position>` + (:ref:`size<class_AABB_property_size>` / 2).
:ref:`Vector3<class_Vector3>` **get_center** **(** **)**
Returns the center of the **AABB**, which is equal to :ref:`position<class_AABB_property_position>` + (:ref:`size<class_AABB_property_size>` / 2).
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_get_endpoint:
- :ref:`Vector3<class_Vector3>` **get_endpoint** **(** :ref:`int<class_int>` idx **)**
.. rst-class:: classref-method
Gets the position of the 8 endpoints of the ``AABB`` in space.
:ref:`Vector3<class_Vector3>` **get_endpoint** **(** :ref:`int<class_int>` idx **)**
Gets the position of the 8 endpoints of the **AABB** in space.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_get_longest_axis:
- :ref:`Vector3<class_Vector3>` **get_longest_axis** **(** **)**
.. rst-class:: classref-method
Returns the normalized longest axis of the ``AABB``.
:ref:`Vector3<class_Vector3>` **get_longest_axis** **(** **)**
Returns the normalized longest axis of the **AABB**.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_get_longest_axis_index:
- :ref:`int<class_int>` **get_longest_axis_index** **(** **)**
.. rst-class:: classref-method
Returns the index of the longest axis of the ``AABB`` (according to :ref:`Vector3<class_Vector3>`'s ``AXIS_*`` constants).
:ref:`int<class_int>` **get_longest_axis_index** **(** **)**
Returns the index of the longest axis of the **AABB** (according to :ref:`Vector3<class_Vector3>`'s ``AXIS_*`` constants).
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_get_longest_axis_size:
- :ref:`float<class_float>` **get_longest_axis_size** **(** **)**
.. rst-class:: classref-method
Returns the scalar length of the longest axis of the ``AABB``.
:ref:`float<class_float>` **get_longest_axis_size** **(** **)**
Returns the scalar length of the longest axis of the **AABB**.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_get_shortest_axis:
- :ref:`Vector3<class_Vector3>` **get_shortest_axis** **(** **)**
.. rst-class:: classref-method
Returns the normalized shortest axis of the ``AABB``.
:ref:`Vector3<class_Vector3>` **get_shortest_axis** **(** **)**
Returns the normalized shortest axis of the **AABB**.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_get_shortest_axis_index:
- :ref:`int<class_int>` **get_shortest_axis_index** **(** **)**
.. rst-class:: classref-method
Returns the index of the shortest axis of the ``AABB`` (according to :ref:`Vector3<class_Vector3>`::AXIS\* enum).
:ref:`int<class_int>` **get_shortest_axis_index** **(** **)**
Returns the index of the shortest axis of the **AABB** (according to :ref:`Vector3<class_Vector3>`::AXIS\* enum).
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_get_shortest_axis_size:
- :ref:`float<class_float>` **get_shortest_axis_size** **(** **)**
.. rst-class:: classref-method
Returns the scalar length of the shortest axis of the ``AABB``.
:ref:`float<class_float>` **get_shortest_axis_size** **(** **)**
Returns the scalar length of the shortest axis of the **AABB**.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_get_support:
- :ref:`Vector3<class_Vector3>` **get_support** **(** :ref:`Vector3<class_Vector3>` dir **)**
.. rst-class:: classref-method
:ref:`Vector3<class_Vector3>` **get_support** **(** :ref:`Vector3<class_Vector3>` dir **)**
Returns the support point in a given direction. This is useful for collision detection algorithms.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_grow:
- :ref:`AABB<class_AABB>` **grow** **(** :ref:`float<class_float>` by **)**
.. rst-class:: classref-method
Returns a copy of the ``AABB`` grown a given amount of units towards all the sides.
:ref:`AABB<class_AABB>` **grow** **(** :ref:`float<class_float>` by **)**
Returns a copy of the **AABB** grown a given amount of units towards all the sides.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_has_no_area:
- :ref:`bool<class_bool>` **has_no_area** **(** **)**
.. rst-class:: classref-method
Returns ``true`` if the ``AABB`` is flat or empty.
:ref:`bool<class_bool>` **has_no_area** **(** **)**
Returns ``true`` if the **AABB** is flat or empty.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_has_no_surface:
- :ref:`bool<class_bool>` **has_no_surface** **(** **)**
.. rst-class:: classref-method
Returns ``true`` if the ``AABB`` is empty.
:ref:`bool<class_bool>` **has_no_surface** **(** **)**
Returns ``true`` if the **AABB** is empty.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_has_point:
- :ref:`bool<class_bool>` **has_point** **(** :ref:`Vector3<class_Vector3>` point **)**
.. rst-class:: classref-method
Returns ``true`` if the ``AABB`` contains a point.
:ref:`bool<class_bool>` **has_point** **(** :ref:`Vector3<class_Vector3>` point **)**
Returns ``true`` if the **AABB** contains a point.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_intersection:
- :ref:`AABB<class_AABB>` **intersection** **(** :ref:`AABB<class_AABB>` with **)**
.. rst-class:: classref-method
Returns the intersection between two ``AABB``. An empty AABB (size 0,0,0) is returned on failure.
:ref:`AABB<class_AABB>` **intersection** **(** :ref:`AABB<class_AABB>` with **)**
Returns the intersection between two **AABB**. An empty AABB (size 0,0,0) is returned on failure.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_intersects:
- :ref:`bool<class_bool>` **intersects** **(** :ref:`AABB<class_AABB>` with **)**
.. rst-class:: classref-method
Returns ``true`` if the ``AABB`` overlaps with another.
:ref:`bool<class_bool>` **intersects** **(** :ref:`AABB<class_AABB>` with **)**
Returns ``true`` if the **AABB** overlaps with another.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_intersects_plane:
- :ref:`bool<class_bool>` **intersects_plane** **(** :ref:`Plane<class_Plane>` plane **)**
.. rst-class:: classref-method
Returns ``true`` if the ``AABB`` is on both sides of a plane.
:ref:`bool<class_bool>` **intersects_plane** **(** :ref:`Plane<class_Plane>` plane **)**
Returns ``true`` if the **AABB** is on both sides of a plane.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_intersects_segment:
- :ref:`bool<class_bool>` **intersects_segment** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to **)**
.. rst-class:: classref-method
Returns ``true`` if the ``AABB`` intersects the line segment between ``from`` and ``to``.
:ref:`bool<class_bool>` **intersects_segment** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to **)**
Returns ``true`` if the **AABB** intersects the line segment between ``from`` and ``to``.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_is_equal_approx:
- :ref:`bool<class_bool>` **is_equal_approx** **(** :ref:`AABB<class_AABB>` aabb **)**
.. rst-class:: classref-method
Returns ``true`` if this ``AABB`` and ``aabb`` are approximately equal, by calling :ref:`@GDScript.is_equal_approx<class_@GDScript_method_is_equal_approx>` on each component.
:ref:`bool<class_bool>` **is_equal_approx** **(** :ref:`AABB<class_AABB>` aabb **)**
Returns ``true`` if this **AABB** and ``aabb`` are approximately equal, by calling :ref:`@GDScript.is_equal_approx<class_@GDScript_method_is_equal_approx>` on each component.
.. rst-class:: classref-item-separator
----
.. _class_AABB_method_merge:
- :ref:`AABB<class_AABB>` **merge** **(** :ref:`AABB<class_AABB>` with **)**
.. rst-class:: classref-method
Returns a larger ``AABB`` that contains both this ``AABB`` and ``with``.
:ref:`AABB<class_AABB>` **merge** **(** :ref:`AABB<class_AABB>` with **)**
Returns a larger **AABB** that contains both this **AABB** and ``with``.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,115 +16,154 @@ AcceptDialog
Base dialog for user notification.
.. rst-class:: classref-introduction-group
Description
-----------
This dialog is useful for small notifications to the user about an event. It can only be accepted or closed, with the same result.
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`dialog_autowrap<class_AcceptDialog_property_dialog_autowrap>` | ``false`` |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`dialog_hide_on_ok<class_AcceptDialog_property_dialog_hide_on_ok>` | ``true`` |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`dialog_text<class_AcceptDialog_property_dialog_text>` | ``""`` |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | window_title | ``"Alert!"`` (overrides :ref:`WindowDialog<class_WindowDialog_property_window_title>`) |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`dialog_autowrap<class_AcceptDialog_property_dialog_autowrap>` | ``false`` |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`dialog_hide_on_ok<class_AcceptDialog_property_dialog_hide_on_ok>` | ``true`` |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`dialog_text<class_AcceptDialog_property_dialog_text>` | ``""`` |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | window_title | ``"Alert!"`` (overrides :ref:`WindowDialog<class_WindowDialog_property_window_title>`) |
+-----------------------------+-------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Button<class_Button>` | :ref:`add_button<class_AcceptDialog_method_add_button>` **(** :ref:`String<class_String>` text, :ref:`bool<class_bool>` right=false, :ref:`String<class_String>` action="" **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Button<class_Button>` | :ref:`add_cancel<class_AcceptDialog_method_add_cancel>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Label<class_Label>` | :ref:`get_label<class_AcceptDialog_method_get_label>` **(** **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Button<class_Button>` | :ref:`get_ok<class_AcceptDialog_method_get_ok>` **(** **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`register_text_enter<class_AcceptDialog_method_register_text_enter>` **(** :ref:`Node<class_Node>` line_edit **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_button<class_AcceptDialog_method_remove_button>` **(** :ref:`Control<class_Control>` button **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Button<class_Button>` | :ref:`add_button<class_AcceptDialog_method_add_button>` **(** :ref:`String<class_String>` text, :ref:`bool<class_bool>` right=false, :ref:`String<class_String>` action="" **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Button<class_Button>` | :ref:`add_cancel<class_AcceptDialog_method_add_cancel>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Label<class_Label>` | :ref:`get_label<class_AcceptDialog_method_get_label>` **(** **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Button<class_Button>` | :ref:`get_ok<class_AcceptDialog_method_get_ok>` **(** **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`register_text_enter<class_AcceptDialog_method_register_text_enter>` **(** :ref:`Node<class_Node>` line_edit **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_button<class_AcceptDialog_method_remove_button>` **(** :ref:`Control<class_Control>` button **)** |
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_AcceptDialog_signal_confirmed:
- **confirmed** **(** **)**
.. rst-class:: classref-signal
**confirmed** **(** **)**
Emitted when the dialog is accepted, i.e. the OK button is pressed.
.. rst-class:: classref-item-separator
----
.. _class_AcceptDialog_signal_custom_action:
- **custom_action** **(** :ref:`String<class_String>` action **)**
.. rst-class:: classref-signal
**custom_action** **(** :ref:`String<class_String>` action **)**
Emitted when a custom button is pressed. See :ref:`add_button<class_AcceptDialog_method_add_button>`.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AcceptDialog_property_dialog_autowrap:
- :ref:`bool<class_bool>` **dialog_autowrap**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_autowrap(value) |
+-----------+---------------------+
| *Getter* | has_autowrap() |
+-----------+---------------------+
:ref:`bool<class_bool>` **dialog_autowrap** = ``false``
.. rst-class:: classref-property-setget
- void **set_autowrap** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **has_autowrap** **(** **)**
Sets autowrapping for the text in the dialog.
.. rst-class:: classref-item-separator
----
.. _class_AcceptDialog_property_dialog_hide_on_ok:
- :ref:`bool<class_bool>` **dialog_hide_on_ok**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``true`` |
+-----------+-----------------------+
| *Setter* | set_hide_on_ok(value) |
+-----------+-----------------------+
| *Getter* | get_hide_on_ok() |
+-----------+-----------------------+
:ref:`bool<class_bool>` **dialog_hide_on_ok** = ``true``
.. rst-class:: classref-property-setget
- void **set_hide_on_ok** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_hide_on_ok** **(** **)**
If ``true``, the dialog is hidden when the OK button is pressed. You can set it to ``false`` if you want to do e.g. input validation when receiving the :ref:`confirmed<class_AcceptDialog_signal_confirmed>` signal, and handle hiding the dialog in your own logic.
\ **Note:** Some nodes derived from this class can have a different default value, and potentially their own built-in logic overriding this setting. For example :ref:`FileDialog<class_FileDialog>` defaults to ``false``, and has its own input validation code that is called when you press OK, which eventually hides the dialog if the input is valid. As such, this property can't be used in :ref:`FileDialog<class_FileDialog>` to disable hiding the dialog when pressing OK.
.. rst-class:: classref-item-separator
----
.. _class_AcceptDialog_property_dialog_text:
- :ref:`String<class_String>` **dialog_text**
.. rst-class:: classref-property
+-----------+-----------------+
| *Default* | ``""`` |
+-----------+-----------------+
| *Setter* | set_text(value) |
+-----------+-----------------+
| *Getter* | get_text() |
+-----------+-----------------+
:ref:`String<class_String>` **dialog_text** = ``""``
.. rst-class:: classref-property-setget
- void **set_text** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_text** **(** **)**
The text displayed by the dialog.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AcceptDialog_method_add_button:
- :ref:`Button<class_Button>` **add_button** **(** :ref:`String<class_String>` text, :ref:`bool<class_bool>` right=false, :ref:`String<class_String>` action="" **)**
.. rst-class:: classref-method
:ref:`Button<class_Button>` **add_button** **(** :ref:`String<class_String>` text, :ref:`bool<class_bool>` right=false, :ref:`String<class_String>` action="" **)**
Adds a button with label ``text`` and a custom ``action`` to the dialog and returns the created button. ``action`` will be passed to the :ref:`custom_action<class_AcceptDialog_signal_custom_action>` signal when pressed.
@@ -132,52 +171,73 @@ If ``true``, ``right`` will place the button to the right of any sibling buttons
You can use :ref:`remove_button<class_AcceptDialog_method_remove_button>` method to remove a button created with this method from the dialog.
.. rst-class:: classref-item-separator
----
.. _class_AcceptDialog_method_add_cancel:
- :ref:`Button<class_Button>` **add_cancel** **(** :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
:ref:`Button<class_Button>` **add_cancel** **(** :ref:`String<class_String>` name **)**
Adds a button with label ``name`` and a cancel action to the dialog and returns the created button.
You can use :ref:`remove_button<class_AcceptDialog_method_remove_button>` method to remove a button created with this method from the dialog.
.. rst-class:: classref-item-separator
----
.. _class_AcceptDialog_method_get_label:
- :ref:`Label<class_Label>` **get_label** **(** **)**
.. rst-class:: classref-method
:ref:`Label<class_Label>` **get_label** **(** **)**
Returns the label used for built-in text.
\ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
.. rst-class:: classref-item-separator
----
.. _class_AcceptDialog_method_get_ok:
- :ref:`Button<class_Button>` **get_ok** **(** **)**
.. rst-class:: classref-method
:ref:`Button<class_Button>` **get_ok** **(** **)**
Returns the OK :ref:`Button<class_Button>` instance.
\ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
.. rst-class:: classref-item-separator
----
.. _class_AcceptDialog_method_register_text_enter:
- void **register_text_enter** **(** :ref:`Node<class_Node>` line_edit **)**
.. rst-class:: classref-method
void **register_text_enter** **(** :ref:`Node<class_Node>` line_edit **)**
Registers a :ref:`LineEdit<class_LineEdit>` in the dialog. When the enter key is pressed, the dialog will be accepted.
.. rst-class:: classref-item-separator
----
.. _class_AcceptDialog_method_remove_button:
- void **remove_button** **(** :ref:`Control<class_Control>` button **)**
.. rst-class:: classref-method
void **remove_button** **(** :ref:`Control<class_Control>` button **)**
Removes the ``button`` from the dialog. Does NOT free the ``button``. The ``button`` must be a :ref:`Button<class_Button>` added with :ref:`add_button<class_AcceptDialog_method_add_button>` or :ref:`add_cancel<class_AcceptDialog_method_add_cancel>` method. After removal, pressing the ``button`` will no longer emit this dialog's :ref:`custom_action<class_AcceptDialog_signal_custom_action>` signal or cancel this dialog.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AESContext
Interface to low level AES encryption features.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -51,78 +53,131 @@ This class provides access to AES encryption/decryption of raw data. Both AES-EC
# Check CBC
assert(decrypted == data.to_utf8())
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`finish<class_AESContext_method_finish>` **(** **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`get_iv_state<class_AESContext_method_get_iv_state>` **(** **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`start<class_AESContext_method_start>` **(** :ref:`Mode<enum_AESContext_Mode>` mode, :ref:`PoolByteArray<class_PoolByteArray>` key, :ref:`PoolByteArray<class_PoolByteArray>` iv=PoolByteArray( ) **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`update<class_AESContext_method_update>` **(** :ref:`PoolByteArray<class_PoolByteArray>` src **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`finish<class_AESContext_method_finish>` **(** **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`get_iv_state<class_AESContext_method_get_iv_state>` **(** **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`start<class_AESContext_method_start>` **(** :ref:`Mode<enum_AESContext_Mode>` mode, :ref:`PoolByteArray<class_PoolByteArray>` key, :ref:`PoolByteArray<class_PoolByteArray>` iv=PoolByteArray( ) **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`update<class_AESContext_method_update>` **(** :ref:`PoolByteArray<class_PoolByteArray>` src **)** |
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AESContext_Mode:
.. _class_AESContext_constant_MODE_ECB_ENCRYPT:
.. _class_AESContext_constant_MODE_ECB_DECRYPT:
.. _class_AESContext_constant_MODE_CBC_ENCRYPT:
.. _class_AESContext_constant_MODE_CBC_DECRYPT:
.. _class_AESContext_constant_MODE_MAX:
.. rst-class:: classref-enumeration
enum **Mode**:
- **MODE_ECB_ENCRYPT** = **0** --- AES electronic codebook encryption mode.
.. _class_AESContext_constant_MODE_ECB_ENCRYPT:
- **MODE_ECB_DECRYPT** = **1** --- AES electronic codebook decryption mode.
.. rst-class:: classref-enumeration-constant
- **MODE_CBC_ENCRYPT** = **2** --- AES cipher blocker chaining encryption mode.
:ref:`Mode<enum_AESContext_Mode>` **MODE_ECB_ENCRYPT** = ``0``
- **MODE_CBC_DECRYPT** = **3** --- AES cipher blocker chaining decryption mode.
AES electronic codebook encryption mode.
- **MODE_MAX** = **4** --- Maximum value for the mode enum.
.. _class_AESContext_constant_MODE_ECB_DECRYPT:
.. rst-class:: classref-enumeration-constant
:ref:`Mode<enum_AESContext_Mode>` **MODE_ECB_DECRYPT** = ``1``
AES electronic codebook decryption mode.
.. _class_AESContext_constant_MODE_CBC_ENCRYPT:
.. rst-class:: classref-enumeration-constant
:ref:`Mode<enum_AESContext_Mode>` **MODE_CBC_ENCRYPT** = ``2``
AES cipher blocker chaining encryption mode.
.. _class_AESContext_constant_MODE_CBC_DECRYPT:
.. rst-class:: classref-enumeration-constant
:ref:`Mode<enum_AESContext_Mode>` **MODE_CBC_DECRYPT** = ``3``
AES cipher blocker chaining decryption mode.
.. _class_AESContext_constant_MODE_MAX:
.. rst-class:: classref-enumeration-constant
:ref:`Mode<enum_AESContext_Mode>` **MODE_MAX** = ``4``
Maximum value for the mode enum.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AESContext_method_finish:
- void **finish** **(** **)**
.. rst-class:: classref-method
void **finish** **(** **)**
Close this AES context so it can be started again. See :ref:`start<class_AESContext_method_start>`.
.. rst-class:: classref-item-separator
----
.. _class_AESContext_method_get_iv_state:
- :ref:`PoolByteArray<class_PoolByteArray>` **get_iv_state** **(** **)**
.. rst-class:: classref-method
:ref:`PoolByteArray<class_PoolByteArray>` **get_iv_state** **(** **)**
Get the current IV state for this context (IV gets updated when calling :ref:`update<class_AESContext_method_update>`). You normally don't need this function.
\ **Note:** This function only makes sense when the context is started with :ref:`MODE_CBC_ENCRYPT<class_AESContext_constant_MODE_CBC_ENCRYPT>` or :ref:`MODE_CBC_DECRYPT<class_AESContext_constant_MODE_CBC_DECRYPT>`.
.. rst-class:: classref-item-separator
----
.. _class_AESContext_method_start:
- :ref:`Error<enum_@GlobalScope_Error>` **start** **(** :ref:`Mode<enum_AESContext_Mode>` mode, :ref:`PoolByteArray<class_PoolByteArray>` key, :ref:`PoolByteArray<class_PoolByteArray>` iv=PoolByteArray( ) **)**
.. rst-class:: classref-method
:ref:`Error<enum_@GlobalScope_Error>` **start** **(** :ref:`Mode<enum_AESContext_Mode>` mode, :ref:`PoolByteArray<class_PoolByteArray>` key, :ref:`PoolByteArray<class_PoolByteArray>` iv=PoolByteArray( ) **)**
Start the AES context in the given ``mode``. A ``key`` of either 16 or 32 bytes must always be provided, while an ``iv`` (initialization vector) of exactly 16 bytes, is only needed when ``mode`` is either :ref:`MODE_CBC_ENCRYPT<class_AESContext_constant_MODE_CBC_ENCRYPT>` or :ref:`MODE_CBC_DECRYPT<class_AESContext_constant_MODE_CBC_DECRYPT>`.
.. rst-class:: classref-item-separator
----
.. _class_AESContext_method_update:
- :ref:`PoolByteArray<class_PoolByteArray>` **update** **(** :ref:`PoolByteArray<class_PoolByteArray>` src **)**
.. rst-class:: classref-method
:ref:`PoolByteArray<class_PoolByteArray>` **update** **(** :ref:`PoolByteArray<class_PoolByteArray>` src **)**
Run the desired operation for this AES context. Will return a :ref:`PoolByteArray<class_PoolByteArray>` containing the result of encrypting (or decrypting) the given ``src``. See :ref:`start<class_AESContext_method_start>` for mode of operation.
@@ -131,3 +186,4 @@ Run the desired operation for this AES context. Will return a :ref:`PoolByteArra
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,12 +14,16 @@ AnimatedSprite
Sprite node that contains multiple textures as frames to play for animation.
.. rst-class:: classref-introduction-group
Description
-----------
``AnimatedSprite`` is similar to the :ref:`Sprite<class_Sprite>` node, except it carries multiple textures as animation frames. Animations are created using a :ref:`SpriteFrames<class_SpriteFrames>` resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The :ref:`SpriteFrames<class_SpriteFrames>` resource can be configured in the editor via the SpriteFrames bottom panel.
**AnimatedSprite** is similar to the :ref:`Sprite<class_Sprite>` node, except it carries multiple textures as animation frames. Animations are created using a :ref:`SpriteFrames<class_SpriteFrames>` resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The :ref:`SpriteFrames<class_SpriteFrames>` resource can be configured in the editor via the SpriteFrames bottom panel.
\ **Note:** You can associate a set of normal or specular maps by creating additional :ref:`SpriteFrames<class_SpriteFrames>` resources with a ``_normal`` or ``_specular`` suffix. For example, having 3 :ref:`SpriteFrames<class_SpriteFrames>` resources ``run``, ``run_normal``, and ``run_specular`` will make it so the ``run`` animation uses normal and specular maps.
\ **Note:** You can associate a set of normal maps by creating additional animations with a ``_normal`` suffix. For example, having 2 animations ``run`` and ``run_normal`` will make it so the ``run`` animation uses the normal map.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -28,215 +32,265 @@ Tutorials
- `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`String<class_String>` | :ref:`animation<class_AnimatedSprite_property_animation>` | ``"default"`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`centered<class_AnimatedSprite_property_centered>` | ``true`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`flip_h<class_AnimatedSprite_property_flip_h>` | ``false`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`flip_v<class_AnimatedSprite_property_flip_v>` | ``false`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite_property_frame>` | ``0`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite_property_frames>` | |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`offset<class_AnimatedSprite_property_offset>` | ``Vector2( 0, 0 )`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite_property_playing>` | ``false`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimatedSprite_property_speed_scale>` | ``1.0`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
.. table::
:widths: auto
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`String<class_String>` | :ref:`animation<class_AnimatedSprite_property_animation>` | ``"default"`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`centered<class_AnimatedSprite_property_centered>` | ``true`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`flip_h<class_AnimatedSprite_property_flip_h>` | ``false`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`flip_v<class_AnimatedSprite_property_flip_v>` | ``false`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite_property_frame>` | ``0`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite_property_frames>` | |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`offset<class_AnimatedSprite_property_offset>` | ``Vector2( 0, 0 )`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite_property_playing>` | ``false`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimatedSprite_property_speed_scale>` | ``1.0`` |
+-----------------------------------------+---------------------------------------------------------------+---------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+------+----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimatedSprite_method_play>` **(** :ref:`String<class_String>` anim="", :ref:`bool<class_bool>` backwards=false **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimatedSprite_method_stop>` **(** **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+------+----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimatedSprite_method_play>` **(** :ref:`String<class_String>` anim="", :ref:`bool<class_bool>` backwards=false **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimatedSprite_method_stop>` **(** **)** |
+------+----------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_AnimatedSprite_signal_animation_finished:
- **animation_finished** **(** **)**
.. rst-class:: classref-signal
**animation_finished** **(** **)**
Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite_signal_frame_changed:
- **frame_changed** **(** **)**
.. rst-class:: classref-signal
**frame_changed** **(** **)**
Emitted when :ref:`frame<class_AnimatedSprite_property_frame>` changed.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimatedSprite_property_animation:
- :ref:`String<class_String>` **animation**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``"default"`` |
+-----------+----------------------+
| *Setter* | set_animation(value) |
+-----------+----------------------+
| *Getter* | get_animation() |
+-----------+----------------------+
:ref:`String<class_String>` **animation** = ``"default"``
.. rst-class:: classref-property-setget
- void **set_animation** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_animation** **(** **)**
The current animation from the :ref:`frames<class_AnimatedSprite_property_frames>` resource. If this value changes, the ``frame`` counter is reset.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite_property_centered:
- :ref:`bool<class_bool>` **centered**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``true`` |
+-----------+---------------------+
| *Setter* | set_centered(value) |
+-----------+---------------------+
| *Getter* | is_centered() |
+-----------+---------------------+
:ref:`bool<class_bool>` **centered** = ``true``
.. rst-class:: classref-property-setget
- void **set_centered** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_centered** **(** **)**
If ``true``, texture will be centered.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite_property_flip_h:
- :ref:`bool<class_bool>` **flip_h**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``false`` |
+-----------+-------------------+
| *Setter* | set_flip_h(value) |
+-----------+-------------------+
| *Getter* | is_flipped_h() |
+-----------+-------------------+
:ref:`bool<class_bool>` **flip_h** = ``false``
.. rst-class:: classref-property-setget
- void **set_flip_h** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_flipped_h** **(** **)**
If ``true``, texture is flipped horizontally.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite_property_flip_v:
- :ref:`bool<class_bool>` **flip_v**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``false`` |
+-----------+-------------------+
| *Setter* | set_flip_v(value) |
+-----------+-------------------+
| *Getter* | is_flipped_v() |
+-----------+-------------------+
:ref:`bool<class_bool>` **flip_v** = ``false``
.. rst-class:: classref-property-setget
- void **set_flip_v** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_flipped_v** **(** **)**
If ``true``, texture is flipped vertically.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite_property_frame:
- :ref:`int<class_int>` **frame**
.. rst-class:: classref-property
+-----------+------------------+
| *Default* | ``0`` |
+-----------+------------------+
| *Setter* | set_frame(value) |
+-----------+------------------+
| *Getter* | get_frame() |
+-----------+------------------+
:ref:`int<class_int>` **frame** = ``0``
.. rst-class:: classref-property-setget
- void **set_frame** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_frame** **(** **)**
The displayed animation frame's index.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite_property_frames:
- :ref:`SpriteFrames<class_SpriteFrames>` **frames**
.. rst-class:: classref-property
+----------+--------------------------+
| *Setter* | set_sprite_frames(value) |
+----------+--------------------------+
| *Getter* | get_sprite_frames() |
+----------+--------------------------+
:ref:`SpriteFrames<class_SpriteFrames>` **frames**
.. rst-class:: classref-property-setget
- void **set_sprite_frames** **(** :ref:`SpriteFrames<class_SpriteFrames>` value **)**
- :ref:`SpriteFrames<class_SpriteFrames>` **get_sprite_frames** **(** **)**
The :ref:`SpriteFrames<class_SpriteFrames>` resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the :ref:`SpriteFrames<class_SpriteFrames>` resource.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite_property_offset:
- :ref:`Vector2<class_Vector2>` **offset**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``Vector2( 0, 0 )`` |
+-----------+---------------------+
| *Setter* | set_offset(value) |
+-----------+---------------------+
| *Getter* | get_offset() |
+-----------+---------------------+
:ref:`Vector2<class_Vector2>` **offset** = ``Vector2( 0, 0 )``
.. rst-class:: classref-property-setget
- void **set_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
- :ref:`Vector2<class_Vector2>` **get_offset** **(** **)**
The texture's drawing offset.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite_property_playing:
- :ref:`bool<class_bool>` **playing**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``false`` |
+-----------+--------------------+
| *Setter* | set_playing(value) |
+-----------+--------------------+
| *Getter* | is_playing() |
+-----------+--------------------+
:ref:`bool<class_bool>` **playing** = ``false``
.. rst-class:: classref-property-setget
- void **set_playing** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_playing** **(** **)**
If ``true``, the :ref:`animation<class_AnimatedSprite_property_animation>` is currently playing.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite_property_speed_scale:
- :ref:`float<class_float>` **speed_scale**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_speed_scale(value) |
+-----------+------------------------+
| *Getter* | get_speed_scale() |
+-----------+------------------------+
:ref:`float<class_float>` **speed_scale** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_speed_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_speed_scale** **(** **)**
The animation speed is multiplied by this value.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimatedSprite_method_play:
- void **play** **(** :ref:`String<class_String>` anim="", :ref:`bool<class_bool>` backwards=false **)**
.. rst-class:: classref-method
void **play** **(** :ref:`String<class_String>` anim="", :ref:`bool<class_bool>` backwards=false **)**
Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played. If ``backwards`` is ``true``, the animation will be played in reverse.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite_method_stop:
- void **stop** **(** **)**
.. rst-class:: classref-method
void **stop** **(** **)**
Stops the current animation (does not reset the frame counter).
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,141 +14,193 @@ AnimatedSprite3D
2D sprite node in 3D world, that can use multiple 2D textures for animation.
.. rst-class:: classref-introduction-group
Description
-----------
Animations are created using a :ref:`SpriteFrames<class_SpriteFrames>` resource, which can be configured in the editor via the SpriteFrames panel.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`2D Sprite animation (also applies to 3D) <../tutorials/2d/2d_sprite_animation>`
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`String<class_String>` | :ref:`animation<class_AnimatedSprite3D_property_animation>` | ``"default"`` |
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite3D_property_frame>` | ``0`` |
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite3D_property_frames>` | |
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite3D_property_playing>` | ``false`` |
+-----------------------------------------+-------------------------------------------------------------+---------------+
.. table::
:widths: auto
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`String<class_String>` | :ref:`animation<class_AnimatedSprite3D_property_animation>` | ``"default"`` |
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite3D_property_frame>` | ``0`` |
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite3D_property_frames>` | |
+-----------------------------------------+-------------------------------------------------------------+---------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite3D_property_playing>` | ``false`` |
+-----------------------------------------+-------------------------------------------------------------+---------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------+-------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimatedSprite3D_method_is_playing>` **(** **)** |const| |
+-------------------------+-------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimatedSprite3D_method_play>` **(** :ref:`String<class_String>` anim="" **)** |
+-------------------------+-------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimatedSprite3D_method_stop>` **(** **)** |
+-------------------------+-------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------+-------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimatedSprite3D_method_is_playing>` **(** **)** |const| |
+-------------------------+-------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimatedSprite3D_method_play>` **(** :ref:`String<class_String>` anim="" **)** |
+-------------------------+-------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimatedSprite3D_method_stop>` **(** **)** |
+-------------------------+-------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_AnimatedSprite3D_signal_animation_finished:
- **animation_finished** **(** **)**
.. rst-class:: classref-signal
**animation_finished** **(** **)**
Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite3D_signal_frame_changed:
- **frame_changed** **(** **)**
.. rst-class:: classref-signal
**frame_changed** **(** **)**
Emitted when :ref:`frame<class_AnimatedSprite3D_property_frame>` changed.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimatedSprite3D_property_animation:
- :ref:`String<class_String>` **animation**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``"default"`` |
+-----------+----------------------+
| *Setter* | set_animation(value) |
+-----------+----------------------+
| *Getter* | get_animation() |
+-----------+----------------------+
:ref:`String<class_String>` **animation** = ``"default"``
.. rst-class:: classref-property-setget
- void **set_animation** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_animation** **(** **)**
The current animation from the ``frames`` resource. If this value changes, the ``frame`` counter is reset.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite3D_property_frame:
- :ref:`int<class_int>` **frame**
.. rst-class:: classref-property
+-----------+------------------+
| *Default* | ``0`` |
+-----------+------------------+
| *Setter* | set_frame(value) |
+-----------+------------------+
| *Getter* | get_frame() |
+-----------+------------------+
:ref:`int<class_int>` **frame** = ``0``
.. rst-class:: classref-property-setget
- void **set_frame** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_frame** **(** **)**
The displayed animation frame's index.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite3D_property_frames:
- :ref:`SpriteFrames<class_SpriteFrames>` **frames**
.. rst-class:: classref-property
+----------+--------------------------+
| *Setter* | set_sprite_frames(value) |
+----------+--------------------------+
| *Getter* | get_sprite_frames() |
+----------+--------------------------+
:ref:`SpriteFrames<class_SpriteFrames>` **frames**
.. rst-class:: classref-property-setget
- void **set_sprite_frames** **(** :ref:`SpriteFrames<class_SpriteFrames>` value **)**
- :ref:`SpriteFrames<class_SpriteFrames>` **get_sprite_frames** **(** **)**
The :ref:`SpriteFrames<class_SpriteFrames>` resource containing the animation(s).
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite3D_property_playing:
- :ref:`bool<class_bool>` **playing**
.. rst-class:: classref-property
+-----------+-----------+
| *Default* | ``false`` |
+-----------+-----------+
:ref:`bool<class_bool>` **playing** = ``false``
If ``true``, the :ref:`animation<class_AnimatedSprite3D_property_animation>` is currently playing.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimatedSprite3D_method_is_playing:
- :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_playing** **(** **)** |const|
Returns ``true`` if an animation is currently being played.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite3D_method_play:
- void **play** **(** :ref:`String<class_String>` anim="" **)**
.. rst-class:: classref-method
void **play** **(** :ref:`String<class_String>` anim="" **)**
Plays the animation named ``anim``. If no ``anim`` is provided, the current animation is played.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedSprite3D_method_stop:
- void **stop** **(** **)**
.. rst-class:: classref-method
void **stop** **(** **)**
Stops the current animation (does not reset the frame counter).
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,157 +14,206 @@ AnimatedTexture
Proxy texture for simple frame-based animations.
.. rst-class:: classref-introduction-group
Description
-----------
``AnimatedTexture`` is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike :ref:`AnimationPlayer<class_AnimationPlayer>` or :ref:`AnimatedSprite<class_AnimatedSprite>`, it isn't a :ref:`Node<class_Node>`, but has the advantage of being usable anywhere a :ref:`Texture<class_Texture>` resource can be used, e.g. in a :ref:`TileSet<class_TileSet>`.
**AnimatedTexture** is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike :ref:`AnimationPlayer<class_AnimationPlayer>` or :ref:`AnimatedSprite<class_AnimatedSprite>`, it isn't a :ref:`Node<class_Node>`, but has the advantage of being usable anywhere a :ref:`Texture<class_Texture>` resource can be used, e.g. in a :ref:`TileSet<class_TileSet>`.
The playback of the animation is controlled by the :ref:`fps<class_AnimatedTexture_property_fps>` property as well as each frame's optional delay (see :ref:`set_frame_delay<class_AnimatedTexture_method_set_frame_delay>`). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame.
\ ``AnimatedTexture`` currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one.
\ **AnimatedTexture** currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one.
\ **Note:** AnimatedTexture doesn't support using :ref:`AtlasTexture<class_AtlasTexture>`\ s. Each frame needs to be a separate :ref:`Texture<class_Texture>`.
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`current_frame<class_AnimatedTexture_property_current_frame>` | |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | flags | ``0`` (overrides :ref:`Texture<class_Texture_property_flags>`) |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`fps<class_AnimatedTexture_property_fps>` | ``4.0`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`frames<class_AnimatedTexture_property_frames>` | ``1`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`oneshot<class_AnimatedTexture_property_oneshot>` | ``false`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`pause<class_AnimatedTexture_property_pause>` | ``false`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`current_frame<class_AnimatedTexture_property_current_frame>` | |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | flags | ``0`` (overrides :ref:`Texture<class_Texture_property_flags>`) |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`fps<class_AnimatedTexture_property_fps>` | ``4.0`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`frames<class_AnimatedTexture_property_frames>` | ``1`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`oneshot<class_AnimatedTexture_property_oneshot>` | ``false`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`pause<class_AnimatedTexture_property_pause>` | ``false`` |
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_frame_delay<class_AnimatedTexture_method_get_frame_delay>` **(** :ref:`int<class_int>` frame **)** |const| |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Texture<class_Texture>` | :ref:`get_frame_texture<class_AnimatedTexture_method_get_frame_texture>` **(** :ref:`int<class_int>` frame **)** |const| |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_frame_delay<class_AnimatedTexture_method_set_frame_delay>` **(** :ref:`int<class_int>` frame, :ref:`float<class_float>` delay **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_frame_texture<class_AnimatedTexture_method_set_frame_texture>` **(** :ref:`int<class_int>` frame, :ref:`Texture<class_Texture>` texture **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_frame_delay<class_AnimatedTexture_method_get_frame_delay>` **(** :ref:`int<class_int>` frame **)** |const| |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Texture<class_Texture>` | :ref:`get_frame_texture<class_AnimatedTexture_method_get_frame_texture>` **(** :ref:`int<class_int>` frame **)** |const| |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_frame_delay<class_AnimatedTexture_method_set_frame_delay>` **(** :ref:`int<class_int>` frame, :ref:`float<class_float>` delay **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_frame_texture<class_AnimatedTexture_method_set_frame_texture>` **(** :ref:`int<class_int>` frame, :ref:`Texture<class_Texture>` texture **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Constants
---------
.. _class_AnimatedTexture_constant_MAX_FRAMES:
- **MAX_FRAMES** = **256** --- The maximum number of frames supported by ``AnimatedTexture``. If you need more frames in your animation, use :ref:`AnimationPlayer<class_AnimationPlayer>` or :ref:`AnimatedSprite<class_AnimatedSprite>`.
.. rst-class:: classref-constant
**MAX_FRAMES** = ``256``
The maximum number of frames supported by **AnimatedTexture**. If you need more frames in your animation, use :ref:`AnimationPlayer<class_AnimationPlayer>` or :ref:`AnimatedSprite<class_AnimatedSprite>`.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimatedTexture_property_current_frame:
- :ref:`int<class_int>` **current_frame**
.. rst-class:: classref-property
+----------+--------------------------+
| *Setter* | set_current_frame(value) |
+----------+--------------------------+
| *Getter* | get_current_frame() |
+----------+--------------------------+
:ref:`int<class_int>` **current_frame**
.. rst-class:: classref-property-setget
- void **set_current_frame** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_current_frame** **(** **)**
Sets the currently visible frame of the texture.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedTexture_property_fps:
- :ref:`float<class_float>` **fps**
.. rst-class:: classref-property
+-----------+----------------+
| *Default* | ``4.0`` |
+-----------+----------------+
| *Setter* | set_fps(value) |
+-----------+----------------+
| *Getter* | get_fps() |
+-----------+----------------+
:ref:`float<class_float>` **fps** = ``4.0``
.. rst-class:: classref-property-setget
- void **set_fps** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_fps** **(** **)**
Animation speed in frames per second. This value defines the default time interval between two frames of the animation, and thus the overall duration of the animation loop based on the :ref:`frames<class_AnimatedTexture_property_frames>` property. A value of 0 means no predefined number of frames per second, the animation will play according to each frame's frame delay (see :ref:`set_frame_delay<class_AnimatedTexture_method_set_frame_delay>`).
For example, an animation with 8 frames, no frame delay and a ``fps`` value of 2 will run for 4 seconds, with each frame lasting 0.5 seconds.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedTexture_property_frames:
- :ref:`int<class_int>` **frames**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``1`` |
+-----------+-------------------+
| *Setter* | set_frames(value) |
+-----------+-------------------+
| *Getter* | get_frames() |
+-----------+-------------------+
:ref:`int<class_int>` **frames** = ``1``
.. rst-class:: classref-property-setget
- void **set_frames** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_frames** **(** **)**
Number of frames to use in the animation. While you can create the frames independently with :ref:`set_frame_texture<class_AnimatedTexture_method_set_frame_texture>`, you need to set this value for the animation to take new frames into account. The maximum number of frames is :ref:`MAX_FRAMES<class_AnimatedTexture_constant_MAX_FRAMES>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedTexture_property_oneshot:
- :ref:`bool<class_bool>` **oneshot**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``false`` |
+-----------+--------------------+
| *Setter* | set_oneshot(value) |
+-----------+--------------------+
| *Getter* | get_oneshot() |
+-----------+--------------------+
:ref:`bool<class_bool>` **oneshot** = ``false``
.. rst-class:: classref-property-setget
- void **set_oneshot** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_oneshot** **(** **)**
If ``true``, the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set :ref:`pause<class_AnimatedTexture_property_pause>` to ``true``.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedTexture_property_pause:
- :ref:`bool<class_bool>` **pause**
.. rst-class:: classref-property
+-----------+------------------+
| *Default* | ``false`` |
+-----------+------------------+
| *Setter* | set_pause(value) |
+-----------+------------------+
| *Getter* | get_pause() |
+-----------+------------------+
:ref:`bool<class_bool>` **pause** = ``false``
.. rst-class:: classref-property-setget
- void **set_pause** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_pause** **(** **)**
If ``true``, the animation will pause where it currently is (i.e. at :ref:`current_frame<class_AnimatedTexture_property_current_frame>`). The animation will continue from where it was paused when changing this property to ``false``.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimatedTexture_method_get_frame_delay:
- :ref:`float<class_float>` **get_frame_delay** **(** :ref:`int<class_int>` frame **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_frame_delay** **(** :ref:`int<class_int>` frame **)** |const|
Returns the given frame's delay value.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedTexture_method_get_frame_texture:
- :ref:`Texture<class_Texture>` **get_frame_texture** **(** :ref:`int<class_int>` frame **)** |const|
.. rst-class:: classref-method
:ref:`Texture<class_Texture>` **get_frame_texture** **(** :ref:`int<class_int>` frame **)** |const|
Returns the given frame's :ref:`Texture<class_Texture>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimatedTexture_method_set_frame_delay:
- void **set_frame_delay** **(** :ref:`int<class_int>` frame, :ref:`float<class_float>` delay **)**
.. rst-class:: classref-method
void **set_frame_delay** **(** :ref:`int<class_int>` frame, :ref:`float<class_float>` delay **)**
Sets an additional delay (in seconds) between this frame and the next one, that will be added to the time interval defined by :ref:`fps<class_AnimatedTexture_property_fps>`. By default, frames have no delay defined. If a delay value is defined, the final time interval between this frame and the next will be ``1.0 / fps + delay``.
@@ -177,11 +226,15 @@ For example, for an animation with 3 frames, 2 FPS and a frame delay on the seco
Frame 2: 0.5 s (1 / fps)
Total duration: 2.7 s
.. rst-class:: classref-item-separator
----
.. _class_AnimatedTexture_method_set_frame_texture:
- void **set_frame_texture** **(** :ref:`int<class_int>` frame, :ref:`Texture<class_Texture>` texture **)**
.. rst-class:: classref-method
void **set_frame_texture** **(** :ref:`int<class_int>` frame, :ref:`Texture<class_Texture>` texture **)**
Assigns a :ref:`Texture<class_Texture>` to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID :ref:`frames<class_AnimatedTexture_property_frames>` - 1.
@@ -190,3 +243,4 @@ You can define any number of textures up to :ref:`MAX_FRAMES<class_AnimatedTextu
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

File diff suppressed because it is too large Load Diff

View File

@@ -16,6 +16,8 @@ AnimationNode
Base resource for :ref:`AnimationTree<class_AnimationTree>` nodes.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,232 +25,351 @@ Base resource for :ref:`AnimationTree<class_AnimationTree>` nodes. In general, i
Inherit this when creating nodes mainly for use in :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`, otherwise :ref:`AnimationRootNode<class_AnimationRootNode>` should be used instead.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------+--------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`filter_enabled<class_AnimationNode_property_filter_enabled>` |
+-------------------------+--------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------+--------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`filter_enabled<class_AnimationNode_property_filter_enabled>` |
+-------------------------+--------------------------------------------------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_input<class_AnimationNode_method_add_input>` **(** :ref:`String<class_String>` name **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`blend_animation<class_AnimationNode_method_blend_animation>` **(** :ref:`String<class_String>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`float<class_float>` blend **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`blend_input<class_AnimationNode_method_blend_input>` **(** :ref:`int<class_int>` input_index, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`blend_node<class_AnimationNode_method_blend_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_caption<class_AnimationNode_method_get_caption>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Object<class_Object>` | :ref:`get_child_by_name<class_AnimationNode_method_get_child_by_name>` **(** :ref:`String<class_String>` name **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`get_child_nodes<class_AnimationNode_method_get_child_nodes>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_input_count<class_AnimationNode_method_get_input_count>` **(** **)** |const| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_input_name<class_AnimationNode_method_get_input_name>` **(** :ref:`int<class_int>` input **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`get_parameter<class_AnimationNode_method_get_parameter>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`get_parameter_default_value<class_AnimationNode_method_get_parameter_default_value>` **(** :ref:`String<class_String>` name **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_parameter_list<class_AnimationNode_method_get_parameter_list>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_filter<class_AnimationNode_method_has_filter>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_path_filtered<class_AnimationNode_method_is_path_filtered>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`process<class_AnimationNode_method_process>` **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_input<class_AnimationNode_method_remove_input>` **(** :ref:`int<class_int>` index **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_filter_path<class_AnimationNode_method_set_filter_path>` **(** :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_parameter<class_AnimationNode_method_set_parameter>` **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_input<class_AnimationNode_method_add_input>` **(** :ref:`String<class_String>` name **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`blend_animation<class_AnimationNode_method_blend_animation>` **(** :ref:`String<class_String>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`float<class_float>` blend **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`blend_input<class_AnimationNode_method_blend_input>` **(** :ref:`int<class_int>` input_index, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`blend_node<class_AnimationNode_method_blend_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_caption<class_AnimationNode_method_get_caption>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Object<class_Object>` | :ref:`get_child_by_name<class_AnimationNode_method_get_child_by_name>` **(** :ref:`String<class_String>` name **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`get_child_nodes<class_AnimationNode_method_get_child_nodes>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_input_count<class_AnimationNode_method_get_input_count>` **(** **)** |const| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_input_name<class_AnimationNode_method_get_input_name>` **(** :ref:`int<class_int>` input **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`get_parameter<class_AnimationNode_method_get_parameter>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`get_parameter_default_value<class_AnimationNode_method_get_parameter_default_value>` **(** :ref:`String<class_String>` name **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_parameter_list<class_AnimationNode_method_get_parameter_list>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_filter<class_AnimationNode_method_has_filter>` **(** **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_path_filtered<class_AnimationNode_method_is_path_filtered>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`process<class_AnimationNode_method_process>` **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek **)** |virtual| |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_input<class_AnimationNode_method_remove_input>` **(** :ref:`int<class_int>` index **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_filter_path<class_AnimationNode_method_set_filter_path>` **(** :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_parameter<class_AnimationNode_method_set_parameter>` **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)** |
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_AnimationNode_signal_removed_from_graph:
- **removed_from_graph** **(** **)**
.. rst-class:: classref-signal
**removed_from_graph** **(** **)**
Emitted when the node was removed from the graph.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_signal_tree_changed:
- **tree_changed** **(** **)**
.. rst-class:: classref-signal
**tree_changed** **(** **)**
Emitted by nodes that inherit from this class and that have an internal tree when one of their nodes changes. The nodes that emit this signal are :ref:`AnimationNodeBlendSpace1D<class_AnimationNodeBlendSpace1D>`, :ref:`AnimationNodeBlendSpace2D<class_AnimationNodeBlendSpace2D>`, :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`, and :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AnimationNode_FilterAction:
.. _class_AnimationNode_constant_FILTER_IGNORE:
.. _class_AnimationNode_constant_FILTER_PASS:
.. _class_AnimationNode_constant_FILTER_STOP:
.. _class_AnimationNode_constant_FILTER_BLEND:
.. rst-class:: classref-enumeration
enum **FilterAction**:
- **FILTER_IGNORE** = **0** --- Do not use filtering.
.. _class_AnimationNode_constant_FILTER_IGNORE:
- **FILTER_PASS** = **1** --- Paths matching the filter will be allowed to pass.
.. rst-class:: classref-enumeration-constant
- **FILTER_STOP** = **2** --- Paths matching the filter will be discarded.
:ref:`FilterAction<enum_AnimationNode_FilterAction>` **FILTER_IGNORE** = ``0``
- **FILTER_BLEND** = **3** --- Paths matching the filter will be blended (by the blend value).
Do not use filtering.
.. _class_AnimationNode_constant_FILTER_PASS:
.. rst-class:: classref-enumeration-constant
:ref:`FilterAction<enum_AnimationNode_FilterAction>` **FILTER_PASS** = ``1``
Paths matching the filter will be allowed to pass.
.. _class_AnimationNode_constant_FILTER_STOP:
.. rst-class:: classref-enumeration-constant
:ref:`FilterAction<enum_AnimationNode_FilterAction>` **FILTER_STOP** = ``2``
Paths matching the filter will be discarded.
.. _class_AnimationNode_constant_FILTER_BLEND:
.. rst-class:: classref-enumeration-constant
:ref:`FilterAction<enum_AnimationNode_FilterAction>` **FILTER_BLEND** = ``3``
Paths matching the filter will be blended (by the blend value).
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNode_property_filter_enabled:
- :ref:`bool<class_bool>` **filter_enabled**
.. rst-class:: classref-property
+----------+---------------------------+
| *Setter* | set_filter_enabled(value) |
+----------+---------------------------+
| *Getter* | is_filter_enabled() |
+----------+---------------------------+
:ref:`bool<class_bool>` **filter_enabled**
.. rst-class:: classref-property-setget
- void **set_filter_enabled** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_filter_enabled** **(** **)**
If ``true``, filtering is enabled.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimationNode_method_add_input:
- void **add_input** **(** :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
void **add_input** **(** :ref:`String<class_String>` name **)**
Adds an input to the node. This is only useful for nodes created for use in an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_blend_animation:
- void **blend_animation** **(** :ref:`String<class_String>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`float<class_float>` blend **)**
.. rst-class:: classref-method
void **blend_animation** **(** :ref:`String<class_String>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`float<class_float>` blend **)**
Blend an animation by ``blend`` amount (name must be valid in the linked :ref:`AnimationPlayer<class_AnimationPlayer>`). A ``time`` and ``delta`` may be passed, as well as whether ``seek`` happened.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_blend_input:
- :ref:`float<class_float>` **blend_input** **(** :ref:`int<class_int>` input_index, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)**
.. rst-class:: classref-method
:ref:`float<class_float>` **blend_input** **(** :ref:`int<class_int>` input_index, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)**
Blend an input. This is only useful for nodes created for an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. The ``time`` parameter is a relative delta, unless ``seek`` is ``true``, in which case it is absolute. A filter mode may be optionally passed (see :ref:`FilterAction<enum_AnimationNode_FilterAction>` for options).
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_blend_node:
- :ref:`float<class_float>` **blend_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)**
.. rst-class:: classref-method
:ref:`float<class_float>` **blend_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` optimize=true **)**
Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from :ref:`AnimationRootNode<class_AnimationRootNode>` instead, else editors will not display your node for addition.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_get_caption:
- :ref:`String<class_String>` **get_caption** **(** **)** |virtual|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_caption** **(** **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to override the text caption for this node.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_get_child_by_name:
- :ref:`Object<class_Object>` **get_child_by_name** **(** :ref:`String<class_String>` name **)** |virtual|
.. rst-class:: classref-method
:ref:`Object<class_Object>` **get_child_by_name** **(** :ref:`String<class_String>` name **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to return a child node by its ``name``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_get_child_nodes:
- :ref:`Dictionary<class_Dictionary>` **get_child_nodes** **(** **)** |virtual|
.. rst-class:: classref-method
:ref:`Dictionary<class_Dictionary>` **get_child_nodes** **(** **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to return all children nodes in order as a ``name: node`` dictionary.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_get_input_count:
- :ref:`int<class_int>` **get_input_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_input_count** **(** **)** |const|
Amount of inputs in this node, only useful for nodes that go into :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_get_input_name:
- :ref:`String<class_String>` **get_input_name** **(** :ref:`int<class_int>` input **)**
.. rst-class:: classref-method
:ref:`String<class_String>` **get_input_name** **(** :ref:`int<class_int>` input **)**
Gets the name of an input by index.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_get_parameter:
- :ref:`Variant<class_Variant>` **get_parameter** **(** :ref:`String<class_String>` name **)** |const|
.. rst-class:: classref-method
:ref:`Variant<class_Variant>` **get_parameter** **(** :ref:`String<class_String>` name **)** |const|
Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_get_parameter_default_value:
- :ref:`Variant<class_Variant>` **get_parameter_default_value** **(** :ref:`String<class_String>` name **)** |virtual|
.. rst-class:: classref-method
:ref:`Variant<class_Variant>` **get_parameter_default_value** **(** :ref:`String<class_String>` name **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to return the default value of parameter "``name``". Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_get_parameter_list:
- :ref:`Array<class_Array>` **get_parameter_list** **(** **)** |virtual|
.. rst-class:: classref-method
:ref:`Array<class_Array>` **get_parameter_list** **(** **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to return a list of the properties on this node. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to :ref:`Object.get_property_list<class_Object_method_get_property_list>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_has_filter:
- :ref:`bool<class_bool>` **has_filter** **(** **)** |virtual|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_filter** **(** **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to return whether the blend tree editor should display filter editing on this node.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_is_path_filtered:
- :ref:`bool<class_bool>` **is_path_filtered** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_path_filtered** **(** :ref:`NodePath<class_NodePath>` path **)** |const|
Returns whether the given path is filtered.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_process:
- void **process** **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek **)** |virtual|
.. rst-class:: classref-method
void **process** **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek **)** |virtual|
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to run some code when this node is processed. The ``time`` parameter is a relative delta, unless ``seek`` is ``true``, in which case it is absolute.
@@ -256,30 +377,43 @@ Here, call the :ref:`blend_input<class_AnimationNode_method_blend_input>`, :ref:
This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called).
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_remove_input:
- void **remove_input** **(** :ref:`int<class_int>` index **)**
.. rst-class:: classref-method
void **remove_input** **(** :ref:`int<class_int>` index **)**
Removes an input, call this only when inactive.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_set_filter_path:
- void **set_filter_path** **(** :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)**
.. rst-class:: classref-method
void **set_filter_path** **(** :ref:`NodePath<class_NodePath>` path, :ref:`bool<class_bool>` enable **)**
Adds or removes a path for the filter.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNode_method_set_parameter:
- void **set_parameter** **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)**
.. rst-class:: classref-method
void **set_parameter** **(** :ref:`String<class_String>` name, :ref:`Variant<class_Variant>` value **)**
Sets a custom parameter. These are used as local memory, because resources can be reused across the tree or scenes.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,40 +14,55 @@ AnimationNodeAdd2
Blends two animations additively inside of an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
.. rst-class:: classref-introduction-group
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. Blends two animations additively based on an amount value in the ``[0.0, 1.0]`` range.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------+----------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeAdd2_property_sync>` | ``false`` |
+-------------------------+----------------------------------------------------+-----------+
.. table::
:widths: auto
+-------------------------+----------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeAdd2_property_sync>` | ``false`` |
+-------------------------+----------------------------------------------------+-----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNodeAdd2_property_sync:
- :ref:`bool<class_bool>` **sync**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_use_sync(value) |
+-----------+---------------------+
| *Getter* | is_using_sync() |
+-----------+---------------------+
:ref:`bool<class_bool>` **sync** = ``false``
.. rst-class:: classref-property-setget
- void **set_use_sync** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_using_sync** **(** **)**
If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input<class_AnimationNode_method_blend_input>`, forcing the blended animations to update every frame.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AnimationNodeAdd3
Blends two of three animations additively inside of an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -27,6 +29,8 @@ This node has three inputs:
- A +add animation to blend with when the blend amount is in the ``[0.0, 1.0]`` range
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -34,30 +38,41 @@ Tutorials
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------+----------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeAdd3_property_sync>` | ``false`` |
+-------------------------+----------------------------------------------------+-----------+
.. table::
:widths: auto
+-------------------------+----------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeAdd3_property_sync>` | ``false`` |
+-------------------------+----------------------------------------------------+-----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNodeAdd3_property_sync:
- :ref:`bool<class_bool>` **sync**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_use_sync(value) |
+-----------+---------------------+
| *Getter* | is_using_sync() |
+-----------+---------------------+
:ref:`bool<class_bool>` **sync** = ``false``
.. rst-class:: classref-property-setget
- void **set_use_sync** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_using_sync** **(** **)**
If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input<class_AnimationNode_method_blend_input>`, forcing the blended animations to update every frame.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,11 +14,15 @@ AnimationNodeAnimation
Input animation to use in an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
.. rst-class:: classref-introduction-group
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. Only features one output set using the :ref:`animation<class_AnimationNodeAnimation_property_animation>` property. Use it as an input for :ref:`AnimationNode<class_AnimationNode>` that blend animations together.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -28,30 +32,41 @@ Tutorials
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------+-------------------------------------------------------------------+--------+
| :ref:`String<class_String>` | :ref:`animation<class_AnimationNodeAnimation_property_animation>` | ``""`` |
+-----------------------------+-------------------------------------------------------------------+--------+
.. table::
:widths: auto
+-----------------------------+-------------------------------------------------------------------+--------+
| :ref:`String<class_String>` | :ref:`animation<class_AnimationNodeAnimation_property_animation>` | ``""`` |
+-----------------------------+-------------------------------------------------------------------+--------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNodeAnimation_property_animation:
- :ref:`String<class_String>` **animation**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``""`` |
+-----------+----------------------+
| *Setter* | set_animation(value) |
+-----------+----------------------+
| *Getter* | get_animation() |
+-----------+----------------------+
:ref:`String<class_String>` **animation** = ``""``
.. rst-class:: classref-property-setget
- void **set_animation** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_animation** **(** **)**
Animation to use as an output. It is one of the animations provided by :ref:`AnimationTree.anim_player<class_AnimationTree_property_anim_player>`.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,11 +14,15 @@ AnimationNodeBlend2
Blends two animations linearly inside of an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
.. rst-class:: classref-introduction-group
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. Blends two animations linearly based on an amount value in the ``[0.0, 1.0]`` range.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -28,30 +32,41 @@ Tutorials
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------+------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeBlend2_property_sync>` | ``false`` |
+-------------------------+------------------------------------------------------+-----------+
.. table::
:widths: auto
+-------------------------+------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeBlend2_property_sync>` | ``false`` |
+-------------------------+------------------------------------------------------+-----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNodeBlend2_property_sync:
- :ref:`bool<class_bool>` **sync**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_use_sync(value) |
+-----------+---------------------+
| *Getter* | is_using_sync() |
+-----------+---------------------+
:ref:`bool<class_bool>` **sync** = ``false``
.. rst-class:: classref-property-setget
- void **set_use_sync** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_using_sync** **(** **)**
If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input<class_AnimationNode_method_blend_input>`, forcing the blended animations to update every frame.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AnimationNodeBlend3
Blends two of three animations linearly inside of an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -27,35 +29,48 @@ This node has three inputs:
- A +blend animation to blend with when the blend amount is in the ``[0.0, 1.0]`` range
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------+------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeBlend3_property_sync>` | ``false`` |
+-------------------------+------------------------------------------------------+-----------+
.. table::
:widths: auto
+-------------------------+------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeBlend3_property_sync>` | ``false`` |
+-------------------------+------------------------------------------------------+-----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNodeBlend3_property_sync:
- :ref:`bool<class_bool>` **sync**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_use_sync(value) |
+-----------+---------------------+
| *Getter* | is_using_sync() |
+-----------+---------------------+
:ref:`bool<class_bool>` **sync** = ``false``
.. rst-class:: classref-property-setget
- void **set_use_sync** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_using_sync** **(** **)**
If ``true``, sets the ``optimization`` to ``false`` when calling :ref:`AnimationNode.blend_input<class_AnimationNode_method_blend_input>`, forcing the blended animations to update every frame.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AnimationNodeBlendSpace1D
Blends linearly between two of any number of :ref:`AnimationNode<class_AnimationNode>` of any type placed on a virtual axis.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -25,165 +27,218 @@ Outputs the linear blend of the two :ref:`AnimationNode<class_AnimationNode>`\ s
You can set the extents of the axis using the :ref:`min_space<class_AnimationNodeBlendSpace1D_property_min_space>` and :ref:`max_space<class_AnimationNodeBlendSpace1D_property_max_space>`.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`max_space<class_AnimationNodeBlendSpace1D_property_max_space>` | ``1.0`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`min_space<class_AnimationNodeBlendSpace1D_property_min_space>` | ``-1.0`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`snap<class_AnimationNodeBlendSpace1D_property_snap>` | ``0.1`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`String<class_String>` | :ref:`value_label<class_AnimationNodeBlendSpace1D_property_value_label>` | ``"value"`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
.. table::
:widths: auto
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`max_space<class_AnimationNodeBlendSpace1D_property_max_space>` | ``1.0`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`min_space<class_AnimationNodeBlendSpace1D_property_min_space>` | ``-1.0`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`snap<class_AnimationNodeBlendSpace1D_property_snap>` | ``0.1`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
| :ref:`String<class_String>` | :ref:`value_label<class_AnimationNodeBlendSpace1D_property_value_label>` | ``"value"`` |
+-----------------------------+--------------------------------------------------------------------------+-------------+
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>` **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`float<class_float>` pos, :ref:`int<class_int>` at_index=-1 **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_blend_point_count<class_AnimationNodeBlendSpace1D_method_get_blend_point_count>` **(** **)** |const| |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationRootNode<class_AnimationRootNode>` | :ref:`get_blend_point_node<class_AnimationNodeBlendSpace1D_method_get_blend_point_node>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_blend_point_position<class_AnimationNodeBlendSpace1D_method_get_blend_point_position>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_blend_point<class_AnimationNodeBlendSpace1D_method_remove_blend_point>` **(** :ref:`int<class_int>` point **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_node<class_AnimationNodeBlendSpace1D_method_set_blend_point_node>` **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_position<class_AnimationNodeBlendSpace1D_method_set_blend_point_position>` **(** :ref:`int<class_int>` point, :ref:`float<class_float>` pos **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>` **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`float<class_float>` pos, :ref:`int<class_int>` at_index=-1 **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_blend_point_count<class_AnimationNodeBlendSpace1D_method_get_blend_point_count>` **(** **)** |const| |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationRootNode<class_AnimationRootNode>` | :ref:`get_blend_point_node<class_AnimationNodeBlendSpace1D_method_get_blend_point_node>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_blend_point_position<class_AnimationNodeBlendSpace1D_method_get_blend_point_position>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_blend_point<class_AnimationNodeBlendSpace1D_method_remove_blend_point>` **(** :ref:`int<class_int>` point **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_node<class_AnimationNodeBlendSpace1D_method_set_blend_point_node>` **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_position<class_AnimationNodeBlendSpace1D_method_set_blend_point_position>` **(** :ref:`int<class_int>` point, :ref:`float<class_float>` pos **)** |
+---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNodeBlendSpace1D_property_max_space:
- :ref:`float<class_float>` **max_space**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``1.0`` |
+-----------+----------------------+
| *Setter* | set_max_space(value) |
+-----------+----------------------+
| *Getter* | get_max_space() |
+-----------+----------------------+
:ref:`float<class_float>` **max_space** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_max_space** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_max_space** **(** **)**
The blend space's axis's upper limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace1D_property_min_space:
- :ref:`float<class_float>` **min_space**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``-1.0`` |
+-----------+----------------------+
| *Setter* | set_min_space(value) |
+-----------+----------------------+
| *Getter* | get_min_space() |
+-----------+----------------------+
:ref:`float<class_float>` **min_space** = ``-1.0``
.. rst-class:: classref-property-setget
- void **set_min_space** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_min_space** **(** **)**
The blend space's axis's lower limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace1D_property_snap:
- :ref:`float<class_float>` **snap**
.. rst-class:: classref-property
+-----------+-----------------+
| *Default* | ``0.1`` |
+-----------+-----------------+
| *Setter* | set_snap(value) |
+-----------+-----------------+
| *Getter* | get_snap() |
+-----------+-----------------+
:ref:`float<class_float>` **snap** = ``0.1``
.. rst-class:: classref-property-setget
- void **set_snap** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_snap** **(** **)**
Position increment to snap to when moving a point on the axis.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace1D_property_value_label:
- :ref:`String<class_String>` **value_label**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``"value"`` |
+-----------+------------------------+
| *Setter* | set_value_label(value) |
+-----------+------------------------+
| *Getter* | get_value_label() |
+-----------+------------------------+
:ref:`String<class_String>` **value_label** = ``"value"``
.. rst-class:: classref-property-setget
- void **set_value_label** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_value_label** **(** **)**
Label of the virtual axis of the blend space.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimationNodeBlendSpace1D_method_add_blend_point:
- void **add_blend_point** **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`float<class_float>` pos, :ref:`int<class_int>` at_index=-1 **)**
.. rst-class:: classref-method
void **add_blend_point** **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`float<class_float>` pos, :ref:`int<class_int>` at_index=-1 **)**
Adds a new point that represents a ``node`` on the virtual axis at a given position set by ``pos``. You can insert it at a specific index using the ``at_index`` argument. If you use the default value for ``at_index``, the point is inserted at the end of the blend points array.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace1D_method_get_blend_point_count:
- :ref:`int<class_int>` **get_blend_point_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_blend_point_count** **(** **)** |const|
Returns the number of points on the blend axis.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace1D_method_get_blend_point_node:
- :ref:`AnimationRootNode<class_AnimationRootNode>` **get_blend_point_node** **(** :ref:`int<class_int>` point **)** |const|
.. rst-class:: classref-method
:ref:`AnimationRootNode<class_AnimationRootNode>` **get_blend_point_node** **(** :ref:`int<class_int>` point **)** |const|
Returns the :ref:`AnimationNode<class_AnimationNode>` referenced by the point at index ``point``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace1D_method_get_blend_point_position:
- :ref:`float<class_float>` **get_blend_point_position** **(** :ref:`int<class_int>` point **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_blend_point_position** **(** :ref:`int<class_int>` point **)** |const|
Returns the position of the point at index ``point``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace1D_method_remove_blend_point:
- void **remove_blend_point** **(** :ref:`int<class_int>` point **)**
.. rst-class:: classref-method
void **remove_blend_point** **(** :ref:`int<class_int>` point **)**
Removes the point at index ``point`` from the blend axis.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace1D_method_set_blend_point_node:
- void **set_blend_point_node** **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)**
.. rst-class:: classref-method
void **set_blend_point_node** **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)**
Changes the :ref:`AnimationNode<class_AnimationNode>` referenced by the point at index ``point``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace1D_method_set_blend_point_position:
- void **set_blend_point_position** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` pos **)**
.. rst-class:: classref-method
void **set_blend_point_position** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` pos **)**
Updates the position of the point at index ``point`` on the blend axis.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AnimationNodeBlendSpace2D
Blends linearly between three :ref:`AnimationNode<class_AnimationNode>` of any type placed in a 2D space.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,6 +25,8 @@ This node allows you to blend linearly between three animations using a :ref:`Ve
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 create up the blend space by hand.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -30,282 +34,380 @@ Tutorials
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. rst-class:: classref-reftable-group
Properties
----------
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`auto_triangles<class_AnimationNodeBlendSpace2D_property_auto_triangles>` | ``true`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` | :ref:`blend_mode<class_AnimationNodeBlendSpace2D_property_blend_mode>` | ``0`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`max_space<class_AnimationNodeBlendSpace2D_property_max_space>` | ``Vector2( 1, 1 )`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`min_space<class_AnimationNodeBlendSpace2D_property_min_space>` | ``Vector2( -1, -1 )`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`snap<class_AnimationNodeBlendSpace2D_property_snap>` | ``Vector2( 0.1, 0.1 )`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`x_label<class_AnimationNodeBlendSpace2D_property_x_label>` | ``"x"`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`y_label<class_AnimationNodeBlendSpace2D_property_y_label>` | ``"y"`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
.. table::
:widths: auto
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`auto_triangles<class_AnimationNodeBlendSpace2D_property_auto_triangles>` | ``true`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` | :ref:`blend_mode<class_AnimationNodeBlendSpace2D_property_blend_mode>` | ``0`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`max_space<class_AnimationNodeBlendSpace2D_property_max_space>` | ``Vector2( 1, 1 )`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`min_space<class_AnimationNodeBlendSpace2D_property_min_space>` | ``Vector2( -1, -1 )`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`snap<class_AnimationNodeBlendSpace2D_property_snap>` | ``Vector2( 0.1, 0.1 )`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`x_label<class_AnimationNodeBlendSpace2D_property_x_label>` | ``"x"`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`y_label<class_AnimationNodeBlendSpace2D_property_y_label>` | ``"y"`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>` **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` at_index=-1 **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_triangle<class_AnimationNodeBlendSpace2D_method_add_triangle>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z, :ref:`int<class_int>` at_index=-1 **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_blend_point_count<class_AnimationNodeBlendSpace2D_method_get_blend_point_count>` **(** **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationRootNode<class_AnimationRootNode>` | :ref:`get_blend_point_node<class_AnimationNodeBlendSpace2D_method_get_blend_point_node>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_blend_point_position<class_AnimationNodeBlendSpace2D_method_get_blend_point_position>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_triangle_count<class_AnimationNodeBlendSpace2D_method_get_triangle_count>` **(** **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_triangle_point<class_AnimationNodeBlendSpace2D_method_get_triangle_point>` **(** :ref:`int<class_int>` triangle, :ref:`int<class_int>` point **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_blend_point<class_AnimationNodeBlendSpace2D_method_remove_blend_point>` **(** :ref:`int<class_int>` point **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_triangle<class_AnimationNodeBlendSpace2D_method_remove_triangle>` **(** :ref:`int<class_int>` triangle **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_node<class_AnimationNodeBlendSpace2D_method_set_blend_point_node>` **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_position<class_AnimationNodeBlendSpace2D_method_set_blend_point_position>` **(** :ref:`int<class_int>` point, :ref:`Vector2<class_Vector2>` pos **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>` **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` at_index=-1 **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_triangle<class_AnimationNodeBlendSpace2D_method_add_triangle>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z, :ref:`int<class_int>` at_index=-1 **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_blend_point_count<class_AnimationNodeBlendSpace2D_method_get_blend_point_count>` **(** **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationRootNode<class_AnimationRootNode>` | :ref:`get_blend_point_node<class_AnimationNodeBlendSpace2D_method_get_blend_point_node>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_blend_point_position<class_AnimationNodeBlendSpace2D_method_get_blend_point_position>` **(** :ref:`int<class_int>` point **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_triangle_count<class_AnimationNodeBlendSpace2D_method_get_triangle_count>` **(** **)** |const| |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_triangle_point<class_AnimationNodeBlendSpace2D_method_get_triangle_point>` **(** :ref:`int<class_int>` triangle, :ref:`int<class_int>` point **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_blend_point<class_AnimationNodeBlendSpace2D_method_remove_blend_point>` **(** :ref:`int<class_int>` point **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_triangle<class_AnimationNodeBlendSpace2D_method_remove_triangle>` **(** :ref:`int<class_int>` triangle **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_node<class_AnimationNodeBlendSpace2D_method_set_blend_point_node>` **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_point_position<class_AnimationNodeBlendSpace2D_method_set_blend_point_position>` **(** :ref:`int<class_int>` point, :ref:`Vector2<class_Vector2>` pos **)** |
+---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_AnimationNodeBlendSpace2D_signal_triangles_updated:
- **triangles_updated** **(** **)**
.. rst-class:: classref-signal
**triangles_updated** **(** **)**
Emitted every time the blend space's triangles are created, removed, or when one of their vertices changes position.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AnimationNodeBlendSpace2D_BlendMode:
.. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_INTERPOLATED:
.. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE:
.. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE_CARRY:
.. rst-class:: classref-enumeration
enum **BlendMode**:
- **BLEND_MODE_INTERPOLATED** = **0** --- The interpolation between animations is linear.
.. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_INTERPOLATED:
- **BLEND_MODE_DISCRETE** = **1** --- The blend space plays the animation of the node the blending position is closest to. Useful for frame-by-frame 2D animations.
.. rst-class:: classref-enumeration-constant
- **BLEND_MODE_DISCRETE_CARRY** = **2** --- Similar to :ref:`BLEND_MODE_DISCRETE<class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE>`, but starts the new animation at the last animation's playback position.
:ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` **BLEND_MODE_INTERPOLATED** = ``0``
The interpolation between animations is linear.
.. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE:
.. rst-class:: classref-enumeration-constant
:ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` **BLEND_MODE_DISCRETE** = ``1``
The blend space plays the animation of the node the blending position is closest to. Useful for frame-by-frame 2D animations.
.. _class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE_CARRY:
.. rst-class:: classref-enumeration-constant
:ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` **BLEND_MODE_DISCRETE_CARRY** = ``2``
Similar to :ref:`BLEND_MODE_DISCRETE<class_AnimationNodeBlendSpace2D_constant_BLEND_MODE_DISCRETE>`, but starts the new animation at the last animation's playback position.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNodeBlendSpace2D_property_auto_triangles:
- :ref:`bool<class_bool>` **auto_triangles**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``true`` |
+-----------+---------------------------+
| *Setter* | set_auto_triangles(value) |
+-----------+---------------------------+
| *Getter* | get_auto_triangles() |
+-----------+---------------------------+
:ref:`bool<class_bool>` **auto_triangles** = ``true``
.. rst-class:: classref-property-setget
- void **set_auto_triangles** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_auto_triangles** **(** **)**
If ``true``, the blend space is triangulated automatically. The mesh updates every time you add or remove points with :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>` and :ref:`remove_blend_point<class_AnimationNodeBlendSpace2D_method_remove_blend_point>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_property_blend_mode:
- :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` **blend_mode**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``0`` |
+-----------+-----------------------+
| *Setter* | set_blend_mode(value) |
+-----------+-----------------------+
| *Getter* | get_blend_mode() |
+-----------+-----------------------+
:ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` **blend_mode** = ``0``
.. rst-class:: classref-property-setget
- void **set_blend_mode** **(** :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` value **)**
- :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` **get_blend_mode** **(** **)**
Controls the interpolation between animations. See :ref:`BlendMode<enum_AnimationNodeBlendSpace2D_BlendMode>` constants.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_property_max_space:
- :ref:`Vector2<class_Vector2>` **max_space**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``Vector2( 1, 1 )`` |
+-----------+----------------------+
| *Setter* | set_max_space(value) |
+-----------+----------------------+
| *Getter* | get_max_space() |
+-----------+----------------------+
:ref:`Vector2<class_Vector2>` **max_space** = ``Vector2( 1, 1 )``
.. rst-class:: classref-property-setget
- void **set_max_space** **(** :ref:`Vector2<class_Vector2>` value **)**
- :ref:`Vector2<class_Vector2>` **get_max_space** **(** **)**
The blend space's X and Y axes' upper limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_property_min_space:
- :ref:`Vector2<class_Vector2>` **min_space**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``Vector2( -1, -1 )`` |
+-----------+-----------------------+
| *Setter* | set_min_space(value) |
+-----------+-----------------------+
| *Getter* | get_min_space() |
+-----------+-----------------------+
:ref:`Vector2<class_Vector2>` **min_space** = ``Vector2( -1, -1 )``
.. rst-class:: classref-property-setget
- void **set_min_space** **(** :ref:`Vector2<class_Vector2>` value **)**
- :ref:`Vector2<class_Vector2>` **get_min_space** **(** **)**
The blend space's X and Y axes' lower limit for the points' position. See :ref:`add_blend_point<class_AnimationNodeBlendSpace2D_method_add_blend_point>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_property_snap:
- :ref:`Vector2<class_Vector2>` **snap**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``Vector2( 0.1, 0.1 )`` |
+-----------+-------------------------+
| *Setter* | set_snap(value) |
+-----------+-------------------------+
| *Getter* | get_snap() |
+-----------+-------------------------+
:ref:`Vector2<class_Vector2>` **snap** = ``Vector2( 0.1, 0.1 )``
.. rst-class:: classref-property-setget
- void **set_snap** **(** :ref:`Vector2<class_Vector2>` value **)**
- :ref:`Vector2<class_Vector2>` **get_snap** **(** **)**
Position increment to snap to when moving a point.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_property_x_label:
- :ref:`String<class_String>` **x_label**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``"x"`` |
+-----------+--------------------+
| *Setter* | set_x_label(value) |
+-----------+--------------------+
| *Getter* | get_x_label() |
+-----------+--------------------+
:ref:`String<class_String>` **x_label** = ``"x"``
.. rst-class:: classref-property-setget
- void **set_x_label** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_x_label** **(** **)**
Name of the blend space's X axis.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_property_y_label:
- :ref:`String<class_String>` **y_label**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``"y"`` |
+-----------+--------------------+
| *Setter* | set_y_label(value) |
+-----------+--------------------+
| *Getter* | get_y_label() |
+-----------+--------------------+
:ref:`String<class_String>` **y_label** = ``"y"``
.. rst-class:: classref-property-setget
- void **set_y_label** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_y_label** **(** **)**
Name of the blend space's Y axis.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimationNodeBlendSpace2D_method_add_blend_point:
- void **add_blend_point** **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` at_index=-1 **)**
.. rst-class:: classref-method
void **add_blend_point** **(** :ref:`AnimationRootNode<class_AnimationRootNode>` node, :ref:`Vector2<class_Vector2>` pos, :ref:`int<class_int>` at_index=-1 **)**
Adds a new point that represents a ``node`` at the position set by ``pos``. You can insert it at a specific index using the ``at_index`` argument. If you use the default value for ``at_index``, the point is inserted at the end of the blend points array.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_method_add_triangle:
- void **add_triangle** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z, :ref:`int<class_int>` at_index=-1 **)**
.. rst-class:: classref-method
void **add_triangle** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`int<class_int>` z, :ref:`int<class_int>` at_index=-1 **)**
Creates a new triangle using three points ``x``, ``y``, and ``z``. Triangles can overlap. You can insert the triangle at a specific index using the ``at_index`` argument. If you use the default value for ``at_index``, the point is inserted at the end of the blend points array.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_method_get_blend_point_count:
- :ref:`int<class_int>` **get_blend_point_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_blend_point_count** **(** **)** |const|
Returns the number of points in the blend space.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_method_get_blend_point_node:
- :ref:`AnimationRootNode<class_AnimationRootNode>` **get_blend_point_node** **(** :ref:`int<class_int>` point **)** |const|
.. rst-class:: classref-method
:ref:`AnimationRootNode<class_AnimationRootNode>` **get_blend_point_node** **(** :ref:`int<class_int>` point **)** |const|
Returns the :ref:`AnimationRootNode<class_AnimationRootNode>` referenced by the point at index ``point``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_method_get_blend_point_position:
- :ref:`Vector2<class_Vector2>` **get_blend_point_position** **(** :ref:`int<class_int>` point **)** |const|
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_blend_point_position** **(** :ref:`int<class_int>` point **)** |const|
Returns the position of the point at index ``point``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_method_get_triangle_count:
- :ref:`int<class_int>` **get_triangle_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_triangle_count** **(** **)** |const|
Returns the number of triangles in the blend space.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_method_get_triangle_point:
- :ref:`int<class_int>` **get_triangle_point** **(** :ref:`int<class_int>` triangle, :ref:`int<class_int>` point **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **get_triangle_point** **(** :ref:`int<class_int>` triangle, :ref:`int<class_int>` point **)**
Returns the position of the point at index ``point`` in the triangle of index ``triangle``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_method_remove_blend_point:
- void **remove_blend_point** **(** :ref:`int<class_int>` point **)**
.. rst-class:: classref-method
void **remove_blend_point** **(** :ref:`int<class_int>` point **)**
Removes the point at index ``point`` from the blend space.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_method_remove_triangle:
- void **remove_triangle** **(** :ref:`int<class_int>` triangle **)**
.. rst-class:: classref-method
void **remove_triangle** **(** :ref:`int<class_int>` triangle **)**
Removes the triangle at index ``triangle`` from the blend space.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_method_set_blend_point_node:
- void **set_blend_point_node** **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)**
.. rst-class:: classref-method
void **set_blend_point_node** **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)**
Changes the :ref:`AnimationNode<class_AnimationNode>` referenced by the point at index ``point``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendSpace2D_method_set_blend_point_position:
- void **set_blend_point_position** **(** :ref:`int<class_int>` point, :ref:`Vector2<class_Vector2>` pos **)**
.. rst-class:: classref-method
void **set_blend_point_position** **(** :ref:`int<class_int>` point, :ref:`Vector2<class_Vector2>` pos **)**
Updates the position of the point at index ``point`` on the blend axis.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AnimationNodeBlendTree
:ref:`AnimationTree<class_AnimationTree>` node resource that contains many blend type nodes.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -21,158 +23,246 @@ This node may contain a sub-tree of any other blend type nodes, such as :ref:`An
An :ref:`AnimationNodeOutput<class_AnimationNodeOutput>` node named ``output`` is created by default.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------------+-------------------------------------------------------------------------+---------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`graph_offset<class_AnimationNodeBlendTree_property_graph_offset>` | ``Vector2( 0, 0 )`` |
+-------------------------------+-------------------------------------------------------------------------+---------------------+
.. table::
:widths: auto
+-------------------------------+-------------------------------------------------------------------------+---------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`graph_offset<class_AnimationNodeBlendTree_property_graph_offset>` | ``Vector2( 0, 0 )`` |
+-------------------------------+-------------------------------------------------------------------------+---------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_node<class_AnimationNodeBlendTree_method_add_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`connect_node<class_AnimationNodeBlendTree_method_connect_node>` **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index, :ref:`String<class_String>` output_node **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`disconnect_node<class_AnimationNodeBlendTree_method_disconnect_node>` **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`get_node<class_AnimationNodeBlendTree_method_get_node>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_AnimationNodeBlendTree_method_get_node_position>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_node<class_AnimationNodeBlendTree_method_has_node>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_node<class_AnimationNodeBlendTree_method_remove_node>` **(** :ref:`String<class_String>` name **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_node<class_AnimationNodeBlendTree_method_rename_node>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_node_position<class_AnimationNodeBlendTree_method_set_node_position>` **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_node<class_AnimationNodeBlendTree_method_add_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`connect_node<class_AnimationNodeBlendTree_method_connect_node>` **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index, :ref:`String<class_String>` output_node **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`disconnect_node<class_AnimationNodeBlendTree_method_disconnect_node>` **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`get_node<class_AnimationNodeBlendTree_method_get_node>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_AnimationNodeBlendTree_method_get_node_position>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_node<class_AnimationNodeBlendTree_method_has_node>` **(** :ref:`String<class_String>` name **)** |const| |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_node<class_AnimationNodeBlendTree_method_remove_node>` **(** :ref:`String<class_String>` name **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_node<class_AnimationNodeBlendTree_method_rename_node>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_node_position<class_AnimationNodeBlendTree_method_set_node_position>` **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)** |
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Constants
---------
.. _class_AnimationNodeBlendTree_constant_CONNECTION_OK:
.. rst-class:: classref-constant
**CONNECTION_OK** = ``0``
The connection was successful.
.. _class_AnimationNodeBlendTree_constant_CONNECTION_ERROR_NO_INPUT:
.. rst-class:: classref-constant
**CONNECTION_ERROR_NO_INPUT** = ``1``
The input node is ``null``.
.. _class_AnimationNodeBlendTree_constant_CONNECTION_ERROR_NO_INPUT_INDEX:
.. rst-class:: classref-constant
**CONNECTION_ERROR_NO_INPUT_INDEX** = ``2``
The specified input port is out of range.
.. _class_AnimationNodeBlendTree_constant_CONNECTION_ERROR_NO_OUTPUT:
.. rst-class:: classref-constant
**CONNECTION_ERROR_NO_OUTPUT** = ``3``
The output node is ``null``.
.. _class_AnimationNodeBlendTree_constant_CONNECTION_ERROR_SAME_NODE:
.. rst-class:: classref-constant
**CONNECTION_ERROR_SAME_NODE** = ``4``
Input and output nodes are the same.
.. _class_AnimationNodeBlendTree_constant_CONNECTION_ERROR_CONNECTION_EXISTS:
- **CONNECTION_OK** = **0** --- The connection was successful.
.. rst-class:: classref-constant
- **CONNECTION_ERROR_NO_INPUT** = **1** --- The input node is ``null``.
**CONNECTION_ERROR_CONNECTION_EXISTS** = ``5``
- **CONNECTION_ERROR_NO_INPUT_INDEX** = **2** --- The specified input port is out of range.
The specified connection already exists.
- **CONNECTION_ERROR_NO_OUTPUT** = **3** --- The output node is ``null``.
.. rst-class:: classref-section-separator
- **CONNECTION_ERROR_SAME_NODE** = **4** --- Input and output nodes are the same.
----
- **CONNECTION_ERROR_CONNECTION_EXISTS** = **5** --- The specified connection already exists.
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNodeBlendTree_property_graph_offset:
- :ref:`Vector2<class_Vector2>` **graph_offset**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``Vector2( 0, 0 )`` |
+-----------+-------------------------+
| *Setter* | set_graph_offset(value) |
+-----------+-------------------------+
| *Getter* | get_graph_offset() |
+-----------+-------------------------+
:ref:`Vector2<class_Vector2>` **graph_offset** = ``Vector2( 0, 0 )``
.. rst-class:: classref-property-setget
- void **set_graph_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
- :ref:`Vector2<class_Vector2>` **get_graph_offset** **(** **)**
The global offset of all sub-nodes.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimationNodeBlendTree_method_add_node:
- void **add_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)**
.. rst-class:: classref-method
void **add_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)**
Adds an :ref:`AnimationNode<class_AnimationNode>` at the given ``position``. The ``name`` is used to identify the created sub-node later.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendTree_method_connect_node:
- void **connect_node** **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index, :ref:`String<class_String>` output_node **)**
.. rst-class:: classref-method
void **connect_node** **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index, :ref:`String<class_String>` output_node **)**
Connects the output of an :ref:`AnimationNode<class_AnimationNode>` as input for another :ref:`AnimationNode<class_AnimationNode>`, at the input port specified by ``input_index``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendTree_method_disconnect_node:
- void **disconnect_node** **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index **)**
.. rst-class:: classref-method
void **disconnect_node** **(** :ref:`String<class_String>` input_node, :ref:`int<class_int>` input_index **)**
Disconnects the node connected to the specified input.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendTree_method_get_node:
- :ref:`AnimationNode<class_AnimationNode>` **get_node** **(** :ref:`String<class_String>` name **)** |const|
.. rst-class:: classref-method
:ref:`AnimationNode<class_AnimationNode>` **get_node** **(** :ref:`String<class_String>` name **)** |const|
Returns the sub-node with the specified ``name``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendTree_method_get_node_position:
- :ref:`Vector2<class_Vector2>` **get_node_position** **(** :ref:`String<class_String>` name **)** |const|
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_node_position** **(** :ref:`String<class_String>` name **)** |const|
Returns the position of the sub-node with the specified ``name``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendTree_method_has_node:
- :ref:`bool<class_bool>` **has_node** **(** :ref:`String<class_String>` name **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_node** **(** :ref:`String<class_String>` name **)** |const|
Returns ``true`` if a sub-node with specified ``name`` exists.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendTree_method_remove_node:
- void **remove_node** **(** :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
void **remove_node** **(** :ref:`String<class_String>` name **)**
Removes a sub-node.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendTree_method_rename_node:
- void **rename_node** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)**
.. rst-class:: classref-method
void **rename_node** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)**
Changes the name of a sub-node.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeBlendTree_method_set_node_position:
- void **set_node_position** **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)**
.. rst-class:: classref-method
void **set_node_position** **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)**
Modifies the position of a sub-node.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,11 +14,15 @@ AnimationNodeOneShot
Plays an animation once in :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
.. rst-class:: classref-introduction-group
Description
-----------
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. This node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -26,145 +30,194 @@ Tutorials
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`autorestart<class_AnimationNodeOneShot_property_autorestart>` | ``false`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`autorestart_delay<class_AnimationNodeOneShot_property_autorestart_delay>` | ``1.0`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`autorestart_random_delay<class_AnimationNodeOneShot_property_autorestart_random_delay>` | ``0.0`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`fadein_time<class_AnimationNodeOneShot_property_fadein_time>` | ``0.1`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`fadeout_time<class_AnimationNodeOneShot_property_fadeout_time>` | ``0.1`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` | :ref:`mix_mode<class_AnimationNodeOneShot_property_mix_mode>` | ``0`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeOneShot_property_sync>` | ``false`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
.. table::
:widths: auto
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`autorestart<class_AnimationNodeOneShot_property_autorestart>` | ``false`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`autorestart_delay<class_AnimationNodeOneShot_property_autorestart_delay>` | ``1.0`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`autorestart_random_delay<class_AnimationNodeOneShot_property_autorestart_random_delay>` | ``0.0`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`fadein_time<class_AnimationNodeOneShot_property_fadein_time>` | ``0.1`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`fadeout_time<class_AnimationNodeOneShot_property_fadeout_time>` | ``0.1`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` | :ref:`mix_mode<class_AnimationNodeOneShot_property_mix_mode>` | ``0`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeOneShot_property_sync>` | ``false`` |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AnimationNodeOneShot_MixMode:
.. _class_AnimationNodeOneShot_constant_MIX_MODE_BLEND:
.. _class_AnimationNodeOneShot_constant_MIX_MODE_ADD:
.. rst-class:: classref-enumeration
enum **MixMode**:
- **MIX_MODE_BLEND** = **0**
.. _class_AnimationNodeOneShot_constant_MIX_MODE_BLEND:
- **MIX_MODE_ADD** = **1**
.. rst-class:: classref-enumeration-constant
:ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` **MIX_MODE_BLEND** = ``0``
.. _class_AnimationNodeOneShot_constant_MIX_MODE_ADD:
.. rst-class:: classref-enumeration-constant
:ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` **MIX_MODE_ADD** = ``1``
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNodeOneShot_property_autorestart:
- :ref:`bool<class_bool>` **autorestart**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``false`` |
+-----------+------------------------+
| *Setter* | set_autorestart(value) |
+-----------+------------------------+
| *Getter* | has_autorestart() |
+-----------+------------------------+
:ref:`bool<class_bool>` **autorestart** = ``false``
.. rst-class:: classref-property-setget
- void **set_autorestart** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **has_autorestart** **(** **)**
If ``true``, the sub-animation will restart automatically after finishing.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeOneShot_property_autorestart_delay:
- :ref:`float<class_float>` **autorestart_delay**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------------+
| *Setter* | set_autorestart_delay(value) |
+-----------+------------------------------+
| *Getter* | get_autorestart_delay() |
+-----------+------------------------------+
:ref:`float<class_float>` **autorestart_delay** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_autorestart_delay** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_autorestart_delay** **(** **)**
The delay after which the automatic restart is triggered, in seconds.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeOneShot_property_autorestart_random_delay:
- :ref:`float<class_float>` **autorestart_random_delay**
.. rst-class:: classref-property
+-----------+-------------------------------------+
| *Default* | ``0.0`` |
+-----------+-------------------------------------+
| *Setter* | set_autorestart_random_delay(value) |
+-----------+-------------------------------------+
| *Getter* | get_autorestart_random_delay() |
+-----------+-------------------------------------+
:ref:`float<class_float>` **autorestart_random_delay** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_autorestart_random_delay** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_autorestart_random_delay** **(** **)**
If :ref:`autorestart<class_AnimationNodeOneShot_property_autorestart>` is ``true``, a random additional delay (in seconds) between 0 and this value will be added to :ref:`autorestart_delay<class_AnimationNodeOneShot_property_autorestart_delay>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeOneShot_property_fadein_time:
- :ref:`float<class_float>` **fadein_time**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``0.1`` |
+-----------+------------------------+
| *Setter* | set_fadein_time(value) |
+-----------+------------------------+
| *Getter* | get_fadein_time() |
+-----------+------------------------+
:ref:`float<class_float>` **fadein_time** = ``0.1``
.. rst-class:: classref-property-setget
- void **set_fadein_time** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_fadein_time** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeOneShot_property_fadeout_time:
- :ref:`float<class_float>` **fadeout_time**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``0.1`` |
+-----------+-------------------------+
| *Setter* | set_fadeout_time(value) |
+-----------+-------------------------+
| *Getter* | get_fadeout_time() |
+-----------+-------------------------+
:ref:`float<class_float>` **fadeout_time** = ``0.1``
.. rst-class:: classref-property-setget
- void **set_fadeout_time** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_fadeout_time** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeOneShot_property_mix_mode:
- :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` **mix_mode**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``0`` |
+-----------+---------------------+
| *Setter* | set_mix_mode(value) |
+-----------+---------------------+
| *Getter* | get_mix_mode() |
+-----------+---------------------+
:ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` **mix_mode** = ``0``
.. rst-class:: classref-property-setget
- void **set_mix_mode** **(** :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` value **)**
- :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` **get_mix_mode** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeOneShot_property_sync:
- :ref:`bool<class_bool>` **sync**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_use_sync(value) |
+-----------+---------------------+
| *Getter* | is_using_sync() |
+-----------+---------------------+
:ref:`bool<class_bool>` **sync** = ``false``
.. rst-class:: classref-property-setget
- void **set_use_sync** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_using_sync** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AnimationNodeOutput
Generic output node to be added to :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -26,3 +28,4 @@ Tutorials
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AnimationNodeStateMachine
State machine for control of animations.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -26,247 +28,351 @@ Contains multiple nodes representing animation states, connected in a graph. Nod
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_node<class_AnimationNodeStateMachine_method_add_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_transition<class_AnimationNodeStateMachine_method_add_transition>` **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to, :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` transition **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_end_node<class_AnimationNodeStateMachine_method_get_end_node>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_graph_offset<class_AnimationNodeStateMachine_method_get_graph_offset>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`get_node<class_AnimationNodeStateMachine_method_get_node>` **(** :ref:`String<class_String>` name **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_node_name<class_AnimationNodeStateMachine_method_get_node_name>` **(** :ref:`AnimationNode<class_AnimationNode>` node **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_AnimationNodeStateMachine_method_get_node_position>` **(** :ref:`String<class_String>` name **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_start_node<class_AnimationNodeStateMachine_method_get_start_node>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` | :ref:`get_transition<class_AnimationNodeStateMachine_method_get_transition>` **(** :ref:`int<class_int>` idx **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_transition_count<class_AnimationNodeStateMachine_method_get_transition_count>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_transition_from<class_AnimationNodeStateMachine_method_get_transition_from>` **(** :ref:`int<class_int>` idx **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_transition_to<class_AnimationNodeStateMachine_method_get_transition_to>` **(** :ref:`int<class_int>` idx **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_node<class_AnimationNodeStateMachine_method_has_node>` **(** :ref:`String<class_String>` name **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_transition<class_AnimationNodeStateMachine_method_has_transition>` **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_node<class_AnimationNodeStateMachine_method_remove_node>` **(** :ref:`String<class_String>` name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_transition<class_AnimationNodeStateMachine_method_remove_transition>` **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_transition_by_index<class_AnimationNodeStateMachine_method_remove_transition_by_index>` **(** :ref:`int<class_int>` idx **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_node<class_AnimationNodeStateMachine_method_rename_node>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`replace_node<class_AnimationNodeStateMachine_method_replace_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_end_node<class_AnimationNodeStateMachine_method_set_end_node>` **(** :ref:`String<class_String>` name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_graph_offset<class_AnimationNodeStateMachine_method_set_graph_offset>` **(** :ref:`Vector2<class_Vector2>` offset **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_node_position<class_AnimationNodeStateMachine_method_set_node_position>` **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_start_node<class_AnimationNodeStateMachine_method_set_start_node>` **(** :ref:`String<class_String>` name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_node<class_AnimationNodeStateMachine_method_add_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_transition<class_AnimationNodeStateMachine_method_add_transition>` **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to, :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` transition **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_end_node<class_AnimationNodeStateMachine_method_get_end_node>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_graph_offset<class_AnimationNodeStateMachine_method_get_graph_offset>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`get_node<class_AnimationNodeStateMachine_method_get_node>` **(** :ref:`String<class_String>` name **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_node_name<class_AnimationNodeStateMachine_method_get_node_name>` **(** :ref:`AnimationNode<class_AnimationNode>` node **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_AnimationNodeStateMachine_method_get_node_position>` **(** :ref:`String<class_String>` name **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_start_node<class_AnimationNodeStateMachine_method_get_start_node>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` | :ref:`get_transition<class_AnimationNodeStateMachine_method_get_transition>` **(** :ref:`int<class_int>` idx **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_transition_count<class_AnimationNodeStateMachine_method_get_transition_count>` **(** **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_transition_from<class_AnimationNodeStateMachine_method_get_transition_from>` **(** :ref:`int<class_int>` idx **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_transition_to<class_AnimationNodeStateMachine_method_get_transition_to>` **(** :ref:`int<class_int>` idx **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_node<class_AnimationNodeStateMachine_method_has_node>` **(** :ref:`String<class_String>` name **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_transition<class_AnimationNodeStateMachine_method_has_transition>` **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)** |const| |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_node<class_AnimationNodeStateMachine_method_remove_node>` **(** :ref:`String<class_String>` name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_transition<class_AnimationNodeStateMachine_method_remove_transition>` **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_transition_by_index<class_AnimationNodeStateMachine_method_remove_transition_by_index>` **(** :ref:`int<class_int>` idx **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_node<class_AnimationNodeStateMachine_method_rename_node>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`replace_node<class_AnimationNodeStateMachine_method_replace_node>` **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_end_node<class_AnimationNodeStateMachine_method_set_end_node>` **(** :ref:`String<class_String>` name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_graph_offset<class_AnimationNodeStateMachine_method_set_graph_offset>` **(** :ref:`Vector2<class_Vector2>` offset **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_node_position<class_AnimationNodeStateMachine_method_set_node_position>` **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_start_node<class_AnimationNodeStateMachine_method_set_start_node>` **(** :ref:`String<class_String>` name **)** |
+---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimationNodeStateMachine_method_add_node:
- void **add_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)**
.. rst-class:: classref-method
void **add_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2( 0, 0 ) **)**
Adds a new node to the graph. The ``position`` is used for display in the editor.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_add_transition:
- void **add_transition** **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to, :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` transition **)**
.. rst-class:: classref-method
void **add_transition** **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to, :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` transition **)**
Adds a transition between the given nodes.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_get_end_node:
- :ref:`String<class_String>` **get_end_node** **(** **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_end_node** **(** **)** |const|
Returns the graph's end node.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_get_graph_offset:
- :ref:`Vector2<class_Vector2>` **get_graph_offset** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_graph_offset** **(** **)** |const|
Returns the draw offset of the graph. Used for display in the editor.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_get_node:
- :ref:`AnimationNode<class_AnimationNode>` **get_node** **(** :ref:`String<class_String>` name **)** |const|
.. rst-class:: classref-method
:ref:`AnimationNode<class_AnimationNode>` **get_node** **(** :ref:`String<class_String>` name **)** |const|
Returns the animation node with the given name.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_get_node_name:
- :ref:`String<class_String>` **get_node_name** **(** :ref:`AnimationNode<class_AnimationNode>` node **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_node_name** **(** :ref:`AnimationNode<class_AnimationNode>` node **)** |const|
Returns the given animation node's name.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_get_node_position:
- :ref:`Vector2<class_Vector2>` **get_node_position** **(** :ref:`String<class_String>` name **)** |const|
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_node_position** **(** :ref:`String<class_String>` name **)** |const|
Returns the given node's coordinates. Used for display in the editor.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_get_start_node:
- :ref:`String<class_String>` **get_start_node** **(** **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_start_node** **(** **)** |const|
Returns the graph's end node.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_get_transition:
- :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` **get_transition** **(** :ref:`int<class_int>` idx **)** |const|
.. rst-class:: classref-method
:ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` **get_transition** **(** :ref:`int<class_int>` idx **)** |const|
Returns the given transition.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_get_transition_count:
- :ref:`int<class_int>` **get_transition_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_transition_count** **(** **)** |const|
Returns the number of connections in the graph.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_get_transition_from:
- :ref:`String<class_String>` **get_transition_from** **(** :ref:`int<class_int>` idx **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_transition_from** **(** :ref:`int<class_int>` idx **)** |const|
Returns the given transition's start node.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_get_transition_to:
- :ref:`String<class_String>` **get_transition_to** **(** :ref:`int<class_int>` idx **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_transition_to** **(** :ref:`int<class_int>` idx **)** |const|
Returns the given transition's end node.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_has_node:
- :ref:`bool<class_bool>` **has_node** **(** :ref:`String<class_String>` name **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_node** **(** :ref:`String<class_String>` name **)** |const|
Returns ``true`` if the graph contains the given node.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_has_transition:
- :ref:`bool<class_bool>` **has_transition** **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_transition** **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)** |const|
Returns ``true`` if there is a transition between the given nodes.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_remove_node:
- void **remove_node** **(** :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
void **remove_node** **(** :ref:`String<class_String>` name **)**
Deletes the given node from the graph.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_remove_transition:
- void **remove_transition** **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)**
.. rst-class:: classref-method
void **remove_transition** **(** :ref:`String<class_String>` from, :ref:`String<class_String>` to **)**
Deletes the transition between the two specified nodes.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_remove_transition_by_index:
- void **remove_transition_by_index** **(** :ref:`int<class_int>` idx **)**
.. rst-class:: classref-method
void **remove_transition_by_index** **(** :ref:`int<class_int>` idx **)**
Deletes the given transition by index.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_rename_node:
- void **rename_node** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)**
.. rst-class:: classref-method
void **rename_node** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` new_name **)**
Renames the given node.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_replace_node:
- void **replace_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node **)**
.. rst-class:: classref-method
void **replace_node** **(** :ref:`String<class_String>` name, :ref:`AnimationNode<class_AnimationNode>` node **)**
Replaces the node and keeps its transitions unchanged.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_set_end_node:
- void **set_end_node** **(** :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
void **set_end_node** **(** :ref:`String<class_String>` name **)**
Sets the given node as the graph end point.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_set_graph_offset:
- void **set_graph_offset** **(** :ref:`Vector2<class_Vector2>` offset **)**
.. rst-class:: classref-method
void **set_graph_offset** **(** :ref:`Vector2<class_Vector2>` offset **)**
Sets the draw offset of the graph. Used for display in the editor.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_set_node_position:
- void **set_node_position** **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)**
.. rst-class:: classref-method
void **set_node_position** **(** :ref:`String<class_String>` name, :ref:`Vector2<class_Vector2>` position **)**
Sets the node's coordinates. Used for display in the editor.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachine_method_set_start_node:
- void **set_start_node** **(** :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
void **set_start_node** **(** :ref:`String<class_String>` name **)**
Sets the given node as the graph start point.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AnimationNodeStateMachinePlayback
Playback control for :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -26,102 +28,155 @@ Allows control of :ref:`AnimationTree<class_AnimationTree>` state machines creat
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------+-------------------------+---------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | resource_local_to_scene | ``true`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
+-------------------------+-------------------------+---------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------+-------------------------+---------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | resource_local_to_scene | ``true`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
+-------------------------+-------------------------+---------------------------------------------------------------------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_current_length<class_AnimationNodeStateMachinePlayback_method_get_current_length>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_current_node<class_AnimationNodeStateMachinePlayback_method_get_current_node>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_current_play_position<class_AnimationNodeStateMachinePlayback_method_get_current_play_position>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_travel_path<class_AnimationNodeStateMachinePlayback_method_get_travel_path>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationNodeStateMachinePlayback_method_is_playing>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`start<class_AnimationNodeStateMachinePlayback_method_start>` **(** :ref:`String<class_String>` node **)** |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimationNodeStateMachinePlayback_method_stop>` **(** **)** |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`travel<class_AnimationNodeStateMachinePlayback_method_travel>` **(** :ref:`String<class_String>` to_node **)** |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_current_length<class_AnimationNodeStateMachinePlayback_method_get_current_length>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_current_node<class_AnimationNodeStateMachinePlayback_method_get_current_node>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_current_play_position<class_AnimationNodeStateMachinePlayback_method_get_current_play_position>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_travel_path<class_AnimationNodeStateMachinePlayback_method_get_travel_path>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationNodeStateMachinePlayback_method_is_playing>` **(** **)** |const| |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`start<class_AnimationNodeStateMachinePlayback_method_start>` **(** :ref:`String<class_String>` node **)** |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimationNodeStateMachinePlayback_method_stop>` **(** **)** |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`travel<class_AnimationNodeStateMachinePlayback_method_travel>` **(** :ref:`String<class_String>` to_node **)** |
+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimationNodeStateMachinePlayback_method_get_current_length:
- :ref:`float<class_float>` **get_current_length** **(** **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_current_length** **(** **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachinePlayback_method_get_current_node:
- :ref:`String<class_String>` **get_current_node** **(** **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_current_node** **(** **)** |const|
Returns the currently playing animation state.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachinePlayback_method_get_current_play_position:
- :ref:`float<class_float>` **get_current_play_position** **(** **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_current_play_position** **(** **)** |const|
Returns the playback position within the current animation state.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachinePlayback_method_get_travel_path:
- :ref:`PoolStringArray<class_PoolStringArray>` **get_travel_path** **(** **)** |const|
.. rst-class:: classref-method
:ref:`PoolStringArray<class_PoolStringArray>` **get_travel_path** **(** **)** |const|
Returns the current travel path as computed internally by the A\* algorithm.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachinePlayback_method_is_playing:
- :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_playing** **(** **)** |const|
Returns ``true`` if an animation is playing.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachinePlayback_method_start:
- void **start** **(** :ref:`String<class_String>` node **)**
.. rst-class:: classref-method
void **start** **(** :ref:`String<class_String>` node **)**
Starts playing the given animation.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachinePlayback_method_stop:
- void **stop** **(** **)**
.. rst-class:: classref-method
void **stop** **(** **)**
Stops the currently playing animation.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachinePlayback_method_travel:
- void **travel** **(** :ref:`String<class_String>` to_node **)**
.. rst-class:: classref-method
void **travel** **(** :ref:`String<class_String>` to_node **)**
Transitions from the current state to another one, following the shortest path.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -12,72 +12,114 @@ AnimationNodeStateMachineTransition
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
.. container:: contribute
There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/animation/animation_tree`
.. rst-class:: classref-reftable-group
Properties
----------
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`String<class_String>` | :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` | ``""`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>` | ``false`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`disabled<class_AnimationNodeStateMachineTransition_property_disabled>` | ``false`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`int<class_int>` | :ref:`priority<class_AnimationNodeStateMachineTransition_property_priority>` | ``1`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` | :ref:`switch_mode<class_AnimationNodeStateMachineTransition_property_switch_mode>` | ``0`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeStateMachineTransition_property_xfade_time>` | ``0.0`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
.. table::
:widths: auto
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`String<class_String>` | :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` | ``""`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>` | ``false`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`disabled<class_AnimationNodeStateMachineTransition_property_disabled>` | ``false`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`int<class_int>` | :ref:`priority<class_AnimationNodeStateMachineTransition_property_priority>` | ``1`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` | :ref:`switch_mode<class_AnimationNodeStateMachineTransition_property_switch_mode>` | ``0`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeStateMachineTransition_property_xfade_time>` | ``0.0`` |
+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_AnimationNodeStateMachineTransition_signal_advance_condition_changed:
- **advance_condition_changed** **(** **)**
.. rst-class:: classref-signal
**advance_condition_changed** **(** **)**
Emitted when :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` is changed.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AnimationNodeStateMachineTransition_SwitchMode:
.. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_IMMEDIATE:
.. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_SYNC:
.. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_AT_END:
.. rst-class:: classref-enumeration
enum **SwitchMode**:
- **SWITCH_MODE_IMMEDIATE** = **0** --- Switch to the next state immediately. The current state will end and blend into the beginning of the new one.
.. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_IMMEDIATE:
- **SWITCH_MODE_SYNC** = **1** --- Switch to the next state immediately, but will seek the new state to the playback position of the old state.
.. rst-class:: classref-enumeration-constant
- **SWITCH_MODE_AT_END** = **2** --- Wait for the current state playback to end, then switch to the beginning of the next state animation.
:ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **SWITCH_MODE_IMMEDIATE** = ``0``
Switch to the next state immediately. The current state will end and blend into the beginning of the new one.
.. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_SYNC:
.. rst-class:: classref-enumeration-constant
:ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **SWITCH_MODE_SYNC** = ``1``
Switch to the next state immediately, but will seek the new state to the playback position of the old state.
.. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_AT_END:
.. rst-class:: classref-enumeration-constant
:ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **SWITCH_MODE_AT_END** = ``2``
Wait for the current state playback to end, then switch to the beginning of the next state animation.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNodeStateMachineTransition_property_advance_condition:
- :ref:`String<class_String>` **advance_condition**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``""`` |
+-----------+------------------------------+
| *Setter* | set_advance_condition(value) |
+-----------+------------------------------+
| *Getter* | get_advance_condition() |
+-----------+------------------------------+
:ref:`String<class_String>` **advance_condition** = ``""``
.. rst-class:: classref-property-setget
- void **set_advance_condition** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_advance_condition** **(** **)**
Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the :ref:`AnimationTree<class_AnimationTree>` that can be controlled from code (see `Using AnimationTree <../tutorials/animation/animation_tree.html#controlling-from-code>`__). For example, if :ref:`AnimationTree.tree_root<class_AnimationTree_property_tree_root>` is an :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>` and :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` is set to ``"idle"``:
@@ -85,86 +127,92 @@ Turn on auto advance when this condition is set. The provided name will become a
$animation_tree["parameters/conditions/idle"] = is_on_floor and (linear_velocity.x == 0)
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachineTransition_property_auto_advance:
- :ref:`bool<class_bool>` **auto_advance**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``false`` |
+-----------+-------------------------+
| *Setter* | set_auto_advance(value) |
+-----------+-------------------------+
| *Getter* | has_auto_advance() |
+-----------+-------------------------+
:ref:`bool<class_bool>` **auto_advance** = ``false``
.. rst-class:: classref-property-setget
- void **set_auto_advance** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **has_auto_advance** **(** **)**
Turn on the transition automatically when this state is reached. This works best with :ref:`SWITCH_MODE_AT_END<class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_AT_END>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachineTransition_property_disabled:
- :ref:`bool<class_bool>` **disabled**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_disabled(value) |
+-----------+---------------------+
| *Getter* | is_disabled() |
+-----------+---------------------+
:ref:`bool<class_bool>` **disabled** = ``false``
.. rst-class:: classref-property-setget
- void **set_disabled** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_disabled** **(** **)**
Don't use this transition during :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>` or :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachineTransition_property_priority:
- :ref:`int<class_int>` **priority**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``1`` |
+-----------+---------------------+
| *Setter* | set_priority(value) |
+-----------+---------------------+
| *Getter* | get_priority() |
+-----------+---------------------+
:ref:`int<class_int>` **priority** = ``1``
.. rst-class:: classref-property-setget
- void **set_priority** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_priority** **(** **)**
Lower priority transitions are preferred when travelling through the tree via :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>` or :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachineTransition_property_switch_mode:
- :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **switch_mode**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``0`` |
+-----------+------------------------+
| *Setter* | set_switch_mode(value) |
+-----------+------------------------+
| *Getter* | get_switch_mode() |
+-----------+------------------------+
:ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **switch_mode** = ``0``
.. rst-class:: classref-property-setget
- void **set_switch_mode** **(** :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` value **)**
- :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **get_switch_mode** **(** **)**
The transition type.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeStateMachineTransition_property_xfade_time:
- :ref:`float<class_float>` **xfade_time**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``0.0`` |
+-----------+-----------------------+
| *Setter* | set_xfade_time(value) |
+-----------+-----------------------+
| *Getter* | get_xfade_time() |
+-----------+-----------------------+
:ref:`float<class_float>` **xfade_time** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_xfade_time** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_xfade_time** **(** **)**
The time to cross-fade between this state and the next.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,11 +14,15 @@ AnimationNodeTimeScale
A time-scaling animation node to be used with :ref:`AnimationTree<class_AnimationTree>`.
.. rst-class:: classref-introduction-group
Description
-----------
Allows scaling the speed of the animation (or reversing it) in any children nodes. Setting it to 0 will pause the animation.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -29,3 +33,4 @@ Tutorials
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AnimationNodeTimeSeek
A time-seeking animation node to be used with :ref:`AnimationTree<class_AnimationTree>`.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -31,6 +33,8 @@ This node can be used to cause a seek command to happen to any sub-children of t
# Alternative syntax (same result as above).
animation_tree["parameters/Seek/seek_position"] = 12.0
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -39,3 +43,4 @@ Tutorials
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,11 +14,15 @@ AnimationNodeTransition
A generic animation transition node for :ref:`AnimationTree<class_AnimationTree>`.
.. rst-class:: classref-introduction-group
Description
-----------
Simple state machine for cases which don't require a more advanced :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`. Animations can be connected to the inputs and transition times can be specified.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -28,86 +32,139 @@ Tutorials
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+------------------------------------------------------------------------+---------+
| :ref:`int<class_int>` | :ref:`input_count<class_AnimationNodeTransition_property_input_count>` | ``0`` |
+---------------------------+------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeTransition_property_xfade_time>` | ``0.0`` |
+---------------------------+------------------------------------------------------------------------+---------+
.. table::
:widths: auto
+---------------------------+------------------------------------------------------------------------+---------+
| :ref:`int<class_int>` | :ref:`input_count<class_AnimationNodeTransition_property_input_count>` | ``0`` |
+---------------------------+------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeTransition_property_xfade_time>` | ``0.0`` |
+---------------------------+------------------------------------------------------------------------+---------+
.. rst-class:: classref-reftable-group
Methods
-------
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_input_caption<class_AnimationNodeTransition_method_get_input_caption>` **(** :ref:`int<class_int>` input **)** |const| |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_input_set_as_auto_advance<class_AnimationNodeTransition_method_is_input_set_as_auto_advance>` **(** :ref:`int<class_int>` input **)** |const| |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_input_as_auto_advance<class_AnimationNodeTransition_method_set_input_as_auto_advance>` **(** :ref:`int<class_int>` input, :ref:`bool<class_bool>` enable **)** |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_input_caption<class_AnimationNodeTransition_method_set_input_caption>` **(** :ref:`int<class_int>` input, :ref:`String<class_String>` caption **)** |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_input_caption<class_AnimationNodeTransition_method_get_input_caption>` **(** :ref:`int<class_int>` input **)** |const| |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_input_set_as_auto_advance<class_AnimationNodeTransition_method_is_input_set_as_auto_advance>` **(** :ref:`int<class_int>` input **)** |const| |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_input_as_auto_advance<class_AnimationNodeTransition_method_set_input_as_auto_advance>` **(** :ref:`int<class_int>` input, :ref:`bool<class_bool>` enable **)** |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_input_caption<class_AnimationNodeTransition_method_set_input_caption>` **(** :ref:`int<class_int>` input, :ref:`String<class_String>` caption **)** |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationNodeTransition_property_input_count:
- :ref:`int<class_int>` **input_count**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``0`` |
+-----------+---------------------------+
| *Setter* | set_enabled_inputs(value) |
+-----------+---------------------------+
| *Getter* | get_enabled_inputs() |
+-----------+---------------------------+
:ref:`int<class_int>` **input_count** = ``0``
.. rst-class:: classref-property-setget
- void **set_enabled_inputs** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_enabled_inputs** **(** **)**
The number of available input ports for this node.
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeTransition_property_xfade_time:
- :ref:`float<class_float>` **xfade_time**
.. rst-class:: classref-property
+-----------+----------------------------+
| *Default* | ``0.0`` |
+-----------+----------------------------+
| *Setter* | set_cross_fade_time(value) |
+-----------+----------------------------+
| *Getter* | get_cross_fade_time() |
+-----------+----------------------------+
:ref:`float<class_float>` **xfade_time** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_cross_fade_time** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_cross_fade_time** **(** **)**
Cross-fading time (in seconds) between each animation connected to the inputs.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimationNodeTransition_method_get_input_caption:
- :ref:`String<class_String>` **get_input_caption** **(** :ref:`int<class_int>` input **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_input_caption** **(** :ref:`int<class_int>` input **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeTransition_method_is_input_set_as_auto_advance:
- :ref:`bool<class_bool>` **is_input_set_as_auto_advance** **(** :ref:`int<class_int>` input **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_input_set_as_auto_advance** **(** :ref:`int<class_int>` input **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeTransition_method_set_input_as_auto_advance:
- void **set_input_as_auto_advance** **(** :ref:`int<class_int>` input, :ref:`bool<class_bool>` enable **)**
.. rst-class:: classref-method
void **set_input_as_auto_advance** **(** :ref:`int<class_int>` input, :ref:`bool<class_bool>` enable **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AnimationNodeTransition_method_set_input_caption:
- void **set_input_caption** **(** :ref:`int<class_int>` input, :ref:`String<class_String>` caption **)**
.. rst-class:: classref-method
void **set_input_caption** **(** :ref:`int<class_int>` input, :ref:`String<class_String>` caption **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,15 +14,19 @@ AnimationPlayer
Container and player of :ref:`Animation<class_Animation>` resources.
.. rst-class:: classref-introduction-group
Description
-----------
An animation player is used for general-purpose playback of :ref:`Animation<class_Animation>` resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in different channels.
\ ``AnimationPlayer`` is more suited than :ref:`Tween<class_Tween>` for animations where you know the final values in advance. For example, fading a screen in and out is more easily done with an ``AnimationPlayer`` node thanks to the animation tools provided by the editor. That particular example can also be implemented with a :ref:`Tween<class_Tween>` node, but it requires doing everything by code.
\ **AnimationPlayer** is more suited than :ref:`Tween<class_Tween>` for animations where you know the final values in advance. For example, fading a screen in and out is more easily done with an **AnimationPlayer** node thanks to the animation tools provided by the editor. That particular example can also be implemented with a :ref:`Tween<class_Tween>` node, but it requires doing everything by code.
Updating the target properties of animations occurs at process time.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -32,521 +36,701 @@ Tutorials
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. rst-class:: classref-reftable-group
Properties
----------
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`autoplay<class_AnimationPlayer_property_autoplay>` | ``""`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`current_animation<class_AnimationPlayer_property_current_animation>` | ``""`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`current_animation_length<class_AnimationPlayer_property_current_animation_length>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`current_animation_position<class_AnimationPlayer_property_current_animation_position>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` | :ref:`method_call_mode<class_AnimationPlayer_property_method_call_mode>` | ``0`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`playback_active<class_AnimationPlayer_property_playback_active>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`playback_default_blend_time<class_AnimationPlayer_property_playback_default_blend_time>` | ``0.0`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`AnimationProcessMode<enum_AnimationPlayer_AnimationProcessMode>` | :ref:`playback_process_mode<class_AnimationPlayer_property_playback_process_mode>` | ``1`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`playback_speed<class_AnimationPlayer_property_playback_speed>` | ``1.0`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`reset_on_save<class_AnimationPlayer_property_reset_on_save>` | ``true`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`root_node<class_AnimationPlayer_property_root_node>` | ``NodePath("..")`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
.. table::
:widths: auto
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`autoplay<class_AnimationPlayer_property_autoplay>` | ``""`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`String<class_String>` | :ref:`current_animation<class_AnimationPlayer_property_current_animation>` | ``""`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`current_animation_length<class_AnimationPlayer_property_current_animation_length>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`current_animation_position<class_AnimationPlayer_property_current_animation_position>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` | :ref:`method_call_mode<class_AnimationPlayer_property_method_call_mode>` | ``0`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`playback_active<class_AnimationPlayer_property_playback_active>` | |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`playback_default_blend_time<class_AnimationPlayer_property_playback_default_blend_time>` | ``0.0`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`AnimationProcessMode<enum_AnimationPlayer_AnimationProcessMode>` | :ref:`playback_process_mode<class_AnimationPlayer_property_playback_process_mode>` | ``1`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`float<class_float>` | :ref:`playback_speed<class_AnimationPlayer_property_playback_speed>` | ``1.0`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`reset_on_save<class_AnimationPlayer_property_reset_on_save>` | ``true`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`root_node<class_AnimationPlayer_property_root_node>` | ``NodePath("..")`` |
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`add_animation<class_AnimationPlayer_method_add_animation>` **(** :ref:`String<class_String>` name, :ref:`Animation<class_Animation>` animation **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`advance<class_AnimationPlayer_method_advance>` **(** :ref:`float<class_float>` delta **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`animation_get_next<class_AnimationPlayer_method_animation_get_next>` **(** :ref:`String<class_String>` anim_from **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`animation_set_next<class_AnimationPlayer_method_animation_set_next>` **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_caches<class_AnimationPlayer_method_clear_caches>` **(** **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_queue<class_AnimationPlayer_method_clear_queue>` **(** **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`find_animation<class_AnimationPlayer_method_find_animation>` **(** :ref:`Animation<class_Animation>` animation **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Animation<class_Animation>` | :ref:`get_animation<class_AnimationPlayer_method_get_animation>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_animation_list<class_AnimationPlayer_method_get_animation_list>` **(** **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_blend_time<class_AnimationPlayer_method_get_blend_time>` **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playing_speed<class_AnimationPlayer_method_get_playing_speed>` **(** **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_queue<class_AnimationPlayer_method_get_queue>` **(** **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_animation<class_AnimationPlayer_method_has_animation>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationPlayer_method_is_playing>` **(** **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimationPlayer_method_play>` **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1, :ref:`float<class_float>` custom_speed=1.0, :ref:`bool<class_bool>` from_end=false **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play_backwards<class_AnimationPlayer_method_play_backwards>` **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1 **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`queue<class_AnimationPlayer_method_queue>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_animation<class_AnimationPlayer_method_remove_animation>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_animation<class_AnimationPlayer_method_rename_animation>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` newname **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AnimationPlayer_method_seek>` **(** :ref:`float<class_float>` seconds, :ref:`bool<class_bool>` update=false **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_time<class_AnimationPlayer_method_set_blend_time>` **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to, :ref:`float<class_float>` sec **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimationPlayer_method_stop>` **(** :ref:`bool<class_bool>` reset=true **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`add_animation<class_AnimationPlayer_method_add_animation>` **(** :ref:`String<class_String>` name, :ref:`Animation<class_Animation>` animation **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`advance<class_AnimationPlayer_method_advance>` **(** :ref:`float<class_float>` delta **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`animation_get_next<class_AnimationPlayer_method_animation_get_next>` **(** :ref:`String<class_String>` anim_from **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`animation_set_next<class_AnimationPlayer_method_animation_set_next>` **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_caches<class_AnimationPlayer_method_clear_caches>` **(** **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_queue<class_AnimationPlayer_method_clear_queue>` **(** **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`find_animation<class_AnimationPlayer_method_find_animation>` **(** :ref:`Animation<class_Animation>` animation **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Animation<class_Animation>` | :ref:`get_animation<class_AnimationPlayer_method_get_animation>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_animation_list<class_AnimationPlayer_method_get_animation_list>` **(** **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_blend_time<class_AnimationPlayer_method_get_blend_time>` **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playing_speed<class_AnimationPlayer_method_get_playing_speed>` **(** **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_queue<class_AnimationPlayer_method_get_queue>` **(** **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_animation<class_AnimationPlayer_method_has_animation>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_playing<class_AnimationPlayer_method_is_playing>` **(** **)** |const| |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AnimationPlayer_method_play>` **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1, :ref:`float<class_float>` custom_speed=1.0, :ref:`bool<class_bool>` from_end=false **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`play_backwards<class_AnimationPlayer_method_play_backwards>` **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1 **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`queue<class_AnimationPlayer_method_queue>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_animation<class_AnimationPlayer_method_remove_animation>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_animation<class_AnimationPlayer_method_rename_animation>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` newname **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AnimationPlayer_method_seek>` **(** :ref:`float<class_float>` seconds, :ref:`bool<class_bool>` update=false **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_time<class_AnimationPlayer_method_set_blend_time>` **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to, :ref:`float<class_float>` sec **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AnimationPlayer_method_stop>` **(** :ref:`bool<class_bool>` reset=true **)** |
+-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_AnimationPlayer_signal_animation_changed:
- **animation_changed** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)**
.. rst-class:: classref-signal
**animation_changed** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)**
Emitted when a queued animation plays after the previous animation was finished. See :ref:`queue<class_AnimationPlayer_method_queue>`.
\ **Note:** The signal is not emitted when the animation is changed via :ref:`play<class_AnimationPlayer_method_play>` or from :ref:`AnimationTree<class_AnimationTree>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_signal_animation_finished:
- **animation_finished** **(** :ref:`String<class_String>` anim_name **)**
.. rst-class:: classref-signal
**animation_finished** **(** :ref:`String<class_String>` anim_name **)**
Notifies when an animation finished playing.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_signal_animation_started:
- **animation_started** **(** :ref:`String<class_String>` anim_name **)**
.. rst-class:: classref-signal
**animation_started** **(** :ref:`String<class_String>` anim_name **)**
Notifies when an animation starts playing.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_signal_caches_cleared:
- **caches_cleared** **(** **)**
.. rst-class:: classref-signal
**caches_cleared** **(** **)**
Notifies when the caches have been cleared, either automatically, or manually via :ref:`clear_caches<class_AnimationPlayer_method_clear_caches>`.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AnimationPlayer_AnimationProcessMode:
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_PHYSICS:
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_IDLE:
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_MANUAL:
.. rst-class:: classref-enumeration
enum **AnimationProcessMode**:
- **ANIMATION_PROCESS_PHYSICS** = **0** --- Process animation during the physics process. This is especially useful when animating physics bodies.
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_PHYSICS:
- **ANIMATION_PROCESS_IDLE** = **1** --- Process animation during the idle process.
.. rst-class:: classref-enumeration-constant
- **ANIMATION_PROCESS_MANUAL** = **2** --- Do not process animation. Use :ref:`advance<class_AnimationPlayer_method_advance>` to process the animation manually.
:ref:`AnimationProcessMode<enum_AnimationPlayer_AnimationProcessMode>` **ANIMATION_PROCESS_PHYSICS** = ``0``
Process animation during the physics process. This is especially useful when animating physics bodies.
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_IDLE:
.. rst-class:: classref-enumeration-constant
:ref:`AnimationProcessMode<enum_AnimationPlayer_AnimationProcessMode>` **ANIMATION_PROCESS_IDLE** = ``1``
Process animation during the idle process.
.. _class_AnimationPlayer_constant_ANIMATION_PROCESS_MANUAL:
.. rst-class:: classref-enumeration-constant
:ref:`AnimationProcessMode<enum_AnimationPlayer_AnimationProcessMode>` **ANIMATION_PROCESS_MANUAL** = ``2``
Do not process animation. Use :ref:`advance<class_AnimationPlayer_method_advance>` to process the animation manually.
.. rst-class:: classref-item-separator
----
.. _enum_AnimationPlayer_AnimationMethodCallMode:
.. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_DEFERRED:
.. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_IMMEDIATE:
.. rst-class:: classref-enumeration
enum **AnimationMethodCallMode**:
- **ANIMATION_METHOD_CALL_DEFERRED** = **0** --- Batch method calls during the animation process, then do the calls after events are processed. This avoids bugs involving deleting nodes or modifying the AnimationPlayer while playing.
.. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_DEFERRED:
- **ANIMATION_METHOD_CALL_IMMEDIATE** = **1** --- Make method calls immediately when reached in the animation.
.. rst-class:: classref-enumeration-constant
:ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **ANIMATION_METHOD_CALL_DEFERRED** = ``0``
Batch method calls during the animation process, then do the calls after events are processed. This avoids bugs involving deleting nodes or modifying the AnimationPlayer while playing.
.. _class_AnimationPlayer_constant_ANIMATION_METHOD_CALL_IMMEDIATE:
.. rst-class:: classref-enumeration-constant
:ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **ANIMATION_METHOD_CALL_IMMEDIATE** = ``1``
Make method calls immediately when reached in the animation.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationPlayer_property_assigned_animation:
- :ref:`String<class_String>` **assigned_animation**
.. rst-class:: classref-property
+----------+-------------------------------+
| *Setter* | set_assigned_animation(value) |
+----------+-------------------------------+
| *Getter* | get_assigned_animation() |
+----------+-------------------------------+
:ref:`String<class_String>` **assigned_animation**
.. rst-class:: classref-property-setget
- void **set_assigned_animation** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_assigned_animation** **(** **)**
If playing, the current animation; otherwise, the animation last played. When set, would change the animation, but would not play it unless currently playing. See also :ref:`current_animation<class_AnimationPlayer_property_current_animation>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_autoplay:
- :ref:`String<class_String>` **autoplay**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``""`` |
+-----------+---------------------+
| *Setter* | set_autoplay(value) |
+-----------+---------------------+
| *Getter* | get_autoplay() |
+-----------+---------------------+
:ref:`String<class_String>` **autoplay** = ``""``
.. rst-class:: classref-property-setget
- void **set_autoplay** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_autoplay** **(** **)**
The name of the animation to play when the scene loads.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_current_animation:
- :ref:`String<class_String>` **current_animation**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``""`` |
+-----------+------------------------------+
| *Setter* | set_current_animation(value) |
+-----------+------------------------------+
| *Getter* | get_current_animation() |
+-----------+------------------------------+
:ref:`String<class_String>` **current_animation** = ``""``
.. rst-class:: classref-property-setget
- void **set_current_animation** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_current_animation** **(** **)**
The name of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See :ref:`play<class_AnimationPlayer_method_play>` for more information on playing animations.
\ **Note:** While this property appears in the inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see :ref:`Animation<class_Animation>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_current_animation_length:
- :ref:`float<class_float>` **current_animation_length**
.. rst-class:: classref-property
+----------+--------------------------------+
| *Getter* | get_current_animation_length() |
+----------+--------------------------------+
:ref:`float<class_float>` **current_animation_length**
.. rst-class:: classref-property-setget
- :ref:`float<class_float>` **get_current_animation_length** **(** **)**
The length (in seconds) of the currently being played animation.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_current_animation_position:
- :ref:`float<class_float>` **current_animation_position**
.. rst-class:: classref-property
+----------+----------------------------------+
| *Getter* | get_current_animation_position() |
+----------+----------------------------------+
:ref:`float<class_float>` **current_animation_position**
.. rst-class:: classref-property-setget
- :ref:`float<class_float>` **get_current_animation_position** **(** **)**
The position (in seconds) of the currently playing animation.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_method_call_mode:
- :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **method_call_mode**
.. rst-class:: classref-property
+-----------+-----------------------------+
| *Default* | ``0`` |
+-----------+-----------------------------+
| *Setter* | set_method_call_mode(value) |
+-----------+-----------------------------+
| *Getter* | get_method_call_mode() |
+-----------+-----------------------------+
:ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **method_call_mode** = ``0``
.. rst-class:: classref-property-setget
- void **set_method_call_mode** **(** :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` value **)**
- :ref:`AnimationMethodCallMode<enum_AnimationPlayer_AnimationMethodCallMode>` **get_method_call_mode** **(** **)**
The call mode to use for Call Method tracks.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_playback_active:
- :ref:`bool<class_bool>` **playback_active**
.. rst-class:: classref-property
+----------+-------------------+
| *Setter* | set_active(value) |
+----------+-------------------+
| *Getter* | is_active() |
+----------+-------------------+
:ref:`bool<class_bool>` **playback_active**
.. rst-class:: classref-property-setget
- void **set_active** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_active** **(** **)**
If ``true``, updates animations in response to process-related notifications.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_playback_default_blend_time:
- :ref:`float<class_float>` **playback_default_blend_time**
.. rst-class:: classref-property
+-----------+-------------------------------+
| *Default* | ``0.0`` |
+-----------+-------------------------------+
| *Setter* | set_default_blend_time(value) |
+-----------+-------------------------------+
| *Getter* | get_default_blend_time() |
+-----------+-------------------------------+
:ref:`float<class_float>` **playback_default_blend_time** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_default_blend_time** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_default_blend_time** **(** **)**
The default time in which to blend animations. Ranges from 0 to 4096 with 0.01 precision.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_playback_process_mode:
- :ref:`AnimationProcessMode<enum_AnimationPlayer_AnimationProcessMode>` **playback_process_mode**
.. rst-class:: classref-property
+-----------+-----------------------------------+
| *Default* | ``1`` |
+-----------+-----------------------------------+
| *Setter* | set_animation_process_mode(value) |
+-----------+-----------------------------------+
| *Getter* | get_animation_process_mode() |
+-----------+-----------------------------------+
:ref:`AnimationProcessMode<enum_AnimationPlayer_AnimationProcessMode>` **playback_process_mode** = ``1``
.. rst-class:: classref-property-setget
- void **set_animation_process_mode** **(** :ref:`AnimationProcessMode<enum_AnimationPlayer_AnimationProcessMode>` value **)**
- :ref:`AnimationProcessMode<enum_AnimationPlayer_AnimationProcessMode>` **get_animation_process_mode** **(** **)**
The process notification in which to update animations.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_playback_speed:
- :ref:`float<class_float>` **playback_speed**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_speed_scale(value) |
+-----------+------------------------+
| *Getter* | get_speed_scale() |
+-----------+------------------------+
:ref:`float<class_float>` **playback_speed** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_speed_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_speed_scale** **(** **)**
The speed scaling ratio. For instance, if this value is 1, then the animation plays at normal speed. If it's 0.5, then it plays at half speed. If it's 2, then it plays at double speed.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_reset_on_save:
- :ref:`bool<class_bool>` **reset_on_save**
.. rst-class:: classref-property
+-----------+----------------------------------+
| *Default* | ``true`` |
+-----------+----------------------------------+
| *Setter* | set_reset_on_save_enabled(value) |
+-----------+----------------------------------+
| *Getter* | is_reset_on_save_enabled() |
+-----------+----------------------------------+
:ref:`bool<class_bool>` **reset_on_save** = ``true``
.. rst-class:: classref-property-setget
- void **set_reset_on_save_enabled** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_reset_on_save_enabled** **(** **)**
This is used by the editor. If set to ``true``, the scene will be saved with the effects of the reset animation applied (as if it had been seeked to time 0), then reverted after saving.
In other words, the saved scene file will contain the "default pose", as defined by the reset animation, if any, with the editor keeping the values that the nodes had before saving.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_property_root_node:
- :ref:`NodePath<class_NodePath>` **root_node**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``NodePath("..")`` |
+-----------+--------------------+
| *Setter* | set_root(value) |
+-----------+--------------------+
| *Getter* | get_root() |
+-----------+--------------------+
:ref:`NodePath<class_NodePath>` **root_node** = ``NodePath("..")``
.. rst-class:: classref-property-setget
- void **set_root** **(** :ref:`NodePath<class_NodePath>` value **)**
- :ref:`NodePath<class_NodePath>` **get_root** **(** **)**
The node from which node path references will travel.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimationPlayer_method_add_animation:
- :ref:`Error<enum_@GlobalScope_Error>` **add_animation** **(** :ref:`String<class_String>` name, :ref:`Animation<class_Animation>` animation **)**
.. rst-class:: classref-method
:ref:`Error<enum_@GlobalScope_Error>` **add_animation** **(** :ref:`String<class_String>` name, :ref:`Animation<class_Animation>` animation **)**
Adds ``animation`` to the player accessible with the key ``name``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_advance:
- void **advance** **(** :ref:`float<class_float>` delta **)**
.. rst-class:: classref-method
void **advance** **(** :ref:`float<class_float>` delta **)**
Shifts position in the animation timeline and immediately updates the animation. ``delta`` is the time in seconds to shift. Events between the current frame and ``delta`` are handled.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_animation_get_next:
- :ref:`String<class_String>` **animation_get_next** **(** :ref:`String<class_String>` anim_from **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **animation_get_next** **(** :ref:`String<class_String>` anim_from **)** |const|
Returns the name of the next animation in the queue.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_animation_set_next:
- void **animation_set_next** **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)**
.. rst-class:: classref-method
void **animation_set_next** **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)**
Triggers the ``anim_to`` animation when the ``anim_from`` animation completes.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_clear_caches:
- void **clear_caches** **(** **)**
.. rst-class:: classref-method
``AnimationPlayer`` caches animated nodes. It may not notice if a node disappears; :ref:`clear_caches<class_AnimationPlayer_method_clear_caches>` forces it to update the cache again.
void **clear_caches** **(** **)**
**AnimationPlayer** caches animated nodes. It may not notice if a node disappears; :ref:`clear_caches<class_AnimationPlayer_method_clear_caches>` forces it to update the cache again.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_clear_queue:
- void **clear_queue** **(** **)**
.. rst-class:: classref-method
void **clear_queue** **(** **)**
Clears all queued, unplayed animations.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_find_animation:
- :ref:`String<class_String>` **find_animation** **(** :ref:`Animation<class_Animation>` animation **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **find_animation** **(** :ref:`Animation<class_Animation>` animation **)** |const|
Returns the name of ``animation`` or an empty string if not found.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_animation:
- :ref:`Animation<class_Animation>` **get_animation** **(** :ref:`String<class_String>` name **)** |const|
.. rst-class:: classref-method
:ref:`Animation<class_Animation>` **get_animation** **(** :ref:`String<class_String>` name **)** |const|
Returns the :ref:`Animation<class_Animation>` with the key ``name``. If the animation does not exist, ``null`` is returned and an error is logged.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_animation_list:
- :ref:`PoolStringArray<class_PoolStringArray>` **get_animation_list** **(** **)** |const|
.. rst-class:: classref-method
:ref:`PoolStringArray<class_PoolStringArray>` **get_animation_list** **(** **)** |const|
Returns the list of stored animation names.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_blend_time:
- :ref:`float<class_float>` **get_blend_time** **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_blend_time** **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to **)** |const|
Gets the blend time (in seconds) between two animations, referenced by their names.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_playing_speed:
- :ref:`float<class_float>` **get_playing_speed** **(** **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_playing_speed** **(** **)** |const|
Gets the actual playing speed of current animation or 0 if not playing. This speed is the :ref:`playback_speed<class_AnimationPlayer_property_playback_speed>` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play<class_AnimationPlayer_method_play>` method.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_get_queue:
- :ref:`PoolStringArray<class_PoolStringArray>` **get_queue** **(** **)**
.. rst-class:: classref-method
:ref:`PoolStringArray<class_PoolStringArray>` **get_queue** **(** **)**
Returns a list of the animation names that are currently queued to play.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_has_animation:
- :ref:`bool<class_bool>` **has_animation** **(** :ref:`String<class_String>` name **)** |const|
.. rst-class:: classref-method
Returns ``true`` if the ``AnimationPlayer`` stores an :ref:`Animation<class_Animation>` with key ``name``.
:ref:`bool<class_bool>` **has_animation** **(** :ref:`String<class_String>` name **)** |const|
Returns ``true`` if the **AnimationPlayer** stores an :ref:`Animation<class_Animation>` with key ``name``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_is_playing:
- :ref:`bool<class_bool>` **is_playing** **(** **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_playing** **(** **)** |const|
Returns ``true`` if playing an animation.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_play:
- void **play** **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1, :ref:`float<class_float>` custom_speed=1.0, :ref:`bool<class_bool>` from_end=false **)**
.. rst-class:: classref-method
void **play** **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1, :ref:`float<class_float>` custom_speed=1.0, :ref:`bool<class_bool>` from_end=false **)**
Plays the animation with key ``name``. Custom blend times and speed can be set. If ``custom_speed`` is negative and ``from_end`` is ``true``, the animation will play backwards (which is equivalent to calling :ref:`play_backwards<class_AnimationPlayer_method_play_backwards>`).
The ``AnimationPlayer`` keeps track of its current or last played animation with :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>`. If this method is called with that same animation ``name``, or with no ``name`` parameter, the assigned animation will resume playing if it was paused, or restart if it was stopped (see :ref:`stop<class_AnimationPlayer_method_stop>` for both pause and stop). If the animation was already playing, it will keep playing.
The **AnimationPlayer** keeps track of its current or last played animation with :ref:`assigned_animation<class_AnimationPlayer_property_assigned_animation>`. If this method is called with that same animation ``name``, or with no ``name`` parameter, the assigned animation will resume playing if it was paused, or restart if it was stopped (see :ref:`stop<class_AnimationPlayer_method_stop>` for both pause and stop). If the animation was already playing, it will keep playing.
\ **Note:** The animation will be updated the next time the ``AnimationPlayer`` is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call ``advance(0)``.
\ **Note:** The animation will be updated the next time the **AnimationPlayer** is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call ``advance(0)``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_play_backwards:
- void **play_backwards** **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1 **)**
.. rst-class:: classref-method
void **play_backwards** **(** :ref:`String<class_String>` name="", :ref:`float<class_float>` custom_blend=-1 **)**
Plays the animation with key ``name`` in reverse.
This method is a shorthand for :ref:`play<class_AnimationPlayer_method_play>` with ``custom_speed = -1.0`` and ``from_end = true``, so see its description for more information.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_queue:
- void **queue** **(** :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
void **queue** **(** :ref:`String<class_String>` name **)**
Queues an animation for playback once the current one is done.
\ **Note:** If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_remove_animation:
- void **remove_animation** **(** :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
void **remove_animation** **(** :ref:`String<class_String>` name **)**
Removes the animation with key ``name``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_rename_animation:
- void **rename_animation** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` newname **)**
.. rst-class:: classref-method
void **rename_animation** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` newname **)**
Renames an existing animation with key ``name`` to ``newname``.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_seek:
- void **seek** **(** :ref:`float<class_float>` seconds, :ref:`bool<class_bool>` update=false **)**
.. rst-class:: classref-method
void **seek** **(** :ref:`float<class_float>` seconds, :ref:`bool<class_bool>` update=false **)**
Seeks the animation to the ``seconds`` point in time (in seconds). If ``update`` is ``true``, the animation updates too, otherwise it updates at process time. Events between the current frame and ``seconds`` are skipped.
\ **Note:** Seeking to the end of the animation doesn't emit :ref:`animation_finished<class_AnimationPlayer_signal_animation_finished>`. If you want to skip animation and emit the signal, use :ref:`advance<class_AnimationPlayer_method_advance>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_set_blend_time:
- void **set_blend_time** **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to, :ref:`float<class_float>` sec **)**
.. rst-class:: classref-method
void **set_blend_time** **(** :ref:`String<class_String>` anim_from, :ref:`String<class_String>` anim_to, :ref:`float<class_float>` sec **)**
Specifies a blend time (in seconds) between two animations, referenced by their names.
.. rst-class:: classref-item-separator
----
.. _class_AnimationPlayer_method_stop:
- void **stop** **(** :ref:`bool<class_bool>` reset=true **)**
.. rst-class:: classref-method
void **stop** **(** :ref:`bool<class_bool>` reset=true **)**
Stops or pauses the currently playing animation. If ``reset`` is ``true``, the animation position is reset to ``0`` and the playback speed is reset to ``1.0``.
@@ -555,3 +739,4 @@ If ``reset`` is ``false``, the :ref:`current_animation_position<class_AnimationP
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,8 +14,11 @@ AnimationRootNode
**Inherited By:** :ref:`AnimationNodeAnimation<class_AnimationNodeAnimation>`, :ref:`AnimationNodeBlendSpace1D<class_AnimationNodeBlendSpace1D>`, :ref:`AnimationNodeBlendSpace2D<class_AnimationNodeBlendSpace2D>`, :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`, :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`
.. container:: contribute
There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -12,8 +12,11 @@ AnimationTrackEditPlugin
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
.. container:: contribute
There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,12 +14,16 @@ AnimationTree
A node to be used for advanced animation transitions in an :ref:`AnimationPlayer<class_AnimationPlayer>`.
.. rst-class:: classref-introduction-group
Description
-----------
A node to be used for advanced animation transitions in an :ref:`AnimationPlayer<class_AnimationPlayer>`.
\ **Note:** When linked with an :ref:`AnimationPlayer<class_AnimationPlayer>`, several properties and methods of the corresponding :ref:`AnimationPlayer<class_AnimationPlayer>` will not function as expected. Playback and transitions should be handled using only the ``AnimationTree`` and its constituent :ref:`AnimationNode<class_AnimationNode>`\ (s). The :ref:`AnimationPlayer<class_AnimationPlayer>` node should be used solely for adding, deleting, and editing animations.
\ **Note:** When linked with an :ref:`AnimationPlayer<class_AnimationPlayer>`, several properties and methods of the corresponding :ref:`AnimationPlayer<class_AnimationPlayer>` will not function as expected. Playback and transitions should be handled using only the **AnimationTree** and its constituent :ref:`AnimationNode<class_AnimationNode>`\ (s). The :ref:`AnimationPlayer<class_AnimationPlayer>` node should be used solely for adding, deleting, and editing animations.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -28,155 +32,217 @@ Tutorials
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. rst-class:: classref-reftable-group
Properties
----------
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`bool<class_bool>` | :ref:`active<class_AnimationTree_property_active>` | ``false`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`anim_player<class_AnimationTree_property_anim_player>` | ``NodePath("")`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` | :ref:`process_mode<class_AnimationTree_property_process_mode>` | ``1`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` | ``NodePath("")`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`tree_root<class_AnimationTree_property_tree_root>` | |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
.. table::
:widths: auto
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`bool<class_bool>` | :ref:`active<class_AnimationTree_property_active>` | ``false`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`anim_player<class_AnimationTree_property_anim_player>` | ``NodePath("")`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` | :ref:`process_mode<class_AnimationTree_property_process_mode>` | ``1`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` | ``NodePath("")`` |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`tree_root<class_AnimationTree_property_tree_root>` | |
+----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`advance<class_AnimationTree_method_advance>` **(** :ref:`float<class_float>` delta **)** |
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_root_motion_transform<class_AnimationTree_method_get_root_motion_transform>` **(** **)** |const| |
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_parameter<class_AnimationTree_method_rename_parameter>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)** |
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`advance<class_AnimationTree_method_advance>` **(** :ref:`float<class_float>` delta **)** |
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_root_motion_transform<class_AnimationTree_method_get_root_motion_transform>` **(** **)** |const| |
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`rename_parameter<class_AnimationTree_method_rename_parameter>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)** |
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AnimationTree_AnimationProcessMode:
.. _class_AnimationTree_constant_ANIMATION_PROCESS_PHYSICS:
.. _class_AnimationTree_constant_ANIMATION_PROCESS_IDLE:
.. _class_AnimationTree_constant_ANIMATION_PROCESS_MANUAL:
.. rst-class:: classref-enumeration
enum **AnimationProcessMode**:
- **ANIMATION_PROCESS_PHYSICS** = **0** --- The animations will progress during the physics frame (i.e. :ref:`Node._physics_process<class_Node_method__physics_process>`).
.. _class_AnimationTree_constant_ANIMATION_PROCESS_PHYSICS:
- **ANIMATION_PROCESS_IDLE** = **1** --- The animations will progress during the idle frame (i.e. :ref:`Node._process<class_Node_method__process>`).
.. rst-class:: classref-enumeration-constant
- **ANIMATION_PROCESS_MANUAL** = **2** --- The animations will only progress manually (see :ref:`advance<class_AnimationTree_method_advance>`).
:ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **ANIMATION_PROCESS_PHYSICS** = ``0``
The animations will progress during the physics frame (i.e. :ref:`Node._physics_process<class_Node_method__physics_process>`).
.. _class_AnimationTree_constant_ANIMATION_PROCESS_IDLE:
.. rst-class:: classref-enumeration-constant
:ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **ANIMATION_PROCESS_IDLE** = ``1``
The animations will progress during the idle frame (i.e. :ref:`Node._process<class_Node_method__process>`).
.. _class_AnimationTree_constant_ANIMATION_PROCESS_MANUAL:
.. rst-class:: classref-enumeration-constant
:ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **ANIMATION_PROCESS_MANUAL** = ``2``
The animations will only progress manually (see :ref:`advance<class_AnimationTree_method_advance>`).
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AnimationTree_property_active:
- :ref:`bool<class_bool>` **active**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``false`` |
+-----------+-------------------+
| *Setter* | set_active(value) |
+-----------+-------------------+
| *Getter* | is_active() |
+-----------+-------------------+
:ref:`bool<class_bool>` **active** = ``false``
If ``true``, the ``AnimationTree`` will be processing.
.. rst-class:: classref-property-setget
- void **set_active** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_active** **(** **)**
If ``true``, the **AnimationTree** will be processing.
.. rst-class:: classref-item-separator
----
.. _class_AnimationTree_property_anim_player:
- :ref:`NodePath<class_NodePath>` **anim_player**
.. rst-class:: classref-property
+-----------+-----------------------------+
| *Default* | ``NodePath("")`` |
+-----------+-----------------------------+
| *Setter* | set_animation_player(value) |
+-----------+-----------------------------+
| *Getter* | get_animation_player() |
+-----------+-----------------------------+
:ref:`NodePath<class_NodePath>` **anim_player** = ``NodePath("")``
.. rst-class:: classref-property-setget
- void **set_animation_player** **(** :ref:`NodePath<class_NodePath>` value **)**
- :ref:`NodePath<class_NodePath>` **get_animation_player** **(** **)**
The path to the :ref:`AnimationPlayer<class_AnimationPlayer>` used for animating.
.. rst-class:: classref-item-separator
----
.. _class_AnimationTree_property_process_mode:
- :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **process_mode**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``1`` |
+-----------+-------------------------+
| *Setter* | set_process_mode(value) |
+-----------+-------------------------+
| *Getter* | get_process_mode() |
+-----------+-------------------------+
:ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **process_mode** = ``1``
The process mode of this ``AnimationTree``. See :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` for available modes.
.. rst-class:: classref-property-setget
- void **set_process_mode** **(** :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` value **)**
- :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` **get_process_mode** **(** **)**
The process mode of this **AnimationTree**. See :ref:`AnimationProcessMode<enum_AnimationTree_AnimationProcessMode>` for available modes.
.. rst-class:: classref-item-separator
----
.. _class_AnimationTree_property_root_motion_track:
- :ref:`NodePath<class_NodePath>` **root_motion_track**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``NodePath("")`` |
+-----------+------------------------------+
| *Setter* | set_root_motion_track(value) |
+-----------+------------------------------+
| *Getter* | get_root_motion_track() |
+-----------+------------------------------+
:ref:`NodePath<class_NodePath>` **root_motion_track** = ``NodePath("")``
.. rst-class:: classref-property-setget
- void **set_root_motion_track** **(** :ref:`NodePath<class_NodePath>` value **)**
- :ref:`NodePath<class_NodePath>` **get_root_motion_track** **(** **)**
The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by ``":"``. For example, ``"character/skeleton:ankle"`` or ``"character/mesh:transform/local"``.
If the track has type :ref:`Animation.TYPE_TRANSFORM<class_Animation_constant_TYPE_TRANSFORM>`, the transformation will be cancelled visually, and the animation will appear to stay in place. See also :ref:`get_root_motion_transform<class_AnimationTree_method_get_root_motion_transform>` and :ref:`RootMotionView<class_RootMotionView>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationTree_property_tree_root:
- :ref:`AnimationNode<class_AnimationNode>` **tree_root**
.. rst-class:: classref-property
+----------+----------------------+
| *Setter* | set_tree_root(value) |
+----------+----------------------+
| *Getter* | get_tree_root() |
+----------+----------------------+
:ref:`AnimationNode<class_AnimationNode>` **tree_root**
The root animation node of this ``AnimationTree``. See :ref:`AnimationNode<class_AnimationNode>`.
.. rst-class:: classref-property-setget
- void **set_tree_root** **(** :ref:`AnimationNode<class_AnimationNode>` value **)**
- :ref:`AnimationNode<class_AnimationNode>` **get_tree_root** **(** **)**
The root animation node of this **AnimationTree**. See :ref:`AnimationNode<class_AnimationNode>`.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AnimationTree_method_advance:
- void **advance** **(** :ref:`float<class_float>` delta **)**
.. rst-class:: classref-method
void **advance** **(** :ref:`float<class_float>` delta **)**
Manually advance the animations by the specified time (in seconds).
.. rst-class:: classref-item-separator
----
.. _class_AnimationTree_method_get_root_motion_transform:
- :ref:`Transform<class_Transform>` **get_root_motion_transform** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Transform<class_Transform>` **get_root_motion_transform** **(** **)** |const|
Retrieve the motion of the :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` as a :ref:`Transform<class_Transform>` that can be used elsewhere. If :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` is not a path to a track of type :ref:`Animation.TYPE_TRANSFORM<class_Animation_constant_TYPE_TRANSFORM>`, returns an identity transformation. See also :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` and :ref:`RootMotionView<class_RootMotionView>`.
.. rst-class:: classref-item-separator
----
.. _class_AnimationTree_method_rename_parameter:
- void **rename_parameter** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)**
.. rst-class:: classref-method
void **rename_parameter** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` new_name **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

File diff suppressed because it is too large Load Diff

View File

@@ -14,10 +14,18 @@ Area
3D area for detection and physics and audio influence.
.. rst-class:: classref-introduction-group
Description
-----------
3D area that detects :ref:`CollisionObject<class_CollisionObject>` nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to custom audio buses.
3D area that detects :ref:`CollisionObject<class_CollisionObject>` nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to a custom audio bus.
To give the area its shape, add a :ref:`CollisionShape<class_CollisionShape>` or a :ref:`CollisionPolygon<class_CollisionPolygon>` node as a *direct* child (or add multiple such nodes as direct children) of the area.
\ **Warning:** See :ref:`ConcavePolygonShape<class_ConcavePolygonShape>` (also called "trimesh") for a warning about possibly unexpected behavior when using that shape for an area.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -26,82 +34,108 @@ Tutorials
- `GUI in 3D Demo <https://godotengine.org/asset-library/asset/127>`__
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`angular_damp<class_Area_property_angular_damp>` | ``0.1`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`audio_bus_name<class_Area_property_audio_bus_name>` | ``"Master"`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`audio_bus_override<class_Area_property_audio_bus_override>` | ``false`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`gravity<class_Area_property_gravity>` | ``9.8`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`gravity_distance_scale<class_Area_property_gravity_distance_scale>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`gravity_point<class_Area_property_gravity_point>` | ``false`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`gravity_vec<class_Area_property_gravity_vec>` | ``Vector3( 0, -1, 0 )`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`linear_damp<class_Area_property_linear_damp>` | ``0.1`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`monitorable<class_Area_property_monitorable>` | ``true`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`monitoring<class_Area_property_monitoring>` | ``true`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`priority<class_Area_property_priority>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`reverb_bus_amount<class_Area_property_reverb_bus_amount>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`reverb_bus_enable<class_Area_property_reverb_bus_enable>` | ``false`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`reverb_bus_name<class_Area_property_reverb_bus_name>` | ``"Master"`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`reverb_bus_uniformity<class_Area_property_reverb_bus_uniformity>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`SpaceOverride<enum_Area_SpaceOverride>` | :ref:`space_override<class_Area_property_space_override>` | ``0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
.. table::
:widths: auto
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`angular_damp<class_Area_property_angular_damp>` | ``0.1`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`audio_bus_name<class_Area_property_audio_bus_name>` | ``"Master"`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`audio_bus_override<class_Area_property_audio_bus_override>` | ``false`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`gravity<class_Area_property_gravity>` | ``9.8`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`gravity_distance_scale<class_Area_property_gravity_distance_scale>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`gravity_point<class_Area_property_gravity_point>` | ``false`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`gravity_vec<class_Area_property_gravity_vec>` | ``Vector3( 0, -1, 0 )`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`linear_damp<class_Area_property_linear_damp>` | ``0.1`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`monitorable<class_Area_property_monitorable>` | ``true`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`monitoring<class_Area_property_monitoring>` | ``true`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`priority<class_Area_property_priority>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`reverb_bus_amount<class_Area_property_reverb_bus_amount>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`bool<class_bool>` | :ref:`reverb_bus_enable<class_Area_property_reverb_bus_enable>` | ``false`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`String<class_String>` | :ref:`reverb_bus_name<class_Area_property_reverb_bus_name>` | ``"Master"`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`float<class_float>` | :ref:`reverb_bus_uniformity<class_Area_property_reverb_bus_uniformity>` | ``0.0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
| :ref:`SpaceOverride<enum_Area_SpaceOverride>` | :ref:`space_override<class_Area_property_space_override>` | ``0`` |
+-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_areas<class_Area_method_get_overlapping_areas>` **(** **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_bodies<class_Area_method_get_overlapping_bodies>` **(** **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_area<class_Area_method_overlaps_area>` **(** :ref:`Node<class_Node>` area **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_body<class_Area_method_overlaps_body>` **(** :ref:`Node<class_Node>` body **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_areas<class_Area_method_get_overlapping_areas>` **(** **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_bodies<class_Area_method_get_overlapping_bodies>` **(** **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_area<class_Area_method_overlaps_area>` **(** :ref:`Node<class_Node>` area **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_body<class_Area_method_overlaps_body>` **(** :ref:`Node<class_Node>` body **)** |const| |
+---------------------------+--------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_Area_signal_area_entered:
- **area_entered** **(** :ref:`Area<class_Area>` area **)**
.. rst-class:: classref-signal
**area_entered** **(** :ref:`Area<class_Area>` area **)**
Emitted when another Area enters this Area. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``.
\ ``area`` the other Area.
.. rst-class:: classref-item-separator
----
.. _class_Area_signal_area_exited:
- **area_exited** **(** :ref:`Area<class_Area>` area **)**
.. rst-class:: classref-signal
**area_exited** **(** :ref:`Area<class_Area>` area **)**
Emitted when another Area exits this Area. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``.
\ ``area`` the other Area.
.. rst-class:: classref-item-separator
----
.. _class_Area_signal_area_shape_entered:
- **area_shape_entered** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area<class_Area>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
.. rst-class:: classref-signal
**area_shape_entered** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area<class_Area>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of another Area's :ref:`Shape<class_Shape>`\ s enters one of this Area's :ref:`Shape<class_Shape>`\ s. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``.
@@ -113,11 +147,15 @@ Emitted when one of another Area's :ref:`Shape<class_Shape>`\ s enters one of th
\ ``local_shape_index`` the index of the :ref:`Shape<class_Shape>` of this Area used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``self.shape_owner_get_owner(local_shape_index)``.
.. rst-class:: classref-item-separator
----
.. _class_Area_signal_area_shape_exited:
- **area_shape_exited** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area<class_Area>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
.. rst-class:: classref-signal
**area_shape_exited** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area<class_Area>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of another Area's :ref:`Shape<class_Shape>`\ s enters one of this Area's :ref:`Shape<class_Shape>`\ s. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``.
@@ -129,31 +167,43 @@ Emitted when one of another Area's :ref:`Shape<class_Shape>`\ s enters one of th
\ ``local_shape_index`` the index of the :ref:`Shape<class_Shape>` of this Area used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``self.shape_owner_get_owner(local_shape_index)``.
.. rst-class:: classref-item-separator
----
.. _class_Area_signal_body_entered:
- **body_entered** **(** :ref:`Node<class_Node>` body **)**
.. rst-class:: classref-signal
**body_entered** **(** :ref:`Node<class_Node>` body **)**
Emitted when a :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>` enters this Area. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``. :ref:`GridMap<class_GridMap>`\ s are detected if the :ref:`MeshLibrary<class_MeshLibrary>` has Collision :ref:`Shape<class_Shape>`\ s.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the other :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>`.
.. rst-class:: classref-item-separator
----
.. _class_Area_signal_body_exited:
- **body_exited** **(** :ref:`Node<class_Node>` body **)**
.. rst-class:: classref-signal
**body_exited** **(** :ref:`Node<class_Node>` body **)**
Emitted when a :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>` exits this Area. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``. :ref:`GridMap<class_GridMap>`\ s are detected if the :ref:`MeshLibrary<class_MeshLibrary>` has Collision :ref:`Shape<class_Shape>`\ s.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the other :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>`.
.. rst-class:: classref-item-separator
----
.. _class_Area_signal_body_shape_entered:
- **body_shape_entered** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
.. rst-class:: classref-signal
**body_shape_entered** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of a :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>`'s :ref:`Shape<class_Shape>`\ s enters one of this Area's :ref:`Shape<class_Shape>`\ s. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``. :ref:`GridMap<class_GridMap>`\ s are detected if the :ref:`MeshLibrary<class_MeshLibrary>` has Collision :ref:`Shape<class_Shape>`\ s.
@@ -165,11 +215,15 @@ Emitted when one of a :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<cla
\ ``local_shape_index`` the index of the :ref:`Shape<class_Shape>` of this Area used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``self.shape_owner_get_owner(local_shape_index)``.
.. rst-class:: classref-item-separator
----
.. _class_Area_signal_body_shape_exited:
- **body_shape_exited** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
.. rst-class:: classref-signal
**body_shape_exited** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of a :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<class_GridMap>`'s :ref:`Shape<class_Shape>`\ s enters one of this Area's :ref:`Shape<class_Shape>`\ s. Requires :ref:`monitoring<class_Area_property_monitoring>` to be set to ``true``. :ref:`GridMap<class_GridMap>`\ s are detected if the :ref:`MeshLibrary<class_MeshLibrary>` has Collision :ref:`Shape<class_Shape>`\ s.
@@ -181,330 +235,398 @@ Emitted when one of a :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`GridMap<cla
\ ``local_shape_index`` the index of the :ref:`Shape<class_Shape>` of this Area used by the :ref:`PhysicsServer<class_PhysicsServer>`. Get the :ref:`CollisionShape<class_CollisionShape>` node with ``self.shape_owner_get_owner(local_shape_index)``.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_Area_SpaceOverride:
.. _class_Area_constant_SPACE_OVERRIDE_DISABLED:
.. _class_Area_constant_SPACE_OVERRIDE_COMBINE:
.. _class_Area_constant_SPACE_OVERRIDE_COMBINE_REPLACE:
.. _class_Area_constant_SPACE_OVERRIDE_REPLACE:
.. _class_Area_constant_SPACE_OVERRIDE_REPLACE_COMBINE:
.. rst-class:: classref-enumeration
enum **SpaceOverride**:
- **SPACE_OVERRIDE_DISABLED** = **0** --- This area does not affect gravity/damping.
.. _class_Area_constant_SPACE_OVERRIDE_DISABLED:
- **SPACE_OVERRIDE_COMBINE** = **1** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area_property_priority>` order).
.. rst-class:: classref-enumeration-constant
- **SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area_property_priority>` order), ignoring any lower priority areas.
:ref:`SpaceOverride<enum_Area_SpaceOverride>` **SPACE_OVERRIDE_DISABLED** = ``0``
- **SPACE_OVERRIDE_REPLACE** = **3** --- This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
This area does not affect gravity/damping.
- **SPACE_OVERRIDE_REPLACE_COMBINE** = **4** --- This area replaces any gravity/damping calculated so far (in :ref:`priority<class_Area_property_priority>` order), but keeps calculating the rest of the areas.
.. _class_Area_constant_SPACE_OVERRIDE_COMBINE:
.. rst-class:: classref-enumeration-constant
:ref:`SpaceOverride<enum_Area_SpaceOverride>` **SPACE_OVERRIDE_COMBINE** = ``1``
This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area_property_priority>` order).
.. _class_Area_constant_SPACE_OVERRIDE_COMBINE_REPLACE:
.. rst-class:: classref-enumeration-constant
:ref:`SpaceOverride<enum_Area_SpaceOverride>` **SPACE_OVERRIDE_COMBINE_REPLACE** = ``2``
This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area_property_priority>` order), ignoring any lower priority areas.
.. _class_Area_constant_SPACE_OVERRIDE_REPLACE:
.. rst-class:: classref-enumeration-constant
:ref:`SpaceOverride<enum_Area_SpaceOverride>` **SPACE_OVERRIDE_REPLACE** = ``3``
This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
.. _class_Area_constant_SPACE_OVERRIDE_REPLACE_COMBINE:
.. rst-class:: classref-enumeration-constant
:ref:`SpaceOverride<enum_Area_SpaceOverride>` **SPACE_OVERRIDE_REPLACE_COMBINE** = ``4``
This area replaces any gravity/damping calculated so far (in :ref:`priority<class_Area_property_priority>` order), but keeps calculating the rest of the areas.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_Area_property_angular_damp:
- :ref:`float<class_float>` **angular_damp**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``0.1`` |
+-----------+-------------------------+
| *Setter* | set_angular_damp(value) |
+-----------+-------------------------+
| *Getter* | get_angular_damp() |
+-----------+-------------------------+
:ref:`float<class_float>` **angular_damp** = ``0.1``
.. rst-class:: classref-property-setget
- void **set_angular_damp** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_angular_damp** **(** **)**
The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.
See :ref:`ProjectSettings.physics/3d/default_angular_damp<class_ProjectSettings_property_physics/3d/default_angular_damp>` for more details about damping.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_audio_bus_name:
- :ref:`String<class_String>` **audio_bus_name**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``"Master"`` |
+-----------+----------------------+
| *Setter* | set_audio_bus(value) |
+-----------+----------------------+
| *Getter* | get_audio_bus() |
+-----------+----------------------+
:ref:`String<class_String>` **audio_bus_name** = ``"Master"``
.. rst-class:: classref-property-setget
- void **set_audio_bus** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_audio_bus** **(** **)**
The name of the area's audio bus.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_audio_bus_override:
- :ref:`bool<class_bool>` **audio_bus_override**
.. rst-class:: classref-property
+-----------+-------------------------------+
| *Default* | ``false`` |
+-----------+-------------------------------+
| *Setter* | set_audio_bus_override(value) |
+-----------+-------------------------------+
| *Getter* | is_overriding_audio_bus() |
+-----------+-------------------------------+
:ref:`bool<class_bool>` **audio_bus_override** = ``false``
.. rst-class:: classref-property-setget
- void **set_audio_bus_override** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_overriding_audio_bus** **(** **)**
If ``true``, the area's audio bus overrides the default audio bus.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_gravity:
- :ref:`float<class_float>` **gravity**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``9.8`` |
+-----------+--------------------+
| *Setter* | set_gravity(value) |
+-----------+--------------------+
| *Getter* | get_gravity() |
+-----------+--------------------+
:ref:`float<class_float>` **gravity** = ``9.8``
.. rst-class:: classref-property-setget
- void **set_gravity** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_gravity** **(** **)**
The area's gravity intensity (in meters per second squared). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_gravity_distance_scale:
- :ref:`float<class_float>` **gravity_distance_scale**
.. rst-class:: classref-property
+-----------+-----------------------------------+
| *Default* | ``0.0`` |
+-----------+-----------------------------------+
| *Setter* | set_gravity_distance_scale(value) |
+-----------+-----------------------------------+
| *Getter* | get_gravity_distance_scale() |
+-----------+-----------------------------------+
:ref:`float<class_float>` **gravity_distance_scale** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_gravity_distance_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_gravity_distance_scale** **(** **)**
The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_gravity_point:
- :ref:`bool<class_bool>` **gravity_point**
.. rst-class:: classref-property
+-----------+-----------------------------+
| *Default* | ``false`` |
+-----------+-----------------------------+
| *Setter* | set_gravity_is_point(value) |
+-----------+-----------------------------+
| *Getter* | is_gravity_a_point() |
+-----------+-----------------------------+
:ref:`bool<class_bool>` **gravity_point** = ``false``
.. rst-class:: classref-property-setget
- void **set_gravity_is_point** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_gravity_a_point** **(** **)**
If ``true``, gravity is calculated from a point (set via :ref:`gravity_vec<class_Area_property_gravity_vec>`). See also :ref:`space_override<class_Area_property_space_override>`.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_gravity_vec:
- :ref:`Vector3<class_Vector3>` **gravity_vec**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``Vector3( 0, -1, 0 )`` |
+-----------+---------------------------+
| *Setter* | set_gravity_vector(value) |
+-----------+---------------------------+
| *Getter* | get_gravity_vector() |
+-----------+---------------------------+
:ref:`Vector3<class_Vector3>` **gravity_vec** = ``Vector3( 0, -1, 0 )``
.. rst-class:: classref-property-setget
- void **set_gravity_vector** **(** :ref:`Vector3<class_Vector3>` value **)**
- :ref:`Vector3<class_Vector3>` **get_gravity_vector** **(** **)**
The area's gravity vector (not normalized). If gravity is a point (see :ref:`gravity_point<class_Area_property_gravity_point>`), this will be the point of attraction.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_linear_damp:
- :ref:`float<class_float>` **linear_damp**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``0.1`` |
+-----------+------------------------+
| *Setter* | set_linear_damp(value) |
+-----------+------------------------+
| *Getter* | get_linear_damp() |
+-----------+------------------------+
:ref:`float<class_float>` **linear_damp** = ``0.1``
.. rst-class:: classref-property-setget
- void **set_linear_damp** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_linear_damp** **(** **)**
The rate at which objects stop moving in this area. Represents the linear velocity lost per second.
See :ref:`ProjectSettings.physics/3d/default_linear_damp<class_ProjectSettings_property_physics/3d/default_linear_damp>` for more details about damping.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_monitorable:
- :ref:`bool<class_bool>` **monitorable**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``true`` |
+-----------+------------------------+
| *Setter* | set_monitorable(value) |
+-----------+------------------------+
| *Getter* | is_monitorable() |
+-----------+------------------------+
:ref:`bool<class_bool>` **monitorable** = ``true``
.. rst-class:: classref-property-setget
- void **set_monitorable** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_monitorable** **(** **)**
If ``true``, other monitoring areas can detect this area.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_monitoring:
- :ref:`bool<class_bool>` **monitoring**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``true`` |
+-----------+-----------------------+
| *Setter* | set_monitoring(value) |
+-----------+-----------------------+
| *Getter* | is_monitoring() |
+-----------+-----------------------+
:ref:`bool<class_bool>` **monitoring** = ``true``
.. rst-class:: classref-property-setget
- void **set_monitoring** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_monitoring** **(** **)**
If ``true``, the area detects bodies or areas entering and exiting it.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_priority:
- :ref:`float<class_float>` **priority**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``0.0`` |
+-----------+---------------------+
| *Setter* | set_priority(value) |
+-----------+---------------------+
| *Getter* | get_priority() |
+-----------+---------------------+
:ref:`float<class_float>` **priority** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_priority** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_priority** **(** **)**
The area's priority. Higher priority areas are processed first.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_reverb_bus_amount:
- :ref:`float<class_float>` **reverb_bus_amount**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``0.0`` |
+-----------+--------------------------+
| *Setter* | set_reverb_amount(value) |
+-----------+--------------------------+
| *Getter* | get_reverb_amount() |
+-----------+--------------------------+
:ref:`float<class_float>` **reverb_bus_amount** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_reverb_amount** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_reverb_amount** **(** **)**
The degree to which this area applies reverb to its associated audio. Ranges from ``0`` to ``1`` with ``0.1`` precision.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_reverb_bus_enable:
- :ref:`bool<class_bool>` **reverb_bus_enable**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``false`` |
+-----------+---------------------------+
| *Setter* | set_use_reverb_bus(value) |
+-----------+---------------------------+
| *Getter* | is_using_reverb_bus() |
+-----------+---------------------------+
:ref:`bool<class_bool>` **reverb_bus_enable** = ``false``
.. rst-class:: classref-property-setget
- void **set_use_reverb_bus** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_using_reverb_bus** **(** **)**
If ``true``, the area applies reverb to its associated audio.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_reverb_bus_name:
- :ref:`String<class_String>` **reverb_bus_name**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``"Master"`` |
+-----------+-----------------------+
| *Setter* | set_reverb_bus(value) |
+-----------+-----------------------+
| *Getter* | get_reverb_bus() |
+-----------+-----------------------+
:ref:`String<class_String>` **reverb_bus_name** = ``"Master"``
.. rst-class:: classref-property-setget
- void **set_reverb_bus** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_reverb_bus** **(** **)**
The reverb bus name to use for this area's associated audio.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_reverb_bus_uniformity:
- :ref:`float<class_float>` **reverb_bus_uniformity**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``0.0`` |
+-----------+------------------------------+
| *Setter* | set_reverb_uniformity(value) |
+-----------+------------------------------+
| *Getter* | get_reverb_uniformity() |
+-----------+------------------------------+
:ref:`float<class_float>` **reverb_bus_uniformity** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_reverb_uniformity** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_reverb_uniformity** **(** **)**
The degree to which this area's reverb is a uniform effect. Ranges from ``0`` to ``1`` with ``0.1`` precision.
.. rst-class:: classref-item-separator
----
.. _class_Area_property_space_override:
- :ref:`SpaceOverride<enum_Area_SpaceOverride>` **space_override**
.. rst-class:: classref-property
+-----------+--------------------------------+
| *Default* | ``0`` |
+-----------+--------------------------------+
| *Setter* | set_space_override_mode(value) |
+-----------+--------------------------------+
| *Getter* | get_space_override_mode() |
+-----------+--------------------------------+
:ref:`SpaceOverride<enum_Area_SpaceOverride>` **space_override** = ``0``
.. rst-class:: classref-property-setget
- void **set_space_override_mode** **(** :ref:`SpaceOverride<enum_Area_SpaceOverride>` value **)**
- :ref:`SpaceOverride<enum_Area_SpaceOverride>` **get_space_override_mode** **(** **)**
Override mode for gravity and damping calculations within this area. See :ref:`SpaceOverride<enum_Area_SpaceOverride>` for possible values.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_Area_method_get_overlapping_areas:
- :ref:`Array<class_Array>` **get_overlapping_areas** **(** **)** |const|
.. rst-class:: classref-method
Returns a list of intersecting ``Area``\ s. The overlapping area's :ref:`CollisionObject.collision_layer<class_CollisionObject_property_collision_layer>` must be part of this area's :ref:`CollisionObject.collision_mask<class_CollisionObject_property_collision_mask>` in order to be detected.
:ref:`Array<class_Array>` **get_overlapping_areas** **(** **)** |const|
Returns a list of intersecting **Area**\ s. The overlapping area's :ref:`CollisionObject.collision_layer<class_CollisionObject_property_collision_layer>` must be part of this area's :ref:`CollisionObject.collision_mask<class_CollisionObject_property_collision_mask>` in order to be detected.
For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
.. rst-class:: classref-item-separator
----
.. _class_Area_method_get_overlapping_bodies:
- :ref:`Array<class_Array>` **get_overlapping_bodies** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Array<class_Array>` **get_overlapping_bodies** **(** **)** |const|
Returns a list of intersecting :ref:`PhysicsBody<class_PhysicsBody>`\ s. The overlapping body's :ref:`CollisionObject.collision_layer<class_CollisionObject_property_collision_layer>` must be part of this area's :ref:`CollisionObject.collision_mask<class_CollisionObject_property_collision_mask>` in order to be detected.
For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
.. rst-class:: classref-item-separator
----
.. _class_Area_method_overlaps_area:
- :ref:`bool<class_bool>` **overlaps_area** **(** :ref:`Node<class_Node>` area **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **overlaps_area** **(** :ref:`Node<class_Node>` area **)** |const|
If ``true``, the given area overlaps the Area.
\ **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
.. rst-class:: classref-item-separator
----
.. _class_Area_method_overlaps_body:
- :ref:`bool<class_bool>` **overlaps_body** **(** :ref:`Node<class_Node>` body **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **overlaps_body** **(** :ref:`Node<class_Node>` body **)** |const|
If ``true``, the given physics body overlaps the Area.
@@ -515,3 +637,4 @@ The ``body`` argument can either be a :ref:`PhysicsBody<class_PhysicsBody>` or a
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,11 +14,19 @@ Area2D
2D area for detection and physics and audio influence.
.. rst-class:: classref-introduction-group
Description
-----------
2D area that detects :ref:`CollisionObject2D<class_CollisionObject2D>` nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping) and route audio to a custom audio bus.
To give the area its shape, add a :ref:`CollisionShape2D<class_CollisionShape2D>` or a :ref:`CollisionPolygon2D<class_CollisionPolygon2D>` node as a *direct* child (or add multiple such nodes as direct children) of the area.
\ **Warning:** See :ref:`ConcavePolygonShape2D<class_ConcavePolygonShape2D>` for a warning about possibly unexpected behavior when using that shape for an area.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -30,74 +38,100 @@ Tutorials
- `2D Platformer Demo <https://godotengine.org/asset-library/asset/120>`__
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`angular_damp<class_Area2D_property_angular_damp>` | ``1.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`String<class_String>` | :ref:`audio_bus_name<class_Area2D_property_audio_bus_name>` | ``"Master"`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`audio_bus_override<class_Area2D_property_audio_bus_override>` | ``false`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`gravity<class_Area2D_property_gravity>` | ``98.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`gravity_distance_scale<class_Area2D_property_gravity_distance_scale>` | ``0.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`gravity_point<class_Area2D_property_gravity_point>` | ``false`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`gravity_vec<class_Area2D_property_gravity_vec>` | ``Vector2( 0, 1 )`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`linear_damp<class_Area2D_property_linear_damp>` | ``0.1`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`monitorable<class_Area2D_property_monitorable>` | ``true`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`monitoring<class_Area2D_property_monitoring>` | ``true`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`priority<class_Area2D_property_priority>` | ``0.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` | :ref:`space_override<class_Area2D_property_space_override>` | ``0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
.. table::
:widths: auto
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`angular_damp<class_Area2D_property_angular_damp>` | ``1.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`String<class_String>` | :ref:`audio_bus_name<class_Area2D_property_audio_bus_name>` | ``"Master"`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`audio_bus_override<class_Area2D_property_audio_bus_override>` | ``false`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`gravity<class_Area2D_property_gravity>` | ``98.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`gravity_distance_scale<class_Area2D_property_gravity_distance_scale>` | ``0.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`gravity_point<class_Area2D_property_gravity_point>` | ``false`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`gravity_vec<class_Area2D_property_gravity_vec>` | ``Vector2( 0, 1 )`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`linear_damp<class_Area2D_property_linear_damp>` | ``0.1`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`monitorable<class_Area2D_property_monitorable>` | ``true`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`bool<class_bool>` | :ref:`monitoring<class_Area2D_property_monitoring>` | ``true`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`float<class_float>` | :ref:`priority<class_Area2D_property_priority>` | ``0.0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
| :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` | :ref:`space_override<class_Area2D_property_space_override>` | ``0`` |
+-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_areas<class_Area2D_method_get_overlapping_areas>` **(** **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_bodies<class_Area2D_method_get_overlapping_bodies>` **(** **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_area<class_Area2D_method_overlaps_area>` **(** :ref:`Node<class_Node>` area **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_body<class_Area2D_method_overlaps_body>` **(** :ref:`Node<class_Node>` body **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_areas<class_Area2D_method_get_overlapping_areas>` **(** **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_overlapping_bodies<class_Area2D_method_get_overlapping_bodies>` **(** **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_area<class_Area2D_method_overlaps_area>` **(** :ref:`Node<class_Node>` area **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`overlaps_body<class_Area2D_method_overlaps_body>` **(** :ref:`Node<class_Node>` body **)** |const| |
+---------------------------+----------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_Area2D_signal_area_entered:
- **area_entered** **(** :ref:`Area2D<class_Area2D>` area **)**
.. rst-class:: classref-signal
**area_entered** **(** :ref:`Area2D<class_Area2D>` area **)**
Emitted when another Area2D enters this Area2D. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
\ ``area`` the other Area2D.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_signal_area_exited:
- **area_exited** **(** :ref:`Area2D<class_Area2D>` area **)**
.. rst-class:: classref-signal
**area_exited** **(** :ref:`Area2D<class_Area2D>` area **)**
Emitted when another Area2D exits this Area2D. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
\ ``area`` the other Area2D.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_signal_area_shape_entered:
- **area_shape_entered** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area2D<class_Area2D>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
.. rst-class:: classref-signal
**area_shape_entered** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area2D<class_Area2D>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of another Area2D's :ref:`Shape2D<class_Shape2D>`\ s enters one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
@@ -109,11 +143,15 @@ Emitted when one of another Area2D's :ref:`Shape2D<class_Shape2D>`\ s enters one
\ ``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_signal_area_shape_exited:
- **area_shape_exited** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area2D<class_Area2D>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
.. rst-class:: classref-signal
**area_shape_exited** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area2D<class_Area2D>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of another Area2D's :ref:`Shape2D<class_Shape2D>`\ s exits one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
@@ -125,31 +163,43 @@ Emitted when one of another Area2D's :ref:`Shape2D<class_Shape2D>`\ s exits one
\ ``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_signal_body_entered:
- **body_entered** **(** :ref:`Node<class_Node>` body **)**
.. rst-class:: classref-signal
**body_entered** **(** :ref:`Node<class_Node>` body **)**
Emitted when a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>` enters this Area2D. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the other :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_signal_body_exited:
- **body_exited** **(** :ref:`Node<class_Node>` body **)**
.. rst-class:: classref-signal
**body_exited** **(** :ref:`Node<class_Node>` body **)**
Emitted when a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>` exits this Area2D. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
\ ``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the other :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_signal_body_shape_entered:
- **body_shape_entered** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
.. rst-class:: classref-signal
**body_shape_entered** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`'s :ref:`Shape2D<class_Shape2D>`\ s enters one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
@@ -161,11 +211,15 @@ Emitted when one of a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap
\ ``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_signal_body_shape_exited:
- **body_shape_exited** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
.. rst-class:: classref-signal
**body_shape_exited** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
Emitted when one of a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`'s :ref:`Shape2D<class_Shape2D>`\ s exits one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
@@ -177,266 +231,330 @@ Emitted when one of a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap
\ ``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_Area2D_SpaceOverride:
.. _class_Area2D_constant_SPACE_OVERRIDE_DISABLED:
.. _class_Area2D_constant_SPACE_OVERRIDE_COMBINE:
.. _class_Area2D_constant_SPACE_OVERRIDE_COMBINE_REPLACE:
.. _class_Area2D_constant_SPACE_OVERRIDE_REPLACE:
.. _class_Area2D_constant_SPACE_OVERRIDE_REPLACE_COMBINE:
.. rst-class:: classref-enumeration
enum **SpaceOverride**:
- **SPACE_OVERRIDE_DISABLED** = **0** --- This area does not affect gravity/damping.
.. _class_Area2D_constant_SPACE_OVERRIDE_DISABLED:
- **SPACE_OVERRIDE_COMBINE** = **1** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area2D_property_priority>` order).
.. rst-class:: classref-enumeration-constant
- **SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area2D_property_priority>` order), ignoring any lower priority areas.
:ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **SPACE_OVERRIDE_DISABLED** = ``0``
- **SPACE_OVERRIDE_REPLACE** = **3** --- This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
This area does not affect gravity/damping.
- **SPACE_OVERRIDE_REPLACE_COMBINE** = **4** --- This area replaces any gravity/damping calculated so far (in :ref:`priority<class_Area2D_property_priority>` order), but keeps calculating the rest of the areas.
.. _class_Area2D_constant_SPACE_OVERRIDE_COMBINE:
.. rst-class:: classref-enumeration-constant
:ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **SPACE_OVERRIDE_COMBINE** = ``1``
This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area2D_property_priority>` order).
.. _class_Area2D_constant_SPACE_OVERRIDE_COMBINE_REPLACE:
.. rst-class:: classref-enumeration-constant
:ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **SPACE_OVERRIDE_COMBINE_REPLACE** = ``2``
This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`priority<class_Area2D_property_priority>` order), ignoring any lower priority areas.
.. _class_Area2D_constant_SPACE_OVERRIDE_REPLACE:
.. rst-class:: classref-enumeration-constant
:ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **SPACE_OVERRIDE_REPLACE** = ``3``
This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
.. _class_Area2D_constant_SPACE_OVERRIDE_REPLACE_COMBINE:
.. rst-class:: classref-enumeration-constant
:ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **SPACE_OVERRIDE_REPLACE_COMBINE** = ``4``
This area replaces any gravity/damping calculated so far (in :ref:`priority<class_Area2D_property_priority>` order), but keeps calculating the rest of the areas.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_Area2D_property_angular_damp:
- :ref:`float<class_float>` **angular_damp**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``1.0`` |
+-----------+-------------------------+
| *Setter* | set_angular_damp(value) |
+-----------+-------------------------+
| *Getter* | get_angular_damp() |
+-----------+-------------------------+
:ref:`float<class_float>` **angular_damp** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_angular_damp** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_angular_damp** **(** **)**
The rate at which objects stop spinning in this area. Represents the angular velocity lost per second.
See :ref:`ProjectSettings.physics/2d/default_angular_damp<class_ProjectSettings_property_physics/2d/default_angular_damp>` for more details about damping.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_property_audio_bus_name:
- :ref:`String<class_String>` **audio_bus_name**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``"Master"`` |
+-----------+---------------------------+
| *Setter* | set_audio_bus_name(value) |
+-----------+---------------------------+
| *Getter* | get_audio_bus_name() |
+-----------+---------------------------+
:ref:`String<class_String>` **audio_bus_name** = ``"Master"``
.. rst-class:: classref-property-setget
- void **set_audio_bus_name** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_audio_bus_name** **(** **)**
The name of the area's audio bus.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_property_audio_bus_override:
- :ref:`bool<class_bool>` **audio_bus_override**
.. rst-class:: classref-property
+-----------+-------------------------------+
| *Default* | ``false`` |
+-----------+-------------------------------+
| *Setter* | set_audio_bus_override(value) |
+-----------+-------------------------------+
| *Getter* | is_overriding_audio_bus() |
+-----------+-------------------------------+
:ref:`bool<class_bool>` **audio_bus_override** = ``false``
.. rst-class:: classref-property-setget
- void **set_audio_bus_override** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_overriding_audio_bus** **(** **)**
If ``true``, the area's audio bus overrides the default audio bus.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_property_gravity:
- :ref:`float<class_float>` **gravity**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``98.0`` |
+-----------+--------------------+
| *Setter* | set_gravity(value) |
+-----------+--------------------+
| *Getter* | get_gravity() |
+-----------+--------------------+
:ref:`float<class_float>` **gravity** = ``98.0``
.. rst-class:: classref-property-setget
- void **set_gravity** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_gravity** **(** **)**
The area's gravity intensity (in pixels per second squared). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_property_gravity_distance_scale:
- :ref:`float<class_float>` **gravity_distance_scale**
.. rst-class:: classref-property
+-----------+-----------------------------------+
| *Default* | ``0.0`` |
+-----------+-----------------------------------+
| *Setter* | set_gravity_distance_scale(value) |
+-----------+-----------------------------------+
| *Getter* | get_gravity_distance_scale() |
+-----------+-----------------------------------+
:ref:`float<class_float>` **gravity_distance_scale** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_gravity_distance_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_gravity_distance_scale** **(** **)**
The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_property_gravity_point:
- :ref:`bool<class_bool>` **gravity_point**
.. rst-class:: classref-property
+-----------+-----------------------------+
| *Default* | ``false`` |
+-----------+-----------------------------+
| *Setter* | set_gravity_is_point(value) |
+-----------+-----------------------------+
| *Getter* | is_gravity_a_point() |
+-----------+-----------------------------+
:ref:`bool<class_bool>` **gravity_point** = ``false``
.. rst-class:: classref-property-setget
- void **set_gravity_is_point** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_gravity_a_point** **(** **)**
If ``true``, gravity is calculated from a point (set via :ref:`gravity_vec<class_Area2D_property_gravity_vec>`). See also :ref:`space_override<class_Area2D_property_space_override>`.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_property_gravity_vec:
- :ref:`Vector2<class_Vector2>` **gravity_vec**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``Vector2( 0, 1 )`` |
+-----------+---------------------------+
| *Setter* | set_gravity_vector(value) |
+-----------+---------------------------+
| *Getter* | get_gravity_vector() |
+-----------+---------------------------+
:ref:`Vector2<class_Vector2>` **gravity_vec** = ``Vector2( 0, 1 )``
.. rst-class:: classref-property-setget
- void **set_gravity_vector** **(** :ref:`Vector2<class_Vector2>` value **)**
- :ref:`Vector2<class_Vector2>` **get_gravity_vector** **(** **)**
The area's gravity vector (not normalized). If gravity is a point (see :ref:`gravity_point<class_Area2D_property_gravity_point>`), this will be the point of attraction.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_property_linear_damp:
- :ref:`float<class_float>` **linear_damp**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``0.1`` |
+-----------+------------------------+
| *Setter* | set_linear_damp(value) |
+-----------+------------------------+
| *Getter* | get_linear_damp() |
+-----------+------------------------+
:ref:`float<class_float>` **linear_damp** = ``0.1``
.. rst-class:: classref-property-setget
- void **set_linear_damp** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_linear_damp** **(** **)**
The rate at which objects stop moving in this area. Represents the linear velocity lost per second.
See :ref:`ProjectSettings.physics/2d/default_linear_damp<class_ProjectSettings_property_physics/2d/default_linear_damp>` for more details about damping.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_property_monitorable:
- :ref:`bool<class_bool>` **monitorable**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``true`` |
+-----------+------------------------+
| *Setter* | set_monitorable(value) |
+-----------+------------------------+
| *Getter* | is_monitorable() |
+-----------+------------------------+
:ref:`bool<class_bool>` **monitorable** = ``true``
.. rst-class:: classref-property-setget
- void **set_monitorable** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_monitorable** **(** **)**
If ``true``, other monitoring areas can detect this area.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_property_monitoring:
- :ref:`bool<class_bool>` **monitoring**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``true`` |
+-----------+-----------------------+
| *Setter* | set_monitoring(value) |
+-----------+-----------------------+
| *Getter* | is_monitoring() |
+-----------+-----------------------+
:ref:`bool<class_bool>` **monitoring** = ``true``
.. rst-class:: classref-property-setget
- void **set_monitoring** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_monitoring** **(** **)**
If ``true``, the area detects bodies or areas entering and exiting it.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_property_priority:
- :ref:`float<class_float>` **priority**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``0.0`` |
+-----------+---------------------+
| *Setter* | set_priority(value) |
+-----------+---------------------+
| *Getter* | get_priority() |
+-----------+---------------------+
:ref:`float<class_float>` **priority** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_priority** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_priority** **(** **)**
The area's priority. Higher priority areas are processed first.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_property_space_override:
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **space_override**
.. rst-class:: classref-property
+-----------+--------------------------------+
| *Default* | ``0`` |
+-----------+--------------------------------+
| *Setter* | set_space_override_mode(value) |
+-----------+--------------------------------+
| *Getter* | get_space_override_mode() |
+-----------+--------------------------------+
:ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **space_override** = ``0``
.. rst-class:: classref-property-setget
- void **set_space_override_mode** **(** :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` value **)**
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **get_space_override_mode** **(** **)**
Override mode for gravity and damping calculations within this area. See :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` for possible values.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_Area2D_method_get_overlapping_areas:
- :ref:`Array<class_Array>` **get_overlapping_areas** **(** **)** |const|
.. rst-class:: classref-method
Returns a list of intersecting ``Area2D``\ s. The overlapping area's :ref:`CollisionObject2D.collision_layer<class_CollisionObject2D_property_collision_layer>` must be part of this area's :ref:`CollisionObject2D.collision_mask<class_CollisionObject2D_property_collision_mask>` in order to be detected.
:ref:`Array<class_Array>` **get_overlapping_areas** **(** **)** |const|
Returns a list of intersecting **Area2D**\ s. The overlapping area's :ref:`CollisionObject2D.collision_layer<class_CollisionObject2D_property_collision_layer>` must be part of this area's :ref:`CollisionObject2D.collision_mask<class_CollisionObject2D_property_collision_mask>` in order to be detected.
For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_method_get_overlapping_bodies:
- :ref:`Array<class_Array>` **get_overlapping_bodies** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Array<class_Array>` **get_overlapping_bodies** **(** **)** |const|
Returns a list of intersecting :ref:`PhysicsBody2D<class_PhysicsBody2D>`\ s. The overlapping body's :ref:`CollisionObject2D.collision_layer<class_CollisionObject2D_property_collision_layer>` must be part of this area's :ref:`CollisionObject2D.collision_mask<class_CollisionObject2D_property_collision_mask>` in order to be detected.
For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_method_overlaps_area:
- :ref:`bool<class_bool>` **overlaps_area** **(** :ref:`Node<class_Node>` area **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **overlaps_area** **(** :ref:`Node<class_Node>` area **)** |const|
If ``true``, the given area overlaps the Area2D.
\ **Note:** The result of this test is not immediate after moving objects. For performance, the list of overlaps is updated once per frame and before the physics step. Consider using signals instead.
.. rst-class:: classref-item-separator
----
.. _class_Area2D_method_overlaps_body:
- :ref:`bool<class_bool>` **overlaps_body** **(** :ref:`Node<class_Node>` body **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **overlaps_body** **(** :ref:`Node<class_Node>` body **)** |const|
If ``true``, the given physics body overlaps the Area2D.
@@ -447,3 +565,4 @@ The ``body`` argument can either be a :ref:`PhysicsBody2D<class_PhysicsBody2D>`
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -12,6 +12,8 @@ Array
A generic array datatype.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -42,149 +44,196 @@ Arrays can be concatenated using the ``+`` operator:
\ **Note:** When declaring an array with ``const``, the array itself can still be mutated by defining the values at individual indices or pushing/removing elements. Using ``const`` will only prevent assigning the constant with another value after it was initialized.
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolColorArray<class_PoolColorArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolVector3Array<class_PoolVector3Array>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolVector2Array<class_PoolVector2Array>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolStringArray<class_PoolStringArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolRealArray<class_PoolRealArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolIntArray<class_PoolIntArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolByteArray<class_PoolByteArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`append<class_Array_method_append>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`append_array<class_Array_method_append_array>` **(** :ref:`Array<class_Array>` array **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`back<class_Array_method_back>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`bsearch<class_Array_method_bsearch>` **(** :ref:`Variant<class_Variant>` value, :ref:`bool<class_bool>` before=true **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`bsearch_custom<class_Array_method_bsearch_custom>` **(** :ref:`Variant<class_Variant>` value, :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func, :ref:`bool<class_bool>` before=true **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_Array_method_clear>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`count<class_Array_method_count>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`duplicate<class_Array_method_duplicate>` **(** :ref:`bool<class_bool>` deep=false **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`empty<class_Array_method_empty>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`erase<class_Array_method_erase>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`fill<class_Array_method_fill>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find<class_Array_method_find>` **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=0 **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find_last<class_Array_method_find_last>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`front<class_Array_method_front>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has<class_Array_method_has>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`hash<class_Array_method_hash>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`insert<class_Array_method_insert>` **(** :ref:`int<class_int>` position, :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`invert<class_Array_method_invert>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`max<class_Array_method_max>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`min<class_Array_method_min>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`pop_at<class_Array_method_pop_at>` **(** :ref:`int<class_int>` position **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`pop_back<class_Array_method_pop_back>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`pop_front<class_Array_method_pop_front>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_back<class_Array_method_push_back>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_front<class_Array_method_push_front>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove<class_Array_method_remove>` **(** :ref:`int<class_int>` position **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`resize<class_Array_method_resize>` **(** :ref:`int<class_int>` size **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`rfind<class_Array_method_rfind>` **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=-1 **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`shuffle<class_Array_method_shuffle>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`size<class_Array_method_size>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`slice<class_Array_method_slice>` **(** :ref:`int<class_int>` begin, :ref:`int<class_int>` end, :ref:`int<class_int>` step=1, :ref:`bool<class_bool>` deep=false **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`sort<class_Array_method_sort>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`sort_custom<class_Array_method_sort_custom>` **(** :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolColorArray<class_PoolColorArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolVector3Array<class_PoolVector3Array>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolVector2Array<class_PoolVector2Array>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolStringArray<class_PoolStringArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolRealArray<class_PoolRealArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolIntArray<class_PoolIntArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`Array<class_Array_method_Array>` **(** :ref:`PoolByteArray<class_PoolByteArray>` from **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`append<class_Array_method_append>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`append_array<class_Array_method_append_array>` **(** :ref:`Array<class_Array>` array **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`back<class_Array_method_back>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`bsearch<class_Array_method_bsearch>` **(** :ref:`Variant<class_Variant>` value, :ref:`bool<class_bool>` before=true **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`bsearch_custom<class_Array_method_bsearch_custom>` **(** :ref:`Variant<class_Variant>` value, :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func, :ref:`bool<class_bool>` before=true **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_Array_method_clear>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`count<class_Array_method_count>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`duplicate<class_Array_method_duplicate>` **(** :ref:`bool<class_bool>` deep=false **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`empty<class_Array_method_empty>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`erase<class_Array_method_erase>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`fill<class_Array_method_fill>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find<class_Array_method_find>` **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=0 **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find_last<class_Array_method_find_last>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`front<class_Array_method_front>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has<class_Array_method_has>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`hash<class_Array_method_hash>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`insert<class_Array_method_insert>` **(** :ref:`int<class_int>` position, :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`invert<class_Array_method_invert>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`max<class_Array_method_max>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`min<class_Array_method_min>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`pick_random<class_Array_method_pick_random>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`pop_at<class_Array_method_pop_at>` **(** :ref:`int<class_int>` position **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`pop_back<class_Array_method_pop_back>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`pop_front<class_Array_method_pop_front>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_back<class_Array_method_push_back>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`push_front<class_Array_method_push_front>` **(** :ref:`Variant<class_Variant>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove<class_Array_method_remove>` **(** :ref:`int<class_int>` position **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`resize<class_Array_method_resize>` **(** :ref:`int<class_int>` size **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`rfind<class_Array_method_rfind>` **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=-1 **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`shuffle<class_Array_method_shuffle>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`size<class_Array_method_size>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`slice<class_Array_method_slice>` **(** :ref:`int<class_int>` begin, :ref:`int<class_int>` end, :ref:`int<class_int>` step=1, :ref:`bool<class_bool>` deep=false **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`sort<class_Array_method_sort>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`sort_custom<class_Array_method_sort_custom>` **(** :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_Array_method_Array:
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolColorArray<class_PoolColorArray>` from **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **Array** **(** :ref:`PoolColorArray<class_PoolColorArray>` from **)**
Constructs an array from a :ref:`PoolColorArray<class_PoolColorArray>`.
.. rst-class:: classref-item-separator
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolVector3Array<class_PoolVector3Array>` from **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **Array** **(** :ref:`PoolVector3Array<class_PoolVector3Array>` from **)**
Constructs an array from a :ref:`PoolVector3Array<class_PoolVector3Array>`.
.. rst-class:: classref-item-separator
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` from **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **Array** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` from **)**
Constructs an array from a :ref:`PoolVector2Array<class_PoolVector2Array>`.
.. rst-class:: classref-item-separator
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolStringArray<class_PoolStringArray>` from **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **Array** **(** :ref:`PoolStringArray<class_PoolStringArray>` from **)**
Constructs an array from a :ref:`PoolStringArray<class_PoolStringArray>`.
.. rst-class:: classref-item-separator
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolRealArray<class_PoolRealArray>` from **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **Array** **(** :ref:`PoolRealArray<class_PoolRealArray>` from **)**
Constructs an array from a :ref:`PoolRealArray<class_PoolRealArray>`.
.. rst-class:: classref-item-separator
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolIntArray<class_PoolIntArray>` from **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **Array** **(** :ref:`PoolIntArray<class_PoolIntArray>` from **)**
Constructs an array from a :ref:`PoolIntArray<class_PoolIntArray>`.
.. rst-class:: classref-item-separator
----
- :ref:`Array<class_Array>` **Array** **(** :ref:`PoolByteArray<class_PoolByteArray>` from **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **Array** **(** :ref:`PoolByteArray<class_PoolByteArray>` from **)**
Constructs an array from a :ref:`PoolByteArray<class_PoolByteArray>`.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_append:
- void **append** **(** :ref:`Variant<class_Variant>` value **)**
.. rst-class:: classref-method
void **append** **(** :ref:`Variant<class_Variant>` value **)**
Appends an element at the end of the array (alias of :ref:`push_back<class_Array_method_push_back>`).
.. rst-class:: classref-item-separator
----
.. _class_Array_method_append_array:
- void **append_array** **(** :ref:`Array<class_Array>` array **)**
.. rst-class:: classref-method
void **append_array** **(** :ref:`Array<class_Array>` array **)**
Appends another array at the end of this array.
@@ -195,31 +244,43 @@ Appends another array at the end of this array.
array1.append_array(array2)
print(array1) # Prints [1, 2, 3, 4, 5, 6].
.. rst-class:: classref-item-separator
----
.. _class_Array_method_back:
- :ref:`Variant<class_Variant>` **back** **(** **)**
.. rst-class:: classref-method
:ref:`Variant<class_Variant>` **back** **(** **)**
Returns the last element of the array. Prints an error and returns ``null`` if the array is empty.
\ **Note:** Calling this function is not the same as writing ``array[-1]``. If the array is empty, accessing by index will pause project execution when running from the editor.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_bsearch:
- :ref:`int<class_int>` **bsearch** **(** :ref:`Variant<class_Variant>` value, :ref:`bool<class_bool>` before=true **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **bsearch** **(** :ref:`Variant<class_Variant>` value, :ref:`bool<class_bool>` before=true **)**
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search. Optionally, a ``before`` specifier can be passed. If ``false``, the returned index comes after all existing entries of the value in the array.
\ **Note:** Calling :ref:`bsearch<class_Array_method_bsearch>` on an unsorted array results in unexpected behavior.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_bsearch_custom:
- :ref:`int<class_int>` **bsearch_custom** **(** :ref:`Variant<class_Variant>` value, :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func, :ref:`bool<class_bool>` before=true **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **bsearch_custom** **(** :ref:`Variant<class_Variant>` value, :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func, :ref:`bool<class_bool>` before=true **)**
Finds the index of an existing value (or the insertion index that maintains sorting order, if the value is not yet present in the array) using binary search and a custom comparison method declared in the ``obj``. Optionally, a ``before`` specifier can be passed. If ``false``, the returned index comes after all existing entries of the value in the array. The custom method receives two arguments (an element from the array and the value searched for) and must return ``true`` if the first argument is less than the second, and return ``false`` otherwise.
@@ -248,45 +309,65 @@ Finds the index of an existing value (or the insertion index that maintains sort
\ **Note:** Calling :ref:`bsearch_custom<class_Array_method_bsearch_custom>` on an unsorted array results in unexpected behavior.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_clear:
- void **clear** **(** **)**
.. rst-class:: classref-method
void **clear** **(** **)**
Clears the array. This is equivalent to using :ref:`resize<class_Array_method_resize>` with a size of ``0``.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_count:
- :ref:`int<class_int>` **count** **(** :ref:`Variant<class_Variant>` value **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **count** **(** :ref:`Variant<class_Variant>` value **)**
Returns the number of times an element is in the array.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_duplicate:
- :ref:`Array<class_Array>` **duplicate** **(** :ref:`bool<class_bool>` deep=false **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **duplicate** **(** :ref:`bool<class_bool>` deep=false **)**
Returns a copy of the array.
If ``deep`` is ``true``, a deep copy is performed: all nested arrays and dictionaries are duplicated and will not be shared with the original array. If ``false``, a shallow copy is made and references to the original nested arrays and dictionaries are kept, so that modifying a sub-array or dictionary in the copy will also impact those referenced in the source array.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_empty:
- :ref:`bool<class_bool>` **empty** **(** **)**
.. rst-class:: classref-method
:ref:`bool<class_bool>` **empty** **(** **)**
Returns ``true`` if the array is empty.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_erase:
- void **erase** **(** :ref:`Variant<class_Variant>` value **)**
.. rst-class:: classref-method
void **erase** **(** :ref:`Variant<class_Variant>` value **)**
Removes the first occurrence of a value from the array. If the value does not exist in the array, nothing happens. To remove an element by index, use :ref:`remove<class_Array_method_remove>` instead.
@@ -294,11 +375,15 @@ Removes the first occurrence of a value from the array. If the value does not ex
\ **Note:** On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_fill:
- void **fill** **(** :ref:`Variant<class_Variant>` value **)**
.. rst-class:: classref-method
void **fill** **(** :ref:`Variant<class_Variant>` value **)**
Assigns the given value to all elements in the array. This can typically be used together with :ref:`resize<class_Array_method_resize>` to create an array with a given size and initialized elements:
@@ -308,37 +393,55 @@ Assigns the given value to all elements in the array. This can typically be used
array.resize(10)
array.fill(0) # Initialize the 10 elements to 0.
\ **Note:** If ``value`` is of a reference type (:ref:`Object<class_Object>`-derived, **Array**, :ref:`Dictionary<class_Dictionary>`, etc.) then the array is filled with the references to the same object, i.e. no duplicates are created.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_find:
- :ref:`int<class_int>` **find** **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=0 **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **find** **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=0 **)**
Searches the array for a value and returns its index or ``-1`` if not found. Optionally, the initial search index can be passed. Returns ``-1`` if ``from`` is out of bounds.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_find_last:
- :ref:`int<class_int>` **find_last** **(** :ref:`Variant<class_Variant>` value **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **find_last** **(** :ref:`Variant<class_Variant>` value **)**
Searches the array in reverse order for a value and returns its index or ``-1`` if not found.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_front:
- :ref:`Variant<class_Variant>` **front** **(** **)**
.. rst-class:: classref-method
:ref:`Variant<class_Variant>` **front** **(** **)**
Returns the first element of the array. Prints an error and returns ``null`` if the array is empty.
\ **Note:** Calling this function is not the same as writing ``array[0]``. If the array is empty, accessing by index will pause project execution when running from the editor.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_has:
- :ref:`bool<class_bool>` **has** **(** :ref:`Variant<class_Variant>` value **)**
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has** **(** :ref:`Variant<class_Variant>` value **)**
Returns ``true`` if the array contains the given value.
@@ -357,21 +460,29 @@ Returns ``true`` if the array contains the given value.
if 2 in [2, 4, 6, 8]:
pass
.. rst-class:: classref-item-separator
----
.. _class_Array_method_hash:
- :ref:`int<class_int>` **hash** **(** **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **hash** **(** **)**
Returns a hashed 32-bit integer value representing the array and its contents.
\ **Note:** ``Array``\ s with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does *not* imply the arrays are equal, because different arrays can have identical hash values due to hash collisions.
\ **Note:** **Array**\ s with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does *not* imply the arrays are equal, because different arrays can have identical hash values due to hash collisions.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_insert:
- void **insert** **(** :ref:`int<class_int>` position, :ref:`Variant<class_Variant>` value **)**
.. rst-class:: classref-method
void **insert** **(** :ref:`int<class_int>` position, :ref:`Variant<class_Variant>` value **)**
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (``pos == size()``).
@@ -379,81 +490,134 @@ Inserts a new element at a given position in the array. The position must be val
\ **Note:** On large arrays, this method will be slower if the inserted element is close to the beginning of the array (index 0). This is because all elements placed after the newly inserted element have to be reindexed.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_invert:
- void **invert** **(** **)**
.. rst-class:: classref-method
void **invert** **(** **)**
Reverses the order of the elements in the array.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_max:
- :ref:`Variant<class_Variant>` **max** **(** **)**
.. rst-class:: classref-method
:ref:`Variant<class_Variant>` **max** **(** **)**
Returns the maximum value contained in the array if all elements are of comparable types. If the elements can't be compared, ``null`` is returned.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_min:
- :ref:`Variant<class_Variant>` **min** **(** **)**
.. rst-class:: classref-method
:ref:`Variant<class_Variant>` **min** **(** **)**
Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, ``null`` is returned.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_pick_random:
.. rst-class:: classref-method
:ref:`Variant<class_Variant>` **pick_random** **(** **)**
Returns a random value from the target array.
::
var array: Array[int] = [1, 2, 3, 4]
print(array.pick_random()) # Prints either of the four numbers.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_pop_at:
- :ref:`Variant<class_Variant>` **pop_at** **(** :ref:`int<class_int>` position **)**
.. rst-class:: classref-method
:ref:`Variant<class_Variant>` **pop_at** **(** :ref:`int<class_int>` position **)**
Removes and returns the element of the array at index ``position``. If negative, ``position`` is considered relative to the end of the array. Leaves the array untouched and returns ``null`` if the array is empty or if it's accessed out of bounds. An error message is printed when the array is accessed out of bounds, but not when the array is empty.
\ **Note:** On large arrays, this method can be slower than :ref:`pop_back<class_Array_method_pop_back>` as it will reindex the array's elements that are located after the removed element. The larger the array and the lower the index of the removed element, the slower :ref:`pop_at<class_Array_method_pop_at>` will be.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_pop_back:
- :ref:`Variant<class_Variant>` **pop_back** **(** **)**
.. rst-class:: classref-method
:ref:`Variant<class_Variant>` **pop_back** **(** **)**
Removes and returns the last element of the array. Returns ``null`` if the array is empty, without printing an error message. See also :ref:`pop_front<class_Array_method_pop_front>`.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_pop_front:
- :ref:`Variant<class_Variant>` **pop_front** **(** **)**
.. rst-class:: classref-method
:ref:`Variant<class_Variant>` **pop_front** **(** **)**
Removes and returns the first element of the array. Returns ``null`` if the array is empty, without printing an error message. See also :ref:`pop_back<class_Array_method_pop_back>`.
\ **Note:** On large arrays, this method is much slower than :ref:`pop_back<class_Array_method_pop_back>` as it will reindex all the array's elements every time it's called. The larger the array, the slower :ref:`pop_front<class_Array_method_pop_front>` will be.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_push_back:
- void **push_back** **(** :ref:`Variant<class_Variant>` value **)**
.. rst-class:: classref-method
void **push_back** **(** :ref:`Variant<class_Variant>` value **)**
Appends an element at the end of the array. See also :ref:`push_front<class_Array_method_push_front>`.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_push_front:
- void **push_front** **(** :ref:`Variant<class_Variant>` value **)**
.. rst-class:: classref-method
void **push_front** **(** :ref:`Variant<class_Variant>` value **)**
Adds an element at the beginning of the array. See also :ref:`push_back<class_Array_method_push_back>`.
\ **Note:** On large arrays, this method is much slower than :ref:`push_back<class_Array_method_push_back>` as it will reindex all the array's elements every time it's called. The larger the array, the slower :ref:`push_front<class_Array_method_push_front>` will be.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_remove:
- void **remove** **(** :ref:`int<class_int>` position **)**
.. rst-class:: classref-method
void **remove** **(** :ref:`int<class_int>` position **)**
Removes an element from the array by index. If the index does not exist in the array, nothing happens. To remove an element by searching for its value, use :ref:`erase<class_Array_method_erase>` instead.
@@ -461,54 +625,80 @@ Removes an element from the array by index. If the index does not exist in the a
\ **Note:** On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_resize:
- void **resize** **(** :ref:`int<class_int>` size **)**
.. rst-class:: classref-method
void **resize** **(** :ref:`int<class_int>` size **)**
Resizes the array to contain a different number of elements. If the array size is smaller, elements are cleared, if bigger, new elements are ``null``.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_rfind:
- :ref:`int<class_int>` **rfind** **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=-1 **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **rfind** **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` from=-1 **)**
Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array. If the adjusted start index is out of bounds, this method searches from the end of the array.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_shuffle:
- void **shuffle** **(** **)**
.. rst-class:: classref-method
void **shuffle** **(** **)**
Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as :ref:`@GDScript.randi<class_@GDScript_method_randi>`. Call :ref:`@GDScript.randomize<class_@GDScript_method_randomize>` to ensure that a new seed will be used each time if you want non-reproducible shuffling.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_size:
- :ref:`int<class_int>` **size** **(** **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **size** **(** **)**
Returns the number of elements in the array.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_slice:
- :ref:`Array<class_Array>` **slice** **(** :ref:`int<class_int>` begin, :ref:`int<class_int>` end, :ref:`int<class_int>` step=1, :ref:`bool<class_bool>` deep=false **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **slice** **(** :ref:`int<class_int>` begin, :ref:`int<class_int>` end, :ref:`int<class_int>` step=1, :ref:`bool<class_bool>` deep=false **)**
Duplicates the subset described in the function and returns it in an array, deeply copying the array if ``deep`` is ``true``. Lower and upper index are inclusive, with the ``step`` describing the change between indices while slicing.
.. rst-class:: classref-item-separator
----
.. _class_Array_method_sort:
- void **sort** **(** **)**
.. rst-class:: classref-method
void **sort** **(** **)**
Sorts the array.
\ **Note:** The sorting algorithm used is not `stable <https://en.wikipedia.org/wiki/Sorting_algorithm#Stability>`__. This means that values considered equal may have their order changed when using :ref:`sort<class_Array_method_sort>`.
\ **Note:** Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example:
::
@@ -517,17 +707,23 @@ Sorts the array.
strings.sort()
print(strings) # Prints [string1, string10, string11, string2]
.. rst-class:: classref-item-separator
----
.. _class_Array_method_sort_custom:
- void **sort_custom** **(** :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func **)**
.. rst-class:: classref-method
void **sort_custom** **(** :ref:`Object<class_Object>` obj, :ref:`String<class_String>` func **)**
Sorts the array using a custom method. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return either ``true`` or ``false``.
For two elements ``a`` and ``b``, if the given method returns ``true``, element ``b`` will be after element ``a`` in the array.
\ **Note:** You cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior.
\ **Note:** The sorting algorithm used is not `stable <https://en.wikipedia.org/wiki/Sorting_algorithm#Stability>`__. This means that values considered equal may have their order changed when using :ref:`sort_custom<class_Array_method_sort_custom>`.
\ **Note:** You cannot randomize the return value as the heapsort algorithm expects a deterministic result. Randomizing the return value will result in unexpected behavior.
::
@@ -544,3 +740,4 @@ For two elements ``a`` and ``b``, if the given method returns ``true``, element
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,10 +14,12 @@ ArrayMesh
:ref:`Mesh<class_Mesh>` type that provides utility for constructing a surface from arrays.
.. rst-class:: classref-introduction-group
Description
-----------
The ``ArrayMesh`` is used to construct a :ref:`Mesh<class_Mesh>` by specifying the attributes as arrays.
The **ArrayMesh** is used to construct a :ref:`Mesh<class_Mesh>` by specifying the attributes as arrays.
The most basic example is the creation of a single triangle:
@@ -43,210 +45,342 @@ See also :ref:`ImmediateGeometry<class_ImmediateGeometry>`, :ref:`MeshDataTool<c
\ **Note:** Godot uses clockwise `winding order <https://learnopengl.com/Advanced-OpenGL/Face-culling>`__ for front faces of triangle primitive modes.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/3d/procedural_geometry/arraymesh`
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
| :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` | :ref:`blend_shape_mode<class_ArrayMesh_property_blend_shape_mode>` | ``1`` |
+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`custom_aabb<class_ArrayMesh_property_custom_aabb>` | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
.. table::
:widths: auto
+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
| :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` | :ref:`blend_shape_mode<class_ArrayMesh_property_blend_shape_mode>` | ``1`` |
+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`custom_aabb<class_ArrayMesh_property_custom_aabb>` | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
+-------------------------------------------------+--------------------------------------------------------------------+------------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_blend_shape<class_ArrayMesh_method_add_blend_shape>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>` **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Array<class_Array>` arrays, :ref:`Array<class_Array>` blend_shapes=[ ], :ref:`int<class_int>` compress_flags=2194432 **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_blend_shapes<class_ArrayMesh_method_clear_blend_shapes>` **(** **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_surfaces<class_ArrayMesh_method_clear_surfaces>` **(** **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_blend_shape_count<class_ArrayMesh_method_get_blend_shape_count>` **(** **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_blend_shape_name<class_ArrayMesh_method_get_blend_shape_name>` **(** :ref:`int<class_int>` index **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`lightmap_unwrap<class_ArrayMesh_method_lightmap_unwrap>` **(** :ref:`Transform<class_Transform>` transform, :ref:`float<class_float>` texel_size **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`regen_normalmaps<class_ArrayMesh_method_regen_normalmaps>` **(** **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_shape_name<class_ArrayMesh_method_set_blend_shape_name>` **(** :ref:`int<class_int>` index, :ref:`String<class_String>` name **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_find_by_name<class_ArrayMesh_method_surface_find_by_name>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_get_array_index_len<class_ArrayMesh_method_surface_get_array_index_len>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_get_array_len<class_ArrayMesh_method_surface_get_array_len>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_get_format<class_ArrayMesh_method_surface_get_format>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`surface_get_name<class_ArrayMesh_method_surface_get_name>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` | :ref:`surface_get_primitive_type<class_ArrayMesh_method_surface_get_primitive_type>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`surface_remove<class_ArrayMesh_method_surface_remove>` **(** :ref:`int<class_int>` surf_idx **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`surface_set_name<class_ArrayMesh_method_surface_set_name>` **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_String>` name **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`surface_update_region<class_ArrayMesh_method_surface_update_region>` **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PoolByteArray<class_PoolByteArray>` data **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_blend_shape<class_ArrayMesh_method_add_blend_shape>` **(** :ref:`String<class_String>` name **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>` **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Array<class_Array>` arrays, :ref:`Array<class_Array>` blend_shapes=[ ], :ref:`int<class_int>` compress_flags=2194432 **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_blend_shapes<class_ArrayMesh_method_clear_blend_shapes>` **(** **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_surfaces<class_ArrayMesh_method_clear_surfaces>` **(** **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_blend_shape_count<class_ArrayMesh_method_get_blend_shape_count>` **(** **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_blend_shape_name<class_ArrayMesh_method_get_blend_shape_name>` **(** :ref:`int<class_int>` index **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`lightmap_unwrap<class_ArrayMesh_method_lightmap_unwrap>` **(** :ref:`Transform<class_Transform>` transform, :ref:`float<class_float>` texel_size **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`regen_normalmaps<class_ArrayMesh_method_regen_normalmaps>` **(** **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_blend_shape_name<class_ArrayMesh_method_set_blend_shape_name>` **(** :ref:`int<class_int>` index, :ref:`String<class_String>` name **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_find_by_name<class_ArrayMesh_method_surface_find_by_name>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_get_array_index_len<class_ArrayMesh_method_surface_get_array_index_len>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_get_array_len<class_ArrayMesh_method_surface_get_array_len>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`surface_get_format<class_ArrayMesh_method_surface_get_format>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`surface_get_name<class_ArrayMesh_method_surface_get_name>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` | :ref:`surface_get_primitive_type<class_ArrayMesh_method_surface_get_primitive_type>` **(** :ref:`int<class_int>` surf_idx **)** |const| |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`surface_remove<class_ArrayMesh_method_surface_remove>` **(** :ref:`int<class_int>` surf_idx **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`surface_set_name<class_ArrayMesh_method_surface_set_name>` **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_String>` name **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`surface_update_region<class_ArrayMesh_method_surface_update_region>` **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PoolByteArray<class_PoolByteArray>` data **)** |
+-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_ArrayMesh_ArrayType:
.. _class_ArrayMesh_constant_ARRAY_VERTEX:
.. _class_ArrayMesh_constant_ARRAY_NORMAL:
.. _class_ArrayMesh_constant_ARRAY_TANGENT:
.. _class_ArrayMesh_constant_ARRAY_COLOR:
.. _class_ArrayMesh_constant_ARRAY_TEX_UV:
.. _class_ArrayMesh_constant_ARRAY_TEX_UV2:
.. _class_ArrayMesh_constant_ARRAY_BONES:
.. _class_ArrayMesh_constant_ARRAY_WEIGHTS:
.. _class_ArrayMesh_constant_ARRAY_INDEX:
.. _class_ArrayMesh_constant_ARRAY_MAX:
.. rst-class:: classref-enumeration
enum **ArrayType**:
- **ARRAY_VERTEX** = **0** --- :ref:`PoolVector3Array<class_PoolVector3Array>`, :ref:`PoolVector2Array<class_PoolVector2Array>`, or :ref:`Array<class_Array>` of vertex positions.
.. _class_ArrayMesh_constant_ARRAY_VERTEX:
- **ARRAY_NORMAL** = **1** --- :ref:`PoolVector3Array<class_PoolVector3Array>` of vertex normals.
.. rst-class:: classref-enumeration-constant
- **ARRAY_TANGENT** = **2** --- :ref:`PoolRealArray<class_PoolRealArray>` of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1.
:ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_VERTEX** = ``0``
- **ARRAY_COLOR** = **3** --- :ref:`PoolColorArray<class_PoolColorArray>` of vertex colors.
:ref:`PoolVector3Array<class_PoolVector3Array>`, :ref:`PoolVector2Array<class_PoolVector2Array>`, or :ref:`Array<class_Array>` of vertex positions.
- **ARRAY_TEX_UV** = **4** --- :ref:`PoolVector2Array<class_PoolVector2Array>` for UV coordinates.
.. _class_ArrayMesh_constant_ARRAY_NORMAL:
- **ARRAY_TEX_UV2** = **5** --- :ref:`PoolVector2Array<class_PoolVector2Array>` for second UV coordinates.
.. rst-class:: classref-enumeration-constant
- **ARRAY_BONES** = **6** --- :ref:`PoolRealArray<class_PoolRealArray>` or :ref:`PoolIntArray<class_PoolIntArray>` of bone indices. Each element in groups of 4 floats.
:ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_NORMAL** = ``1``
- **ARRAY_WEIGHTS** = **7** --- :ref:`PoolRealArray<class_PoolRealArray>` of bone weights. Each element in groups of 4 floats.
:ref:`PoolVector3Array<class_PoolVector3Array>` of vertex normals.
- **ARRAY_INDEX** = **8** --- :ref:`PoolIntArray<class_PoolIntArray>` of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the \*i\*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices.
.. _class_ArrayMesh_constant_ARRAY_TANGENT:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_TANGENT** = ``2``
:ref:`PoolRealArray<class_PoolRealArray>` of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1.
.. _class_ArrayMesh_constant_ARRAY_COLOR:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_COLOR** = ``3``
:ref:`PoolColorArray<class_PoolColorArray>` of vertex colors.
.. _class_ArrayMesh_constant_ARRAY_TEX_UV:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_TEX_UV** = ``4``
:ref:`PoolVector2Array<class_PoolVector2Array>` for UV coordinates.
.. _class_ArrayMesh_constant_ARRAY_TEX_UV2:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_TEX_UV2** = ``5``
:ref:`PoolVector2Array<class_PoolVector2Array>` for second UV coordinates.
.. _class_ArrayMesh_constant_ARRAY_BONES:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_BONES** = ``6``
:ref:`PoolRealArray<class_PoolRealArray>` or :ref:`PoolIntArray<class_PoolIntArray>` of bone indices. Each element in groups of 4 floats.
.. _class_ArrayMesh_constant_ARRAY_WEIGHTS:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_WEIGHTS** = ``7``
:ref:`PoolRealArray<class_PoolRealArray>` of bone weights. Each element in groups of 4 floats.
.. _class_ArrayMesh_constant_ARRAY_INDEX:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_INDEX** = ``8``
:ref:`PoolIntArray<class_PoolIntArray>` of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the \*i\*'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices.
For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line.
- **ARRAY_MAX** = **9** --- Represents the size of the :ref:`ArrayType<enum_ArrayMesh_ArrayType>` enum.
.. _class_ArrayMesh_constant_ARRAY_MAX:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayType<enum_ArrayMesh_ArrayType>` **ARRAY_MAX** = ``9``
Represents the size of the :ref:`ArrayType<enum_ArrayMesh_ArrayType>` enum.
.. rst-class:: classref-item-separator
----
.. _enum_ArrayMesh_ArrayFormat:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_VERTEX:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_NORMAL:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_TANGENT:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_COLOR:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_TEX_UV:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_TEX_UV2:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_BONES:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_WEIGHTS:
.. _class_ArrayMesh_constant_ARRAY_FORMAT_INDEX:
.. rst-class:: classref-enumeration
enum **ArrayFormat**:
- **ARRAY_FORMAT_VERTEX** = **1** --- Array format will include vertices (mandatory).
.. _class_ArrayMesh_constant_ARRAY_FORMAT_VERTEX:
- **ARRAY_FORMAT_NORMAL** = **2** --- Array format will include normals.
.. rst-class:: classref-enumeration-constant
- **ARRAY_FORMAT_TANGENT** = **4** --- Array format will include tangents.
:ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_VERTEX** = ``1``
- **ARRAY_FORMAT_COLOR** = **8** --- Array format will include a color array.
Array format will include vertices (mandatory).
- **ARRAY_FORMAT_TEX_UV** = **16** --- Array format will include UVs.
.. _class_ArrayMesh_constant_ARRAY_FORMAT_NORMAL:
- **ARRAY_FORMAT_TEX_UV2** = **32** --- Array format will include another set of UVs.
.. rst-class:: classref-enumeration-constant
- **ARRAY_FORMAT_BONES** = **64** --- Array format will include bone indices.
:ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_NORMAL** = ``2``
- **ARRAY_FORMAT_WEIGHTS** = **128** --- Array format will include bone weights.
Array format will include normals.
- **ARRAY_FORMAT_INDEX** = **256** --- Index array will be used.
.. _class_ArrayMesh_constant_ARRAY_FORMAT_TANGENT:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_TANGENT** = ``4``
Array format will include tangents.
.. _class_ArrayMesh_constant_ARRAY_FORMAT_COLOR:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_COLOR** = ``8``
Array format will include a color array.
.. _class_ArrayMesh_constant_ARRAY_FORMAT_TEX_UV:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_TEX_UV** = ``16``
Array format will include UVs.
.. _class_ArrayMesh_constant_ARRAY_FORMAT_TEX_UV2:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_TEX_UV2** = ``32``
Array format will include another set of UVs.
.. _class_ArrayMesh_constant_ARRAY_FORMAT_BONES:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_BONES** = ``64``
Array format will include bone indices.
.. _class_ArrayMesh_constant_ARRAY_FORMAT_WEIGHTS:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_WEIGHTS** = ``128``
Array format will include bone weights.
.. _class_ArrayMesh_constant_ARRAY_FORMAT_INDEX:
.. rst-class:: classref-enumeration-constant
:ref:`ArrayFormat<enum_ArrayMesh_ArrayFormat>` **ARRAY_FORMAT_INDEX** = ``256``
Index array will be used.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Constants
---------
.. _class_ArrayMesh_constant_NO_INDEX_ARRAY:
.. rst-class:: classref-constant
**NO_INDEX_ARRAY** = ``-1``
Value used internally when no indices are present.
.. _class_ArrayMesh_constant_ARRAY_WEIGHTS_SIZE:
- **NO_INDEX_ARRAY** = **-1** --- Value used internally when no indices are present.
.. rst-class:: classref-constant
- **ARRAY_WEIGHTS_SIZE** = **4** --- Amount of weights/bone indices per vertex (always 4).
**ARRAY_WEIGHTS_SIZE** = ``4``
Amount of weights/bone indices per vertex (always 4).
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_ArrayMesh_property_blend_shape_mode:
- :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` **blend_shape_mode**
.. rst-class:: classref-property
+-----------+-----------------------------+
| *Default* | ``1`` |
+-----------+-----------------------------+
| *Setter* | set_blend_shape_mode(value) |
+-----------+-----------------------------+
| *Getter* | get_blend_shape_mode() |
+-----------+-----------------------------+
:ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` **blend_shape_mode** = ``1``
.. rst-class:: classref-property-setget
- void **set_blend_shape_mode** **(** :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` value **)**
- :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>` **get_blend_shape_mode** **(** **)**
Sets the blend shape mode to one of :ref:`BlendShapeMode<enum_Mesh_BlendShapeMode>`.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_property_custom_aabb:
- :ref:`AABB<class_AABB>` **custom_aabb**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
+-----------+------------------------------+
| *Setter* | set_custom_aabb(value) |
+-----------+------------------------------+
| *Getter* | get_custom_aabb() |
+-----------+------------------------------+
:ref:`AABB<class_AABB>` **custom_aabb** = ``AABB( 0, 0, 0, 0, 0, 0 )``
.. rst-class:: classref-property-setget
- void **set_custom_aabb** **(** :ref:`AABB<class_AABB>` value **)**
- :ref:`AABB<class_AABB>` **get_custom_aabb** **(** **)**
Overrides the :ref:`AABB<class_AABB>` with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_ArrayMesh_method_add_blend_shape:
- void **add_blend_shape** **(** :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
void **add_blend_shape** **(** :ref:`String<class_String>` name **)**
Adds name for a blend shape that will be added with :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`. Must be called before surface is added.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_add_surface_from_arrays:
- void **add_surface_from_arrays** **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Array<class_Array>` arrays, :ref:`Array<class_Array>` blend_shapes=[ ], :ref:`int<class_int>` compress_flags=2194432 **)**
.. rst-class:: classref-method
void **add_surface_from_arrays** **(** :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` primitive, :ref:`Array<class_Array>` arrays, :ref:`Array<class_Array>` blend_shapes=[ ], :ref:`int<class_int>` compress_flags=2194432 **)**
Creates a new surface.
@@ -254,129 +388,201 @@ Surfaces are created to be rendered using a ``primitive``, which may be any of t
The ``arrays`` argument is an array of arrays. See :ref:`ArrayType<enum_ArrayMesh_ArrayType>` for the values used in this array. For example, ``arrays[0]`` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for :ref:`ARRAY_INDEX<class_ArrayMesh_constant_ARRAY_INDEX>` if it is used.
\ ``compress_flags`` is a bitfield made of :ref:`ArrayFormat<enum_Mesh_ArrayFormat>` values. It defaults to :ref:`Mesh.ARRAY_COMPRESS_DEFAULT<class_Mesh_constant_ARRAY_COMPRESS_DEFAULT>`.
\ **Note:** The default ``compress_flags`` enable :ref:`Mesh.ARRAY_COMPRESS_COLOR<class_Mesh_constant_ARRAY_COMPRESS_COLOR>`, which makes vertex colors stored as 8-bit unsigned integers. This will clamp overbright vertex colors to ``Color(1, 1, 1, 1)`` and reduce their precision. To store HDR vertex colors, remove the vertex color compression flag by passing ``Mesh.ARRAY_COMPRESS_DEFAULT ^ Mesh.ARRAY_COMPRESS_COLOR`` as the value of ``compress_flags``.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_clear_blend_shapes:
- void **clear_blend_shapes** **(** **)**
.. rst-class:: classref-method
Removes all blend shapes from this ``ArrayMesh``.
void **clear_blend_shapes** **(** **)**
Removes all blend shapes from this **ArrayMesh**.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_clear_surfaces:
- void **clear_surfaces** **(** **)**
.. rst-class:: classref-method
Removes all surfaces from this ``ArrayMesh``.
void **clear_surfaces** **(** **)**
Removes all surfaces from this **ArrayMesh**.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_get_blend_shape_count:
- :ref:`int<class_int>` **get_blend_shape_count** **(** **)** |const|
.. rst-class:: classref-method
Returns the number of blend shapes that the ``ArrayMesh`` holds.
:ref:`int<class_int>` **get_blend_shape_count** **(** **)** |const|
Returns the number of blend shapes that the **ArrayMesh** holds.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_get_blend_shape_name:
- :ref:`String<class_String>` **get_blend_shape_name** **(** :ref:`int<class_int>` index **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_blend_shape_name** **(** :ref:`int<class_int>` index **)** |const|
Returns the name of the blend shape at this index.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_lightmap_unwrap:
- :ref:`Error<enum_@GlobalScope_Error>` **lightmap_unwrap** **(** :ref:`Transform<class_Transform>` transform, :ref:`float<class_float>` texel_size **)**
.. rst-class:: classref-method
Will perform a UV unwrap on the ``ArrayMesh`` to prepare the mesh for lightmapping.
:ref:`Error<enum_@GlobalScope_Error>` **lightmap_unwrap** **(** :ref:`Transform<class_Transform>` transform, :ref:`float<class_float>` texel_size **)**
Will perform a UV unwrap on the **ArrayMesh** to prepare the mesh for lightmapping.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_regen_normalmaps:
- void **regen_normalmaps** **(** **)**
.. rst-class:: classref-method
Will regenerate normal maps for the ``ArrayMesh``.
void **regen_normalmaps** **(** **)**
Will regenerate normal maps for the **ArrayMesh**.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_set_blend_shape_name:
- void **set_blend_shape_name** **(** :ref:`int<class_int>` index, :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
void **set_blend_shape_name** **(** :ref:`int<class_int>` index, :ref:`String<class_String>` name **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_surface_find_by_name:
- :ref:`int<class_int>` **surface_find_by_name** **(** :ref:`String<class_String>` name **)** |const|
.. rst-class:: classref-method
Returns the index of the first surface with this name held within this ``ArrayMesh``. If none are found, -1 is returned.
:ref:`int<class_int>` **surface_find_by_name** **(** :ref:`String<class_String>` name **)** |const|
Returns the index of the first surface with this name held within this **ArrayMesh**. If none are found, -1 is returned.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_surface_get_array_index_len:
- :ref:`int<class_int>` **surface_get_array_index_len** **(** :ref:`int<class_int>` surf_idx **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **surface_get_array_index_len** **(** :ref:`int<class_int>` surf_idx **)** |const|
Returns the length in indices of the index array in the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_surface_get_array_len:
- :ref:`int<class_int>` **surface_get_array_len** **(** :ref:`int<class_int>` surf_idx **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **surface_get_array_len** **(** :ref:`int<class_int>` surf_idx **)** |const|
Returns the length in vertices of the vertex array in the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_surface_get_format:
- :ref:`int<class_int>` **surface_get_format** **(** :ref:`int<class_int>` surf_idx **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **surface_get_format** **(** :ref:`int<class_int>` surf_idx **)** |const|
Returns the format mask of the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_surface_get_name:
- :ref:`String<class_String>` **surface_get_name** **(** :ref:`int<class_int>` surf_idx **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **surface_get_name** **(** :ref:`int<class_int>` surf_idx **)** |const|
Gets the name assigned to this surface.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_surface_get_primitive_type:
- :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` **surface_get_primitive_type** **(** :ref:`int<class_int>` surf_idx **)** |const|
.. rst-class:: classref-method
:ref:`PrimitiveType<enum_Mesh_PrimitiveType>` **surface_get_primitive_type** **(** :ref:`int<class_int>` surf_idx **)** |const|
Returns the primitive type of the requested surface (see :ref:`add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>`).
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_surface_remove:
- void **surface_remove** **(** :ref:`int<class_int>` surf_idx **)**
.. rst-class:: classref-method
void **surface_remove** **(** :ref:`int<class_int>` surf_idx **)**
Removes a surface at position ``surf_idx``, shifting greater surfaces one ``surf_idx`` slot down.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_surface_set_name:
- void **surface_set_name** **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
void **surface_set_name** **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_String>` name **)**
Sets a name for a given surface.
.. rst-class:: classref-item-separator
----
.. _class_ArrayMesh_method_surface_update_region:
- void **surface_update_region** **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PoolByteArray<class_PoolByteArray>` data **)**
.. rst-class:: classref-method
void **surface_update_region** **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PoolByteArray<class_PoolByteArray>` data **)**
Updates a specified region of mesh arrays on the GPU.
@@ -385,3 +591,4 @@ Updates a specified region of mesh arrays on the GPU.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,104 +14,154 @@ ARVRAnchor
An anchor point in AR space.
.. rst-class:: classref-introduction-group
Description
-----------
The ``ARVRAnchor`` point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them.
The **ARVRAnchor** point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them.
This node is mapped to one of the anchors through its unique ID. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the ID; the nodes will simply remain on 0,0,0 until a plane is recognized.
Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view.
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------+-------------------------------------------------------+-------+
| :ref:`int<class_int>` | :ref:`anchor_id<class_ARVRAnchor_property_anchor_id>` | ``1`` |
+-----------------------+-------------------------------------------------------+-------+
.. table::
:widths: auto
+-----------------------+-------------------------------------------------------+-------+
| :ref:`int<class_int>` | :ref:`anchor_id<class_ARVRAnchor_property_anchor_id>` | ``1`` |
+-----------------------+-------------------------------------------------------+-------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_anchor_name<class_ARVRAnchor_method_get_anchor_name>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_is_active<class_ARVRAnchor_method_get_is_active>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`Mesh<class_Mesh>` | :ref:`get_mesh<class_ARVRAnchor_method_get_mesh>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`Plane<class_Plane>` | :ref:`get_plane<class_ARVRAnchor_method_get_plane>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_size<class_ARVRAnchor_method_get_size>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_anchor_name<class_ARVRAnchor_method_get_anchor_name>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_is_active<class_ARVRAnchor_method_get_is_active>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`Mesh<class_Mesh>` | :ref:`get_mesh<class_ARVRAnchor_method_get_mesh>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`Plane<class_Plane>` | :ref:`get_plane<class_ARVRAnchor_method_get_plane>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_size<class_ARVRAnchor_method_get_size>` **(** **)** |const| |
+-------------------------------+-------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_ARVRAnchor_signal_mesh_updated:
- **mesh_updated** **(** :ref:`Mesh<class_Mesh>` mesh **)**
.. rst-class:: classref-signal
**mesh_updated** **(** :ref:`Mesh<class_Mesh>` mesh **)**
Emitted when the mesh associated with the anchor changes or when one becomes available. This is especially important for topology that is constantly being ``mesh_updated``.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_ARVRAnchor_property_anchor_id:
- :ref:`int<class_int>` **anchor_id**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``1`` |
+-----------+----------------------+
| *Setter* | set_anchor_id(value) |
+-----------+----------------------+
| *Getter* | get_anchor_id() |
+-----------+----------------------+
:ref:`int<class_int>` **anchor_id** = ``1``
.. rst-class:: classref-property-setget
- void **set_anchor_id** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_anchor_id** **(** **)**
The anchor's ID. You can set this before the anchor itself exists. The first anchor gets an ID of ``1``, the second an ID of ``2``, etc. When anchors get removed, the engine can then assign the corresponding ID to new anchors. The most common situation where anchors "disappear" is when the AR server identifies that two anchors represent different parts of the same plane and merges them.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_ARVRAnchor_method_get_anchor_name:
- :ref:`String<class_String>` **get_anchor_name** **(** **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_anchor_name** **(** **)** |const|
Returns the name given to this anchor.
.. rst-class:: classref-item-separator
----
.. _class_ARVRAnchor_method_get_is_active:
- :ref:`bool<class_bool>` **get_is_active** **(** **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **get_is_active** **(** **)** |const|
Returns ``true`` if the anchor is being tracked and ``false`` if no anchor with this ID is currently known.
.. rst-class:: classref-item-separator
----
.. _class_ARVRAnchor_method_get_mesh:
- :ref:`Mesh<class_Mesh>` **get_mesh** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Mesh<class_Mesh>` **get_mesh** **(** **)** |const|
If provided by the :ref:`ARVRInterface<class_ARVRInterface>`, this returns a mesh object for the anchor. For an anchor, this can be a shape related to the object being tracked or it can be a mesh that provides topology related to the anchor and can be used to create shadows/reflections on surfaces or for generating collision shapes.
.. rst-class:: classref-item-separator
----
.. _class_ARVRAnchor_method_get_plane:
- :ref:`Plane<class_Plane>` **get_plane** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Plane<class_Plane>` **get_plane** **(** **)** |const|
Returns a plane aligned with our anchor; handy for intersection testing.
.. rst-class:: classref-item-separator
----
.. _class_ARVRAnchor_method_get_size:
- :ref:`Vector3<class_Vector3>` **get_size** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Vector3<class_Vector3>` **get_size** **(** **)** |const|
Returns the estimated size of the plane that was detected. Say when the anchor relates to a table in the real world, this is the estimated size of the surface of that table.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ ARVRCamera
A camera node with a few overrules for AR/VR applied, such as location tracking.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -21,6 +23,8 @@ This is a helper spatial node for our camera; note that, if stereoscopic renderi
The position and orientation of this node is automatically updated by the ARVR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that, in contrast to the ARVR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the ARVRCamera can lag a few milliseconds behind what is used for rendering as a result.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -29,3 +33,4 @@ Tutorials
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ ARVRController
A spatial node representing a spatially-tracked controller.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,78 +25,111 @@ Controllers are linked by their ID. You can create controller nodes before the c
The position of the controller node is automatically updated by the :ref:`ARVRServer<class_ARVRServer>`. This makes this node ideal to add child nodes to visualize the controller.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/vr/index`
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+-------------------------------------------------------------------+---------+
| :ref:`int<class_int>` | :ref:`controller_id<class_ARVRController_property_controller_id>` | ``1`` |
+---------------------------+-------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`rumble<class_ARVRController_property_rumble>` | ``0.0`` |
+---------------------------+-------------------------------------------------------------------+---------+
.. table::
:widths: auto
+---------------------------+-------------------------------------------------------------------+---------+
| :ref:`int<class_int>` | :ref:`controller_id<class_ARVRController_property_controller_id>` | ``1`` |
+---------------------------+-------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`rumble<class_ARVRController_property_rumble>` | ``0.0`` |
+---------------------------+-------------------------------------------------------------------+---------+
.. rst-class:: classref-reftable-group
Methods
-------
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_controller_name<class_ARVRController_method_get_controller_name>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` | :ref:`get_hand<class_ARVRController_method_get_hand>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_is_active<class_ARVRController_method_get_is_active>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_joystick_axis<class_ARVRController_method_get_joystick_axis>` **(** :ref:`int<class_int>` axis **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_joystick_id<class_ARVRController_method_get_joystick_id>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`Mesh<class_Mesh>` | :ref:`get_mesh<class_ARVRController_method_get_mesh>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`is_button_pressed<class_ARVRController_method_is_button_pressed>` **(** :ref:`int<class_int>` button **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_controller_name<class_ARVRController_method_get_controller_name>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` | :ref:`get_hand<class_ARVRController_method_get_hand>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_is_active<class_ARVRController_method_get_is_active>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_joystick_axis<class_ARVRController_method_get_joystick_axis>` **(** :ref:`int<class_int>` axis **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_joystick_id<class_ARVRController_method_get_joystick_id>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`Mesh<class_Mesh>` | :ref:`get_mesh<class_ARVRController_method_get_mesh>` **(** **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`is_button_pressed<class_ARVRController_method_is_button_pressed>` **(** :ref:`int<class_int>` button **)** |const| |
+------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_ARVRController_signal_button_pressed:
- **button_pressed** **(** :ref:`int<class_int>` button **)**
.. rst-class:: classref-signal
**button_pressed** **(** :ref:`int<class_int>` button **)**
Emitted when a button on this controller is pressed.
.. rst-class:: classref-item-separator
----
.. _class_ARVRController_signal_button_release:
- **button_release** **(** :ref:`int<class_int>` button **)**
.. rst-class:: classref-signal
**button_release** **(** :ref:`int<class_int>` button **)**
Emitted when a button on this controller is released.
.. rst-class:: classref-item-separator
----
.. _class_ARVRController_signal_mesh_updated:
- **mesh_updated** **(** :ref:`Mesh<class_Mesh>` mesh **)**
.. rst-class:: classref-signal
**mesh_updated** **(** :ref:`Mesh<class_Mesh>` mesh **)**
Emitted when the mesh associated with the controller changes or when one becomes available. Generally speaking this will be a static mesh after becoming available.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_ARVRController_property_controller_id:
- :ref:`int<class_int>` **controller_id**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``1`` |
+-----------+--------------------------+
| *Setter* | set_controller_id(value) |
+-----------+--------------------------+
| *Getter* | get_controller_id() |
+-----------+--------------------------+
:ref:`int<class_int>` **controller_id** = ``1``
.. rst-class:: classref-property-setget
- void **set_controller_id** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_controller_id** **(** **)**
The controller's ID.
@@ -104,81 +139,115 @@ For any other controller that the :ref:`ARVRServer<class_ARVRServer>` detects, w
When a controller is turned off, its slot is freed. This ensures controllers will keep the same ID even when controllers with lower IDs are turned off.
.. rst-class:: classref-item-separator
----
.. _class_ARVRController_property_rumble:
- :ref:`float<class_float>` **rumble**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``0.0`` |
+-----------+-------------------+
| *Setter* | set_rumble(value) |
+-----------+-------------------+
| *Getter* | get_rumble() |
+-----------+-------------------+
:ref:`float<class_float>` **rumble** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_rumble** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_rumble** **(** **)**
The degree to which the controller vibrates. Ranges from ``0.0`` to ``1.0``. If changed, updates :ref:`ARVRPositionalTracker.rumble<class_ARVRPositionalTracker_property_rumble>` accordingly.
This is a useful property to animate if you want the controller to vibrate for a limited duration.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_ARVRController_method_get_controller_name:
- :ref:`String<class_String>` **get_controller_name** **(** **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_controller_name** **(** **)** |const|
If active, returns the name of the associated controller if provided by the AR/VR SDK used.
.. rst-class:: classref-item-separator
----
.. _class_ARVRController_method_get_hand:
- :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` **get_hand** **(** **)** |const|
.. rst-class:: classref-method
:ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` **get_hand** **(** **)** |const|
Returns the hand holding this controller, if known. See :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>`.
.. rst-class:: classref-item-separator
----
.. _class_ARVRController_method_get_is_active:
- :ref:`bool<class_bool>` **get_is_active** **(** **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **get_is_active** **(** **)** |const|
Returns ``true`` if the bound controller is active. ARVR systems attempt to track active controllers.
.. rst-class:: classref-item-separator
----
.. _class_ARVRController_method_get_joystick_axis:
- :ref:`float<class_float>` **get_joystick_axis** **(** :ref:`int<class_int>` axis **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_joystick_axis** **(** :ref:`int<class_int>` axis **)** |const|
Returns the value of the given axis for things like triggers, touchpads, etc. that are embedded into the controller.
.. rst-class:: classref-item-separator
----
.. _class_ARVRController_method_get_joystick_id:
- :ref:`int<class_int>` **get_joystick_id** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_joystick_id** **(** **)** |const|
Returns the ID of the joystick object bound to this. Every controller tracked by the :ref:`ARVRServer<class_ARVRServer>` that has buttons and axis will also be registered as a joystick within Godot. This means that all the normal joystick tracking and input mapping will work for buttons and axis found on the AR/VR controllers. This ID is purely offered as information so you can link up the controller with its joystick entry.
.. rst-class:: classref-item-separator
----
.. _class_ARVRController_method_get_mesh:
- :ref:`Mesh<class_Mesh>` **get_mesh** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Mesh<class_Mesh>` **get_mesh** **(** **)** |const|
If provided by the :ref:`ARVRInterface<class_ARVRInterface>`, this returns a mesh associated with the controller. This can be used to visualize the controller.
.. rst-class:: classref-item-separator
----
.. _class_ARVRController_method_is_button_pressed:
- :ref:`int<class_int>` **is_button_pressed** **(** :ref:`int<class_int>` button **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **is_button_pressed** **(** :ref:`int<class_int>` button **)** |const|
Returns ``true`` if the button at index ``button`` is pressed. See :ref:`JoystickList<enum_@GlobalScope_JoystickList>`, in particular the ``JOY_VR_*`` constants.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,6 +16,8 @@ ARVRInterface
Base class for an AR/VR interface implementation.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,209 +25,338 @@ This class needs to be implemented to make an AR or VR platform available to God
Interfaces should be written in such a way that simply enabling them will give us a working setup. You can query the available interfaces through :ref:`ARVRServer<class_ARVRServer>`.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/vr/index`
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`ar_is_anchor_detection_enabled<class_ARVRInterface_property_ar_is_anchor_detection_enabled>` | ``false`` |
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`interface_is_initialized<class_ARVRInterface_property_interface_is_initialized>` | ``false`` |
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`interface_is_primary<class_ARVRInterface_property_interface_is_primary>` | ``false`` |
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
.. table::
:widths: auto
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`ar_is_anchor_detection_enabled<class_ARVRInterface_property_ar_is_anchor_detection_enabled>` | ``false`` |
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`interface_is_initialized<class_ARVRInterface_property_interface_is_initialized>` | ``false`` |
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`interface_is_primary<class_ARVRInterface_property_interface_is_primary>` | ``false`` |
+-------------------------+----------------------------------------------------------------------------------------------------+-----------+
.. rst-class:: classref-reftable-group
Methods
-------
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_camera_feed_id<class_ARVRInterface_method_get_camera_feed_id>` **(** **)** |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_capabilities<class_ARVRInterface_method_get_capabilities>` **(** **)** |const| |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_name<class_ARVRInterface_method_get_name>` **(** **)** |const| |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_render_targetsize<class_ARVRInterface_method_get_render_targetsize>` **(** **)** |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`Tracking_status<enum_ARVRInterface_Tracking_status>` | :ref:`get_tracking_status<class_ARVRInterface_method_get_tracking_status>` **(** **)** |const| |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`initialize<class_ARVRInterface_method_initialize>` **(** **)** |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_stereo<class_ARVRInterface_method_is_stereo>` **(** **)** |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
| void | :ref:`uninitialize<class_ARVRInterface_method_uninitialize>` **(** **)** |
+------------------------------------------------------------+------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_camera_feed_id<class_ARVRInterface_method_get_camera_feed_id>` **(** **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_capabilities<class_ARVRInterface_method_get_capabilities>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_name<class_ARVRInterface_method_get_name>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_render_targetsize<class_ARVRInterface_method_get_render_targetsize>` **(** **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Tracking_status<enum_ARVRInterface_Tracking_status>` | :ref:`get_tracking_status<class_ARVRInterface_method_get_tracking_status>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_transform_for_eye<class_ARVRInterface_method_get_transform_for_eye>` **(** :ref:`Eyes<enum_ARVRInterface_Eyes>` eye, :ref:`Transform<class_Transform>` transform **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`initialize<class_ARVRInterface_method_initialize>` **(** **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_stereo<class_ARVRInterface_method_is_stereo>` **(** **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`uninitialize<class_ARVRInterface_method_uninitialize>` **(** **)** |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_ARVRInterface_Capabilities:
.. _class_ARVRInterface_constant_ARVR_NONE:
.. _class_ARVRInterface_constant_ARVR_MONO:
.. _class_ARVRInterface_constant_ARVR_STEREO:
.. _class_ARVRInterface_constant_ARVR_AR:
.. _class_ARVRInterface_constant_ARVR_EXTERNAL:
.. rst-class:: classref-enumeration
enum **Capabilities**:
- **ARVR_NONE** = **0** --- No ARVR capabilities.
.. _class_ARVRInterface_constant_ARVR_NONE:
- **ARVR_MONO** = **1** --- This interface can work with normal rendering output (non-HMD based AR).
.. rst-class:: classref-enumeration-constant
- **ARVR_STEREO** = **2** --- This interface supports stereoscopic rendering.
:ref:`Capabilities<enum_ARVRInterface_Capabilities>` **ARVR_NONE** = ``0``
- **ARVR_AR** = **4** --- This interface supports AR (video background and real world tracking).
No ARVR capabilities.
- **ARVR_EXTERNAL** = **8** --- This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of :ref:`get_render_targetsize<class_ARVRInterface_method_get_render_targetsize>`). Using a separate viewport node frees up the main viewport for other purposes.
.. _class_ARVRInterface_constant_ARVR_MONO:
.. rst-class:: classref-enumeration-constant
:ref:`Capabilities<enum_ARVRInterface_Capabilities>` **ARVR_MONO** = ``1``
This interface can work with normal rendering output (non-HMD based AR).
.. _class_ARVRInterface_constant_ARVR_STEREO:
.. rst-class:: classref-enumeration-constant
:ref:`Capabilities<enum_ARVRInterface_Capabilities>` **ARVR_STEREO** = ``2``
This interface supports stereoscopic rendering.
.. _class_ARVRInterface_constant_ARVR_AR:
.. rst-class:: classref-enumeration-constant
:ref:`Capabilities<enum_ARVRInterface_Capabilities>` **ARVR_AR** = ``4``
This interface supports AR (video background and real world tracking).
.. _class_ARVRInterface_constant_ARVR_EXTERNAL:
.. rst-class:: classref-enumeration-constant
:ref:`Capabilities<enum_ARVRInterface_Capabilities>` **ARVR_EXTERNAL** = ``8``
This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of :ref:`get_render_targetsize<class_ARVRInterface_method_get_render_targetsize>`). Using a separate viewport node frees up the main viewport for other purposes.
.. rst-class:: classref-item-separator
----
.. _enum_ARVRInterface_Eyes:
.. _class_ARVRInterface_constant_EYE_MONO:
.. _class_ARVRInterface_constant_EYE_LEFT:
.. _class_ARVRInterface_constant_EYE_RIGHT:
.. rst-class:: classref-enumeration
enum **Eyes**:
- **EYE_MONO** = **0** --- Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported.
.. _class_ARVRInterface_constant_EYE_MONO:
- **EYE_LEFT** = **1** --- Left eye output, this is mostly used internally when rendering the image for the left eye and obtaining positioning and projection information.
.. rst-class:: classref-enumeration-constant
- **EYE_RIGHT** = **2** --- Right eye output, this is mostly used internally when rendering the image for the right eye and obtaining positioning and projection information.
:ref:`Eyes<enum_ARVRInterface_Eyes>` **EYE_MONO** = ``0``
Mono output, this is mostly used internally when retrieving positioning information for our camera node or when stereo scopic rendering is not supported.
.. _class_ARVRInterface_constant_EYE_LEFT:
.. rst-class:: classref-enumeration-constant
:ref:`Eyes<enum_ARVRInterface_Eyes>` **EYE_LEFT** = ``1``
Left eye output, this is mostly used internally when rendering the image for the left eye and obtaining positioning and projection information.
.. _class_ARVRInterface_constant_EYE_RIGHT:
.. rst-class:: classref-enumeration-constant
:ref:`Eyes<enum_ARVRInterface_Eyes>` **EYE_RIGHT** = ``2``
Right eye output, this is mostly used internally when rendering the image for the right eye and obtaining positioning and projection information.
.. rst-class:: classref-item-separator
----
.. _enum_ARVRInterface_Tracking_status:
.. _class_ARVRInterface_constant_ARVR_NORMAL_TRACKING:
.. _class_ARVRInterface_constant_ARVR_EXCESSIVE_MOTION:
.. _class_ARVRInterface_constant_ARVR_INSUFFICIENT_FEATURES:
.. _class_ARVRInterface_constant_ARVR_UNKNOWN_TRACKING:
.. _class_ARVRInterface_constant_ARVR_NOT_TRACKING:
.. rst-class:: classref-enumeration
enum **Tracking_status**:
- **ARVR_NORMAL_TRACKING** = **0** --- Tracking is behaving as expected.
.. _class_ARVRInterface_constant_ARVR_NORMAL_TRACKING:
- **ARVR_EXCESSIVE_MOTION** = **1** --- Tracking is hindered by excessive motion (the player is moving faster than tracking can keep up).
.. rst-class:: classref-enumeration-constant
- **ARVR_INSUFFICIENT_FEATURES** = **2** --- Tracking is hindered by insufficient features, it's too dark (for camera-based tracking), player is blocked, etc.
:ref:`Tracking_status<enum_ARVRInterface_Tracking_status>` **ARVR_NORMAL_TRACKING** = ``0``
- **ARVR_UNKNOWN_TRACKING** = **3** --- We don't know the status of the tracking or this interface does not provide feedback.
Tracking is behaving as expected.
- **ARVR_NOT_TRACKING** = **4** --- Tracking is not functional (camera not plugged in or obscured, lighthouses turned off, etc.).
.. _class_ARVRInterface_constant_ARVR_EXCESSIVE_MOTION:
.. rst-class:: classref-enumeration-constant
:ref:`Tracking_status<enum_ARVRInterface_Tracking_status>` **ARVR_EXCESSIVE_MOTION** = ``1``
Tracking is hindered by excessive motion (the player is moving faster than tracking can keep up).
.. _class_ARVRInterface_constant_ARVR_INSUFFICIENT_FEATURES:
.. rst-class:: classref-enumeration-constant
:ref:`Tracking_status<enum_ARVRInterface_Tracking_status>` **ARVR_INSUFFICIENT_FEATURES** = ``2``
Tracking is hindered by insufficient features, it's too dark (for camera-based tracking), player is blocked, etc.
.. _class_ARVRInterface_constant_ARVR_UNKNOWN_TRACKING:
.. rst-class:: classref-enumeration-constant
:ref:`Tracking_status<enum_ARVRInterface_Tracking_status>` **ARVR_UNKNOWN_TRACKING** = ``3``
We don't know the status of the tracking or this interface does not provide feedback.
.. _class_ARVRInterface_constant_ARVR_NOT_TRACKING:
.. rst-class:: classref-enumeration-constant
:ref:`Tracking_status<enum_ARVRInterface_Tracking_status>` **ARVR_NOT_TRACKING** = ``4``
Tracking is not functional (camera not plugged in or obscured, lighthouses turned off, etc.).
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_ARVRInterface_property_ar_is_anchor_detection_enabled:
- :ref:`bool<class_bool>` **ar_is_anchor_detection_enabled**
.. rst-class:: classref-property
+-----------+----------------------------------------+
| *Default* | ``false`` |
+-----------+----------------------------------------+
| *Setter* | set_anchor_detection_is_enabled(value) |
+-----------+----------------------------------------+
| *Getter* | get_anchor_detection_is_enabled() |
+-----------+----------------------------------------+
:ref:`bool<class_bool>` **ar_is_anchor_detection_enabled** = ``false``
.. rst-class:: classref-property-setget
- void **set_anchor_detection_is_enabled** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_anchor_detection_is_enabled** **(** **)**
On an AR interface, ``true`` if anchor detection is enabled.
.. rst-class:: classref-item-separator
----
.. _class_ARVRInterface_property_interface_is_initialized:
- :ref:`bool<class_bool>` **interface_is_initialized**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``false`` |
+-----------+---------------------------+
| *Setter* | set_is_initialized(value) |
+-----------+---------------------------+
| *Getter* | is_initialized() |
+-----------+---------------------------+
:ref:`bool<class_bool>` **interface_is_initialized** = ``false``
.. rst-class:: classref-property-setget
- void **set_is_initialized** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_initialized** **(** **)**
``true`` if this interface been initialized.
.. rst-class:: classref-item-separator
----
.. _class_ARVRInterface_property_interface_is_primary:
- :ref:`bool<class_bool>` **interface_is_primary**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``false`` |
+-----------+-----------------------+
| *Setter* | set_is_primary(value) |
+-----------+-----------------------+
| *Getter* | is_primary() |
+-----------+-----------------------+
:ref:`bool<class_bool>` **interface_is_primary** = ``false``
.. rst-class:: classref-property-setget
- void **set_is_primary** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_primary** **(** **)**
``true`` if this is the primary interface.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_ARVRInterface_method_get_camera_feed_id:
- :ref:`int<class_int>` **get_camera_feed_id** **(** **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **get_camera_feed_id** **(** **)**
If this is an AR interface that requires displaying a camera feed as the background, this method returns the feed ID in the :ref:`CameraServer<class_CameraServer>` for this interface.
.. rst-class:: classref-item-separator
----
.. _class_ARVRInterface_method_get_capabilities:
- :ref:`int<class_int>` **get_capabilities** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_capabilities** **(** **)** |const|
Returns a combination of :ref:`Capabilities<enum_ARVRInterface_Capabilities>` flags providing information about the capabilities of this interface.
.. rst-class:: classref-item-separator
----
.. _class_ARVRInterface_method_get_name:
- :ref:`String<class_String>` **get_name** **(** **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_name** **(** **)** |const|
Returns the name of this interface (OpenVR, OpenHMD, ARKit, etc).
.. rst-class:: classref-item-separator
----
.. _class_ARVRInterface_method_get_render_targetsize:
- :ref:`Vector2<class_Vector2>` **get_render_targetsize** **(** **)**
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_render_targetsize** **(** **)**
Returns the resolution at which we should render our intermediate results before things like lens distortion are applied by the VR platform.
.. rst-class:: classref-item-separator
----
.. _class_ARVRInterface_method_get_tracking_status:
- :ref:`Tracking_status<enum_ARVRInterface_Tracking_status>` **get_tracking_status** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Tracking_status<enum_ARVRInterface_Tracking_status>` **get_tracking_status** **(** **)** |const|
If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking.
.. rst-class:: classref-item-separator
----
.. _class_ARVRInterface_method_get_transform_for_eye:
.. rst-class:: classref-method
:ref:`Transform<class_Transform>` **get_transform_for_eye** **(** :ref:`Eyes<enum_ARVRInterface_Eyes>` eye, :ref:`Transform<class_Transform>` transform **)**
Returns the transform for an eye multiplied by ``transform``. The usual value for ``transform`` is the global_transform of the current ARVROrigin.
.. rst-class:: classref-item-separator
----
.. _class_ARVRInterface_method_initialize:
- :ref:`bool<class_bool>` **initialize** **(** **)**
.. rst-class:: classref-method
:ref:`bool<class_bool>` **initialize** **(** **)**
Call this to initialize this interface. The first interface that is initialized is identified as the primary interface and it will be used for rendering output.
@@ -237,22 +368,31 @@ If you do this for a platform that handles its own output (such as OpenVR) Godot
While currently not used, you can activate additional interfaces. You may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD.
.. rst-class:: classref-item-separator
----
.. _class_ARVRInterface_method_is_stereo:
- :ref:`bool<class_bool>` **is_stereo** **(** **)**
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_stereo** **(** **)**
Returns ``true`` if the current output of this interface is in stereo.
.. rst-class:: classref-item-separator
----
.. _class_ARVRInterface_method_uninitialize:
- void **uninitialize** **(** **)**
.. rst-class:: classref-method
void **uninitialize** **(** **)**
Turns the interface off.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ ARVRInterfaceGDNative
GDNative wrapper for an ARVR interface.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -22,3 +24,4 @@ This is a wrapper class for GDNative implementations of the ARVR interface. To u
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ ARVROrigin
The origin point in AR/VR.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -25,32 +27,44 @@ It is the position of this node that you update when your character needs to mov
For example, if your character is driving a car, the ARVROrigin node should be a child node of this car. Or, if you're implementing a teleport system to move your character, you should change the position of this node.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/vr/index`
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+-----------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`world_scale<class_ARVROrigin_property_world_scale>` | ``1.0`` |
+---------------------------+-----------------------------------------------------------+---------+
.. table::
:widths: auto
+---------------------------+-----------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`world_scale<class_ARVROrigin_property_world_scale>` | ``1.0`` |
+---------------------------+-----------------------------------------------------------+---------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_ARVROrigin_property_world_scale:
- :ref:`float<class_float>` **world_scale**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_world_scale(value) |
+-----------+------------------------+
| *Getter* | get_world_scale() |
+-----------+------------------------+
:ref:`float<class_float>` **world_scale** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_world_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_world_scale** **(** **)**
Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter.
@@ -59,3 +73,4 @@ Allows you to adjust the scale to your game's units. Most AR/VR platforms assume
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ ARVRPositionalTracker
A tracked object.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,170 +25,256 @@ As controllers are turned on and the AR/VR interface detects them, instances of
The :ref:`ARVRController<class_ARVRController>` and :ref:`ARVRAnchor<class_ARVRAnchor>` both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDNative-based interfaces can interact with them.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/vr/index`
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`rumble<class_ARVRPositionalTracker_property_rumble>` | ``0.0`` |
+---------------------------+------------------------------------------------------------+---------+
.. table::
:widths: auto
+---------------------------+------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`rumble<class_ARVRPositionalTracker_property_rumble>` | ``0.0`` |
+---------------------------+------------------------------------------------------------+---------+
.. rst-class:: classref-reftable-group
Methods
-------
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` | :ref:`get_hand<class_ARVRPositionalTracker_method_get_hand>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_joy_id<class_ARVRPositionalTracker_method_get_joy_id>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Mesh<class_Mesh>` | :ref:`get_mesh<class_ARVRPositionalTracker_method_get_mesh>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_name<class_ARVRPositionalTracker_method_get_name>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`get_orientation<class_ARVRPositionalTracker_method_get_orientation>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_position<class_ARVRPositionalTracker_method_get_position>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_tracker_id<class_ARVRPositionalTracker_method_get_tracker_id>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_tracks_orientation<class_ARVRPositionalTracker_method_get_tracks_orientation>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_tracks_position<class_ARVRPositionalTracker_method_get_tracks_position>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_transform<class_ARVRPositionalTracker_method_get_transform>` **(** :ref:`bool<class_bool>` adjust_by_reference_frame **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TrackerType<enum_ARVRServer_TrackerType>` | :ref:`get_type<class_ARVRPositionalTracker_method_get_type>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` | :ref:`get_hand<class_ARVRPositionalTracker_method_get_hand>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_joy_id<class_ARVRPositionalTracker_method_get_joy_id>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Mesh<class_Mesh>` | :ref:`get_mesh<class_ARVRPositionalTracker_method_get_mesh>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_name<class_ARVRPositionalTracker_method_get_name>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`get_orientation<class_ARVRPositionalTracker_method_get_orientation>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_position<class_ARVRPositionalTracker_method_get_position>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_tracker_id<class_ARVRPositionalTracker_method_get_tracker_id>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_tracks_orientation<class_ARVRPositionalTracker_method_get_tracks_orientation>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_tracks_position<class_ARVRPositionalTracker_method_get_tracks_position>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_transform<class_ARVRPositionalTracker_method_get_transform>` **(** :ref:`bool<class_bool>` adjust_by_reference_frame **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TrackerType<enum_ARVRServer_TrackerType>` | :ref:`get_type<class_ARVRPositionalTracker_method_get_type>` **(** **)** |const| |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_ARVRPositionalTracker_TrackerHand:
.. _class_ARVRPositionalTracker_constant_TRACKER_HAND_UNKNOWN:
.. _class_ARVRPositionalTracker_constant_TRACKER_LEFT_HAND:
.. _class_ARVRPositionalTracker_constant_TRACKER_RIGHT_HAND:
.. rst-class:: classref-enumeration
enum **TrackerHand**:
- **TRACKER_HAND_UNKNOWN** = **0** --- The hand this tracker is held in is unknown or not applicable.
.. _class_ARVRPositionalTracker_constant_TRACKER_HAND_UNKNOWN:
- **TRACKER_LEFT_HAND** = **1** --- This tracker is the left hand controller.
.. rst-class:: classref-enumeration-constant
- **TRACKER_RIGHT_HAND** = **2** --- This tracker is the right hand controller.
:ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` **TRACKER_HAND_UNKNOWN** = ``0``
The hand this tracker is held in is unknown or not applicable.
.. _class_ARVRPositionalTracker_constant_TRACKER_LEFT_HAND:
.. rst-class:: classref-enumeration-constant
:ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` **TRACKER_LEFT_HAND** = ``1``
This tracker is the left hand controller.
.. _class_ARVRPositionalTracker_constant_TRACKER_RIGHT_HAND:
.. rst-class:: classref-enumeration-constant
:ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` **TRACKER_RIGHT_HAND** = ``2``
This tracker is the right hand controller.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_ARVRPositionalTracker_property_rumble:
- :ref:`float<class_float>` **rumble**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``0.0`` |
+-----------+-------------------+
| *Setter* | set_rumble(value) |
+-----------+-------------------+
| *Getter* | get_rumble() |
+-----------+-------------------+
:ref:`float<class_float>` **rumble** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_rumble** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_rumble** **(** **)**
The degree to which the tracker rumbles. Ranges from ``0.0`` to ``1.0`` with precision ``.01``.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_ARVRPositionalTracker_method_get_hand:
- :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` **get_hand** **(** **)** |const|
.. rst-class:: classref-method
:ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` **get_hand** **(** **)** |const|
Returns the hand holding this tracker, if known. See :ref:`TrackerHand<enum_ARVRPositionalTracker_TrackerHand>` constants.
.. rst-class:: classref-item-separator
----
.. _class_ARVRPositionalTracker_method_get_joy_id:
- :ref:`int<class_int>` **get_joy_id** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_joy_id** **(** **)** |const|
If this is a controller that is being tracked, the controller will also be represented by a joystick entry with this ID.
.. rst-class:: classref-item-separator
----
.. _class_ARVRPositionalTracker_method_get_mesh:
- :ref:`Mesh<class_Mesh>` **get_mesh** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Mesh<class_Mesh>` **get_mesh** **(** **)** |const|
Returns the mesh related to a controller or anchor point if one is available.
.. rst-class:: classref-item-separator
----
.. _class_ARVRPositionalTracker_method_get_name:
- :ref:`String<class_String>` **get_name** **(** **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_name** **(** **)** |const|
Returns the controller or anchor point's name if available.
.. rst-class:: classref-item-separator
----
.. _class_ARVRPositionalTracker_method_get_orientation:
- :ref:`Basis<class_Basis>` **get_orientation** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Basis<class_Basis>` **get_orientation** **(** **)** |const|
Returns the controller's orientation matrix.
.. rst-class:: classref-item-separator
----
.. _class_ARVRPositionalTracker_method_get_position:
- :ref:`Vector3<class_Vector3>` **get_position** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Vector3<class_Vector3>` **get_position** **(** **)** |const|
Returns the world-space controller position.
.. rst-class:: classref-item-separator
----
.. _class_ARVRPositionalTracker_method_get_tracker_id:
- :ref:`int<class_int>` **get_tracker_id** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_tracker_id** **(** **)** |const|
Returns the internal tracker ID. This uniquely identifies the tracker per tracker type and matches the ID you need to specify for nodes such as the :ref:`ARVRController<class_ARVRController>` and :ref:`ARVRAnchor<class_ARVRAnchor>` nodes.
.. rst-class:: classref-item-separator
----
.. _class_ARVRPositionalTracker_method_get_tracks_orientation:
- :ref:`bool<class_bool>` **get_tracks_orientation** **(** **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **get_tracks_orientation** **(** **)** |const|
Returns ``true`` if this device tracks orientation.
.. rst-class:: classref-item-separator
----
.. _class_ARVRPositionalTracker_method_get_tracks_position:
- :ref:`bool<class_bool>` **get_tracks_position** **(** **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **get_tracks_position** **(** **)** |const|
Returns ``true`` if this device tracks position.
.. rst-class:: classref-item-separator
----
.. _class_ARVRPositionalTracker_method_get_transform:
- :ref:`Transform<class_Transform>` **get_transform** **(** :ref:`bool<class_bool>` adjust_by_reference_frame **)** |const|
.. rst-class:: classref-method
:ref:`Transform<class_Transform>` **get_transform** **(** :ref:`bool<class_bool>` adjust_by_reference_frame **)** |const|
Returns the transform combining this device's orientation and position.
.. rst-class:: classref-item-separator
----
.. _class_ARVRPositionalTracker_method_get_type:
- :ref:`TrackerType<enum_ARVRServer_TrackerType>` **get_type** **(** **)** |const|
.. rst-class:: classref-method
:ref:`TrackerType<enum_ARVRServer_TrackerType>` **get_type** **(** **)** |const|
Returns the tracker's type.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,199 +14,305 @@ ARVRServer
Server for AR and VR features.
.. rst-class:: classref-introduction-group
Description
-----------
The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/vr/index`
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------------------------+-----------------------------------------------------------------------+---------+
| :ref:`ARVRInterface<class_ARVRInterface>` | :ref:`primary_interface<class_ARVRServer_property_primary_interface>` | |
+-------------------------------------------+-----------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`world_scale<class_ARVRServer_property_world_scale>` | ``1.0`` |
+-------------------------------------------+-----------------------------------------------------------------------+---------+
.. table::
:widths: auto
+-------------------------------------------+-----------------------------------------------------------------------+---------+
| :ref:`ARVRInterface<class_ARVRInterface>` | :ref:`primary_interface<class_ARVRServer_property_primary_interface>` | |
+-------------------------------------------+-----------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`world_scale<class_ARVRServer_property_world_scale>` | ``1.0`` |
+-------------------------------------------+-----------------------------------------------------------------------+---------+
.. rst-class:: classref-reftable-group
Methods
-------
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_interface<class_ARVRServer_method_add_interface>` **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_tracker<class_ARVRServer_method_add_tracker>` **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`center_on_hmd<class_ARVRServer_method_center_on_hmd>` **(** :ref:`RotationMode<enum_ARVRServer_RotationMode>` rotation_mode, :ref:`bool<class_bool>` keep_height **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_primary_interface_if<class_ARVRServer_method_clear_primary_interface_if>` **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ARVRInterface<class_ARVRInterface>` | :ref:`find_interface<class_ARVRServer_method_find_interface>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_hmd_transform<class_ARVRServer_method_get_hmd_transform>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ARVRInterface<class_ARVRInterface>` | :ref:`get_interface<class_ARVRServer_method_get_interface>` **(** :ref:`int<class_int>` idx **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_interface_count<class_ARVRServer_method_get_interface_count>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_interfaces<class_ARVRServer_method_get_interfaces>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_last_commit_usec<class_ARVRServer_method_get_last_commit_usec>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_last_frame_usec<class_ARVRServer_method_get_last_frame_usec>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_last_process_usec<class_ARVRServer_method_get_last_process_usec>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_reference_frame<class_ARVRServer_method_get_reference_frame>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` | :ref:`get_tracker<class_ARVRServer_method_get_tracker>` **(** :ref:`int<class_int>` idx **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_tracker_count<class_ARVRServer_method_get_tracker_count>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_interface<class_ARVRServer_method_remove_interface>` **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_tracker<class_ARVRServer_method_remove_tracker>` **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_interface<class_ARVRServer_method_add_interface>` **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_tracker<class_ARVRServer_method_add_tracker>` **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`center_on_hmd<class_ARVRServer_method_center_on_hmd>` **(** :ref:`RotationMode<enum_ARVRServer_RotationMode>` rotation_mode, :ref:`bool<class_bool>` keep_height **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_primary_interface_if<class_ARVRServer_method_clear_primary_interface_if>` **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ARVRInterface<class_ARVRInterface>` | :ref:`find_interface<class_ARVRServer_method_find_interface>` **(** :ref:`String<class_String>` name **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_hmd_transform<class_ARVRServer_method_get_hmd_transform>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ARVRInterface<class_ARVRInterface>` | :ref:`get_interface<class_ARVRServer_method_get_interface>` **(** :ref:`int<class_int>` idx **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_interface_count<class_ARVRServer_method_get_interface_count>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_interfaces<class_ARVRServer_method_get_interfaces>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_last_commit_usec<class_ARVRServer_method_get_last_commit_usec>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_last_frame_usec<class_ARVRServer_method_get_last_frame_usec>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_last_process_usec<class_ARVRServer_method_get_last_process_usec>` **(** **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`get_reference_frame<class_ARVRServer_method_get_reference_frame>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` | :ref:`get_tracker<class_ARVRServer_method_get_tracker>` **(** :ref:`int<class_int>` idx **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_tracker_count<class_ARVRServer_method_get_tracker_count>` **(** **)** |const| |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_interface<class_ARVRServer_method_remove_interface>` **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_tracker<class_ARVRServer_method_remove_tracker>` **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)** |
+-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_ARVRServer_signal_interface_added:
- **interface_added** **(** :ref:`String<class_String>` interface_name **)**
.. rst-class:: classref-signal
**interface_added** **(** :ref:`String<class_String>` interface_name **)**
Emitted when a new interface has been added.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_signal_interface_removed:
- **interface_removed** **(** :ref:`String<class_String>` interface_name **)**
.. rst-class:: classref-signal
**interface_removed** **(** :ref:`String<class_String>` interface_name **)**
Emitted when an interface is removed.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_signal_tracker_added:
- **tracker_added** **(** :ref:`String<class_String>` tracker_name, :ref:`int<class_int>` type, :ref:`int<class_int>` id **)**
.. rst-class:: classref-signal
**tracker_added** **(** :ref:`String<class_String>` tracker_name, :ref:`int<class_int>` type, :ref:`int<class_int>` id **)**
Emitted when a new tracker has been added. If you don't use a fixed number of controllers or if you're using :ref:`ARVRAnchor<class_ARVRAnchor>`\ s for an AR solution, it is important to react to this signal to add the appropriate :ref:`ARVRController<class_ARVRController>` or :ref:`ARVRAnchor<class_ARVRAnchor>` nodes related to this new tracker.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_signal_tracker_removed:
- **tracker_removed** **(** :ref:`String<class_String>` tracker_name, :ref:`int<class_int>` type, :ref:`int<class_int>` id **)**
.. rst-class:: classref-signal
**tracker_removed** **(** :ref:`String<class_String>` tracker_name, :ref:`int<class_int>` type, :ref:`int<class_int>` id **)**
Emitted when a tracker is removed. You should remove any :ref:`ARVRController<class_ARVRController>` or :ref:`ARVRAnchor<class_ARVRAnchor>` points if applicable. This is not mandatory, the nodes simply become inactive and will be made active again when a new tracker becomes available (i.e. a new controller is switched on that takes the place of the previous one).
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_ARVRServer_TrackerType:
.. _class_ARVRServer_constant_TRACKER_CONTROLLER:
.. _class_ARVRServer_constant_TRACKER_BASESTATION:
.. _class_ARVRServer_constant_TRACKER_ANCHOR:
.. _class_ARVRServer_constant_TRACKER_ANY_KNOWN:
.. _class_ARVRServer_constant_TRACKER_UNKNOWN:
.. _class_ARVRServer_constant_TRACKER_ANY:
.. rst-class:: classref-enumeration
enum **TrackerType**:
- **TRACKER_CONTROLLER** = **1** --- The tracker tracks the location of a controller.
.. _class_ARVRServer_constant_TRACKER_CONTROLLER:
- **TRACKER_BASESTATION** = **2** --- The tracker tracks the location of a base station.
.. rst-class:: classref-enumeration-constant
- **TRACKER_ANCHOR** = **4** --- The tracker tracks the location and size of an AR anchor.
:ref:`TrackerType<enum_ARVRServer_TrackerType>` **TRACKER_CONTROLLER** = ``1``
- **TRACKER_ANY_KNOWN** = **127** --- Used internally to filter trackers of any known type.
The tracker tracks the location of a controller.
- **TRACKER_UNKNOWN** = **128** --- Used internally if we haven't set the tracker type yet.
.. _class_ARVRServer_constant_TRACKER_BASESTATION:
- **TRACKER_ANY** = **255** --- Used internally to select all trackers.
.. rst-class:: classref-enumeration-constant
:ref:`TrackerType<enum_ARVRServer_TrackerType>` **TRACKER_BASESTATION** = ``2``
The tracker tracks the location of a base station.
.. _class_ARVRServer_constant_TRACKER_ANCHOR:
.. rst-class:: classref-enumeration-constant
:ref:`TrackerType<enum_ARVRServer_TrackerType>` **TRACKER_ANCHOR** = ``4``
The tracker tracks the location and size of an AR anchor.
.. _class_ARVRServer_constant_TRACKER_ANY_KNOWN:
.. rst-class:: classref-enumeration-constant
:ref:`TrackerType<enum_ARVRServer_TrackerType>` **TRACKER_ANY_KNOWN** = ``127``
Used internally to filter trackers of any known type.
.. _class_ARVRServer_constant_TRACKER_UNKNOWN:
.. rst-class:: classref-enumeration-constant
:ref:`TrackerType<enum_ARVRServer_TrackerType>` **TRACKER_UNKNOWN** = ``128``
Used internally if we haven't set the tracker type yet.
.. _class_ARVRServer_constant_TRACKER_ANY:
.. rst-class:: classref-enumeration-constant
:ref:`TrackerType<enum_ARVRServer_TrackerType>` **TRACKER_ANY** = ``255``
Used internally to select all trackers.
.. rst-class:: classref-item-separator
----
.. _enum_ARVRServer_RotationMode:
.. _class_ARVRServer_constant_RESET_FULL_ROTATION:
.. _class_ARVRServer_constant_RESET_BUT_KEEP_TILT:
.. _class_ARVRServer_constant_DONT_RESET_ROTATION:
.. rst-class:: classref-enumeration
enum **RotationMode**:
- **RESET_FULL_ROTATION** = **0** --- Fully reset the orientation of the HMD. Regardless of what direction the user is looking to in the real world. The user will look dead ahead in the virtual world.
.. _class_ARVRServer_constant_RESET_FULL_ROTATION:
- **RESET_BUT_KEEP_TILT** = **1** --- Resets the orientation but keeps the tilt of the device. So if we're looking down, we keep looking down but heading will be reset.
.. rst-class:: classref-enumeration-constant
- **DONT_RESET_ROTATION** = **2** --- Does not reset the orientation of the HMD, only the position of the player gets centered.
:ref:`RotationMode<enum_ARVRServer_RotationMode>` **RESET_FULL_ROTATION** = ``0``
Fully reset the orientation of the HMD. Regardless of what direction the user is looking to in the real world. The user will look dead ahead in the virtual world.
.. _class_ARVRServer_constant_RESET_BUT_KEEP_TILT:
.. rst-class:: classref-enumeration-constant
:ref:`RotationMode<enum_ARVRServer_RotationMode>` **RESET_BUT_KEEP_TILT** = ``1``
Resets the orientation but keeps the tilt of the device. So if we're looking down, we keep looking down but heading will be reset.
.. _class_ARVRServer_constant_DONT_RESET_ROTATION:
.. rst-class:: classref-enumeration-constant
:ref:`RotationMode<enum_ARVRServer_RotationMode>` **DONT_RESET_ROTATION** = ``2``
Does not reset the orientation of the HMD, only the position of the player gets centered.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_ARVRServer_property_primary_interface:
- :ref:`ARVRInterface<class_ARVRInterface>` **primary_interface**
.. rst-class:: classref-property
+----------+------------------------------+
| *Setter* | set_primary_interface(value) |
+----------+------------------------------+
| *Getter* | get_primary_interface() |
+----------+------------------------------+
:ref:`ARVRInterface<class_ARVRInterface>` **primary_interface**
The primary :ref:`ARVRInterface<class_ARVRInterface>` currently bound to the ``ARVRServer``.
.. rst-class:: classref-property-setget
- void **set_primary_interface** **(** :ref:`ARVRInterface<class_ARVRInterface>` value **)**
- :ref:`ARVRInterface<class_ARVRInterface>` **get_primary_interface** **(** **)**
The primary :ref:`ARVRInterface<class_ARVRInterface>` currently bound to the **ARVRServer**.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_property_world_scale:
- :ref:`float<class_float>` **world_scale**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_world_scale(value) |
+-----------+------------------------+
| *Getter* | get_world_scale() |
+-----------+------------------------+
:ref:`float<class_float>` **world_scale** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_world_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_world_scale** **(** **)**
Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_ARVRServer_method_add_interface:
- void **add_interface** **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)**
.. rst-class:: classref-method
void **add_interface** **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)**
Registers an :ref:`ARVRInterface<class_ARVRInterface>` object.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_add_tracker:
- void **add_tracker** **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)**
.. rst-class:: classref-method
void **add_tracker** **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)**
Registers a new :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` that tracks a spatial location in real space.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_center_on_hmd:
- void **center_on_hmd** **(** :ref:`RotationMode<enum_ARVRServer_RotationMode>` rotation_mode, :ref:`bool<class_bool>` keep_height **)**
.. rst-class:: classref-method
void **center_on_hmd** **(** :ref:`RotationMode<enum_ARVRServer_RotationMode>` rotation_mode, :ref:`bool<class_bool>` keep_height **)**
This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently.
@@ -220,118 +326,175 @@ For this method to produce usable results, tracking information must be availabl
You should call this method after a few seconds have passed. For instance, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_clear_primary_interface_if:
- void **clear_primary_interface_if** **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)**
.. rst-class:: classref-method
void **clear_primary_interface_if** **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)**
Clears our current primary interface if it is set to the provided interface.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_find_interface:
- :ref:`ARVRInterface<class_ARVRInterface>` **find_interface** **(** :ref:`String<class_String>` name **)** |const|
.. rst-class:: classref-method
:ref:`ARVRInterface<class_ARVRInterface>` **find_interface** **(** :ref:`String<class_String>` name **)** |const|
Finds an interface by its name. For instance, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_get_hmd_transform:
- :ref:`Transform<class_Transform>` **get_hmd_transform** **(** **)**
.. rst-class:: classref-method
:ref:`Transform<class_Transform>` **get_hmd_transform** **(** **)**
Returns the primary interface's transformation.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_get_interface:
- :ref:`ARVRInterface<class_ARVRInterface>` **get_interface** **(** :ref:`int<class_int>` idx **)** |const|
.. rst-class:: classref-method
:ref:`ARVRInterface<class_ARVRInterface>` **get_interface** **(** :ref:`int<class_int>` idx **)** |const|
Returns the interface registered at a given index in our list of interfaces.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_get_interface_count:
- :ref:`int<class_int>` **get_interface_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_interface_count** **(** **)** |const|
Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns ``true``.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_get_interfaces:
- :ref:`Array<class_Array>` **get_interfaces** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Array<class_Array>` **get_interfaces** **(** **)** |const|
Returns a list of available interfaces the ID and name of each interface.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_get_last_commit_usec:
- :ref:`int<class_int>` **get_last_commit_usec** **(** **)**
.. rst-class:: classref-method
Returns the absolute timestamp (in μs) of the last ``ARVRServer`` commit of the AR/VR eyes to :ref:`VisualServer<class_VisualServer>`. The value comes from an internal call to :ref:`OS.get_ticks_usec<class_OS_method_get_ticks_usec>`.
:ref:`int<class_int>` **get_last_commit_usec** **(** **)**
Returns the absolute timestamp (in μs) of the last **ARVRServer** commit of the AR/VR eyes to :ref:`VisualServer<class_VisualServer>`. The value comes from an internal call to :ref:`OS.get_ticks_usec<class_OS_method_get_ticks_usec>`.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_get_last_frame_usec:
- :ref:`int<class_int>` **get_last_frame_usec** **(** **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **get_last_frame_usec** **(** **)**
Returns the duration (in μs) of the last frame. This is computed as the difference between :ref:`get_last_commit_usec<class_ARVRServer_method_get_last_commit_usec>` and :ref:`get_last_process_usec<class_ARVRServer_method_get_last_process_usec>` when committing.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_get_last_process_usec:
- :ref:`int<class_int>` **get_last_process_usec** **(** **)**
.. rst-class:: classref-method
Returns the absolute timestamp (in μs) of the last ``ARVRServer`` process callback. The value comes from an internal call to :ref:`OS.get_ticks_usec<class_OS_method_get_ticks_usec>`.
:ref:`int<class_int>` **get_last_process_usec** **(** **)**
Returns the absolute timestamp (in μs) of the last **ARVRServer** process callback. The value comes from an internal call to :ref:`OS.get_ticks_usec<class_OS_method_get_ticks_usec>`.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_get_reference_frame:
- :ref:`Transform<class_Transform>` **get_reference_frame** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Transform<class_Transform>` **get_reference_frame** **(** **)** |const|
Returns the reference frame transform. Mostly used internally and exposed for GDNative build interfaces.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_get_tracker:
- :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` **get_tracker** **(** :ref:`int<class_int>` idx **)** |const|
.. rst-class:: classref-method
:ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` **get_tracker** **(** :ref:`int<class_int>` idx **)** |const|
Returns the positional tracker at the given ID.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_get_tracker_count:
- :ref:`int<class_int>` **get_tracker_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_tracker_count** **(** **)** |const|
Returns the number of trackers currently registered.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_remove_interface:
- void **remove_interface** **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)**
.. rst-class:: classref-method
void **remove_interface** **(** :ref:`ARVRInterface<class_ARVRInterface>` interface **)**
Removes this interface.
.. rst-class:: classref-item-separator
----
.. _class_ARVRServer_method_remove_tracker:
- void **remove_tracker** **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)**
.. rst-class:: classref-method
void **remove_tracker** **(** :ref:`ARVRPositionalTracker<class_ARVRPositionalTracker>` tracker **)**
Removes this positional tracker.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,137 +14,195 @@ AspectRatioContainer
Container that preserves its child controls' aspect ratio.
.. rst-class:: classref-introduction-group
Description
-----------
Arranges child controls in a way to preserve their aspect ratio automatically whenever the container is resized. Solves the problem where the container size is dynamic and the contents' size needs to adjust accordingly without losing proportions.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`GUI containers <../tutorials/ui/gui_containers>`
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` | :ref:`alignment_horizontal<class_AspectRatioContainer_property_alignment_horizontal>` | ``1`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` | :ref:`alignment_vertical<class_AspectRatioContainer_property_alignment_vertical>` | ``1`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`ratio<class_AspectRatioContainer_property_ratio>` | ``1.0`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` | :ref:`stretch_mode<class_AspectRatioContainer_property_stretch_mode>` | ``2`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
.. table::
:widths: auto
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` | :ref:`alignment_horizontal<class_AspectRatioContainer_property_alignment_horizontal>` | ``1`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` | :ref:`alignment_vertical<class_AspectRatioContainer_property_alignment_vertical>` | ``1`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`ratio<class_AspectRatioContainer_property_ratio>` | ``1.0`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
| :ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` | :ref:`stretch_mode<class_AspectRatioContainer_property_stretch_mode>` | ``2`` |
+-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AspectRatioContainer_StretchMode:
.. _class_AspectRatioContainer_constant_STRETCH_WIDTH_CONTROLS_HEIGHT:
.. _class_AspectRatioContainer_constant_STRETCH_HEIGHT_CONTROLS_WIDTH:
.. _class_AspectRatioContainer_constant_STRETCH_FIT:
.. _class_AspectRatioContainer_constant_STRETCH_COVER:
.. rst-class:: classref-enumeration
enum **StretchMode**:
- **STRETCH_WIDTH_CONTROLS_HEIGHT** = **0** --- The height of child controls is automatically adjusted based on the width of the container.
.. _class_AspectRatioContainer_constant_STRETCH_WIDTH_CONTROLS_HEIGHT:
- **STRETCH_HEIGHT_CONTROLS_WIDTH** = **1** --- The width of child controls is automatically adjusted based on the height of the container.
.. rst-class:: classref-enumeration-constant
- **STRETCH_FIT** = **2** --- The bounding rectangle of child controls is automatically adjusted to fit inside the container while keeping the aspect ratio.
:ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` **STRETCH_WIDTH_CONTROLS_HEIGHT** = ``0``
- **STRETCH_COVER** = **3** --- The width and height of child controls is automatically adjusted to make their bounding rectangle cover the entire area of the container while keeping the aspect ratio.
The height of child controls is automatically adjusted based on the width of the container.
.. _class_AspectRatioContainer_constant_STRETCH_HEIGHT_CONTROLS_WIDTH:
.. rst-class:: classref-enumeration-constant
:ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` **STRETCH_HEIGHT_CONTROLS_WIDTH** = ``1``
The width of child controls is automatically adjusted based on the height of the container.
.. _class_AspectRatioContainer_constant_STRETCH_FIT:
.. rst-class:: classref-enumeration-constant
:ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` **STRETCH_FIT** = ``2``
The bounding rectangle of child controls is automatically adjusted to fit inside the container while keeping the aspect ratio.
.. _class_AspectRatioContainer_constant_STRETCH_COVER:
.. rst-class:: classref-enumeration-constant
:ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` **STRETCH_COVER** = ``3``
The width and height of child controls is automatically adjusted to make their bounding rectangle cover the entire area of the container while keeping the aspect ratio.
When the bounding rectangle of child controls exceed the container's size and :ref:`Control.rect_clip_content<class_Control_property_rect_clip_content>` is enabled, this allows to show only the container's area restricted by its own bounding rectangle.
.. rst-class:: classref-item-separator
----
.. _enum_AspectRatioContainer_AlignMode:
.. _class_AspectRatioContainer_constant_ALIGN_BEGIN:
.. _class_AspectRatioContainer_constant_ALIGN_CENTER:
.. _class_AspectRatioContainer_constant_ALIGN_END:
.. rst-class:: classref-enumeration
enum **AlignMode**:
- **ALIGN_BEGIN** = **0** --- Aligns child controls with the beginning (left or top) of the container.
.. _class_AspectRatioContainer_constant_ALIGN_BEGIN:
- **ALIGN_CENTER** = **1** --- Aligns child controls with the center of the container.
.. rst-class:: classref-enumeration-constant
- **ALIGN_END** = **2** --- Aligns child controls with the end (right or bottom) of the container.
:ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` **ALIGN_BEGIN** = ``0``
Aligns child controls with the beginning (left or top) of the container.
.. _class_AspectRatioContainer_constant_ALIGN_CENTER:
.. rst-class:: classref-enumeration-constant
:ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` **ALIGN_CENTER** = ``1``
Aligns child controls with the center of the container.
.. _class_AspectRatioContainer_constant_ALIGN_END:
.. rst-class:: classref-enumeration-constant
:ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` **ALIGN_END** = ``2``
Aligns child controls with the end (right or bottom) of the container.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AspectRatioContainer_property_alignment_horizontal:
- :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` **alignment_horizontal**
.. rst-class:: classref-property
+-----------+---------------------------------+
| *Default* | ``1`` |
+-----------+---------------------------------+
| *Setter* | set_alignment_horizontal(value) |
+-----------+---------------------------------+
| *Getter* | get_alignment_horizontal() |
+-----------+---------------------------------+
:ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` **alignment_horizontal** = ``1``
.. rst-class:: classref-property-setget
- void **set_alignment_horizontal** **(** :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` value **)**
- :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` **get_alignment_horizontal** **(** **)**
Specifies the horizontal relative position of child controls.
.. rst-class:: classref-item-separator
----
.. _class_AspectRatioContainer_property_alignment_vertical:
- :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` **alignment_vertical**
.. rst-class:: classref-property
+-----------+-------------------------------+
| *Default* | ``1`` |
+-----------+-------------------------------+
| *Setter* | set_alignment_vertical(value) |
+-----------+-------------------------------+
| *Getter* | get_alignment_vertical() |
+-----------+-------------------------------+
:ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` **alignment_vertical** = ``1``
.. rst-class:: classref-property-setget
- void **set_alignment_vertical** **(** :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` value **)**
- :ref:`AlignMode<enum_AspectRatioContainer_AlignMode>` **get_alignment_vertical** **(** **)**
Specifies the vertical relative position of child controls.
.. rst-class:: classref-item-separator
----
.. _class_AspectRatioContainer_property_ratio:
- :ref:`float<class_float>` **ratio**
.. rst-class:: classref-property
+-----------+------------------+
| *Default* | ``1.0`` |
+-----------+------------------+
| *Setter* | set_ratio(value) |
+-----------+------------------+
| *Getter* | get_ratio() |
+-----------+------------------+
:ref:`float<class_float>` **ratio** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_ratio** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_ratio** **(** **)**
The aspect ratio to enforce on child controls. This is the width divided by the height. The ratio depends on the :ref:`stretch_mode<class_AspectRatioContainer_property_stretch_mode>`.
.. rst-class:: classref-item-separator
----
.. _class_AspectRatioContainer_property_stretch_mode:
- :ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` **stretch_mode**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``2`` |
+-----------+-------------------------+
| *Setter* | set_stretch_mode(value) |
+-----------+-------------------------+
| *Getter* | get_stretch_mode() |
+-----------+-------------------------+
:ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` **stretch_mode** = ``2``
.. rst-class:: classref-property-setget
- void **set_stretch_mode** **(** :ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` value **)**
- :ref:`StretchMode<enum_AspectRatioContainer_StretchMode>` **get_stretch_mode** **(** **)**
The stretch mode used to align child controls.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AStar
An implementation of A\* to find the shortest paths among connected points in space.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -38,87 +40,108 @@ It is also possible to use non-Euclidean distances. To do so, create a class tha
If the default :ref:`_estimate_cost<class_AStar_method__estimate_cost>` and :ref:`_compute_cost<class_AStar_method__compute_cost>` methods are used, or if the supplied :ref:`_estimate_cost<class_AStar_method__estimate_cost>` method returns a lower bound of the cost, then the paths returned by A\* will be the lowest-cost paths. Here, the cost of a path equals the sum of the :ref:`_compute_cost<class_AStar_method__compute_cost>` results of all segments in the path multiplied by the ``weight_scale``\ s of the endpoints of the respective segments. If the default methods are used and the ``weight_scale``\ s of all points are set to ``1.0``, then this equals the sum of Euclidean distances of all segments in the path.
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_compute_cost<class_AStar_method__compute_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStar_method__estimate_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_point<class_AStar_method_add_point>` **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position, :ref:`float<class_float>` weight_scale=1.0 **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`are_points_connected<class_AStar_method_are_points_connected>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_AStar_method_clear>` **(** **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`connect_points<class_AStar_method_connect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`disconnect_points<class_AStar_method_disconnect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_available_point_id<class_AStar_method_get_available_point_id>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_closest_point<class_AStar_method_get_closest_point>` **(** :ref:`Vector3<class_Vector3>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_closest_position_in_segment<class_AStar_method_get_closest_position_in_segment>` **(** :ref:`Vector3<class_Vector3>` to_position **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_id_path<class_AStar_method_get_id_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_capacity<class_AStar_method_get_point_capacity>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_point_connections<class_AStar_method_get_point_connections>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_count<class_AStar_method_get_point_count>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolVector3Array<class_PoolVector3Array>` | :ref:`get_point_path<class_AStar_method_get_point_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_point_position<class_AStar_method_get_point_position>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_point_weight_scale<class_AStar_method_get_point_weight_scale>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_points<class_AStar_method_get_points>` **(** **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_point<class_AStar_method_has_point>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_point_disabled<class_AStar_method_is_point_disabled>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_point<class_AStar_method_remove_point>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`reserve_space<class_AStar_method_reserve_space>` **(** :ref:`int<class_int>` num_nodes **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_disabled<class_AStar_method_set_point_disabled>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_position<class_AStar_method_set_point_position>` **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_weight_scale<class_AStar_method_set_point_weight_scale>` **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_compute_cost<class_AStar_method__compute_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStar_method__estimate_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_point<class_AStar_method_add_point>` **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position, :ref:`float<class_float>` weight_scale=1.0 **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`are_points_connected<class_AStar_method_are_points_connected>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_AStar_method_clear>` **(** **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`connect_points<class_AStar_method_connect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`disconnect_points<class_AStar_method_disconnect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_available_point_id<class_AStar_method_get_available_point_id>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_closest_point<class_AStar_method_get_closest_point>` **(** :ref:`Vector3<class_Vector3>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_closest_position_in_segment<class_AStar_method_get_closest_position_in_segment>` **(** :ref:`Vector3<class_Vector3>` to_position **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_id_path<class_AStar_method_get_id_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_capacity<class_AStar_method_get_point_capacity>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_point_connections<class_AStar_method_get_point_connections>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_count<class_AStar_method_get_point_count>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolVector3Array<class_PoolVector3Array>` | :ref:`get_point_path<class_AStar_method_get_point_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_point_position<class_AStar_method_get_point_position>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_point_weight_scale<class_AStar_method_get_point_weight_scale>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_points<class_AStar_method_get_points>` **(** **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_point<class_AStar_method_has_point>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_point_disabled<class_AStar_method_is_point_disabled>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_point<class_AStar_method_remove_point>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`reserve_space<class_AStar_method_reserve_space>` **(** :ref:`int<class_int>` num_nodes **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_disabled<class_AStar_method_set_point_disabled>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_position<class_AStar_method_set_point_position>` **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_weight_scale<class_AStar_method_set_point_weight_scale>` **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AStar_method__compute_cost:
- :ref:`float<class_float>` **_compute_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
.. rst-class:: classref-method
:ref:`float<class_float>` **_compute_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
Called when computing the cost between two connected points.
Note that this function is hidden in the default ``AStar`` class.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method__estimate_cost:
- :ref:`float<class_float>` **_estimate_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
.. rst-class:: classref-method
:ref:`float<class_float>` **_estimate_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
Called when estimating the cost between a point and the path's ending point.
Note that this function is hidden in the default ``AStar`` class.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_add_point:
- void **add_point** **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position, :ref:`float<class_float>` weight_scale=1.0 **)**
.. rst-class:: classref-method
void **add_point** **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position, :ref:`float<class_float>` weight_scale=1.0 **)**
Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 0.0 or greater.
@@ -131,27 +154,39 @@ The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost<class_AS
If there already exists a point for the given ``id``, its position and weight scale are updated to the given values.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_are_points_connected:
- :ref:`bool<class_bool>` **are_points_connected** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **are_points_connected** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const|
Returns whether the two given points are directly connected by a segment. If ``bidirectional`` is ``false``, returns whether movement from ``id`` to ``to_id`` is possible through this segment.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_clear:
- void **clear** **(** **)**
.. rst-class:: classref-method
void **clear** **(** **)**
Clears all the points and segments.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_connect_points:
- void **connect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
.. rst-class:: classref-method
void **connect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
Creates a segment between the given points. If ``bidirectional`` is ``false``, only movement from ``id`` to ``to_id`` is allowed, not the reverse direction.
@@ -162,37 +197,53 @@ Creates a segment between the given points. If ``bidirectional`` is ``false``, o
astar.add_point(2, Vector3(0, 5, 0))
astar.connect_points(1, 2, false)
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_disconnect_points:
- void **disconnect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
.. rst-class:: classref-method
void **disconnect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
Deletes the segment between the given points. If ``bidirectional`` is ``false``, only movement from ``id`` to ``to_id`` is prevented, and a unidirectional segment possibly remains.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_get_available_point_id:
- :ref:`int<class_int>` **get_available_point_id** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_available_point_id** **(** **)** |const|
Returns the next available point ID with no point associated to it.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_get_closest_point:
- :ref:`int<class_int>` **get_closest_point** **(** :ref:`Vector3<class_Vector3>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_closest_point** **(** :ref:`Vector3<class_Vector3>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const|
Returns the ID of the closest point to ``to_position``, optionally taking disabled points into account. Returns ``-1`` if there are no points in the points pool.
\ **Note:** If several points are the closest to ``to_position``, the one with the smallest ID will be returned, ensuring a deterministic result.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_get_closest_position_in_segment:
- :ref:`Vector3<class_Vector3>` **get_closest_position_in_segment** **(** :ref:`Vector3<class_Vector3>` to_position **)** |const|
.. rst-class:: classref-method
:ref:`Vector3<class_Vector3>` **get_closest_position_in_segment** **(** :ref:`Vector3<class_Vector3>` to_position **)** |const|
Returns the closest position to ``to_position`` that resides inside a segment between two connected points.
@@ -206,11 +257,15 @@ Returns the closest position to ``to_position`` that resides inside a segment be
The result is in the segment that goes from ``y = 0`` to ``y = 5``. It's the closest position in the segment to the given point.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_get_id_path:
- :ref:`PoolIntArray<class_PoolIntArray>` **get_id_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
.. rst-class:: classref-method
:ref:`PoolIntArray<class_PoolIntArray>` **get_id_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
Returns an array with the IDs of the points that form the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path.
@@ -231,19 +286,27 @@ Returns an array with the IDs of the points that form the path found by AStar be
If you change the 2nd point's weight to 3, then the result will be ``[1, 4, 3]`` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_get_point_capacity:
- :ref:`int<class_int>` **get_point_capacity** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_point_capacity** **(** **)** |const|
Returns the capacity of the structure backing the points, useful in conjunction with ``reserve_space``.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_get_point_connections:
- :ref:`PoolIntArray<class_PoolIntArray>` **get_point_connections** **(** :ref:`int<class_int>` id **)**
.. rst-class:: classref-method
:ref:`PoolIntArray<class_PoolIntArray>` **get_point_connections** **(** :ref:`int<class_int>` id **)**
Returns an array with the IDs of the points that form the connection with the given point.
@@ -260,104 +323,153 @@ Returns an array with the IDs of the points that form the connection with the gi
var neighbors = astar.get_point_connections(1) # Returns [2, 3]
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_get_point_count:
- :ref:`int<class_int>` **get_point_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_point_count** **(** **)** |const|
Returns the number of points currently in the points pool.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_get_point_path:
- :ref:`PoolVector3Array<class_PoolVector3Array>` **get_point_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
.. rst-class:: classref-method
:ref:`PoolVector3Array<class_PoolVector3Array>` **get_point_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
Returns an array with the points that are in the path found by AStar between the given points. The array is ordered from the starting point to the ending point of the path.
\ **Note:** This method is not thread-safe. If called from a :ref:`Thread<class_Thread>`, it will return an empty :ref:`PoolVector3Array<class_PoolVector3Array>` and will print an error message.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_get_point_position:
- :ref:`Vector3<class_Vector3>` **get_point_position** **(** :ref:`int<class_int>` id **)** |const|
.. rst-class:: classref-method
:ref:`Vector3<class_Vector3>` **get_point_position** **(** :ref:`int<class_int>` id **)** |const|
Returns the position of the point associated with the given ``id``.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_get_point_weight_scale:
- :ref:`float<class_float>` **get_point_weight_scale** **(** :ref:`int<class_int>` id **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_point_weight_scale** **(** :ref:`int<class_int>` id **)** |const|
Returns the weight scale of the point associated with the given ``id``.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_get_points:
- :ref:`Array<class_Array>` **get_points** **(** **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **get_points** **(** **)**
Returns an array of all points.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_has_point:
- :ref:`bool<class_bool>` **has_point** **(** :ref:`int<class_int>` id **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_point** **(** :ref:`int<class_int>` id **)** |const|
Returns whether a point associated with the given ``id`` exists.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_is_point_disabled:
- :ref:`bool<class_bool>` **is_point_disabled** **(** :ref:`int<class_int>` id **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_point_disabled** **(** :ref:`int<class_int>` id **)** |const|
Returns whether a point is disabled or not for pathfinding. By default, all points are enabled.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_remove_point:
- void **remove_point** **(** :ref:`int<class_int>` id **)**
.. rst-class:: classref-method
void **remove_point** **(** :ref:`int<class_int>` id **)**
Removes the point associated with the given ``id`` from the points pool.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_reserve_space:
- void **reserve_space** **(** :ref:`int<class_int>` num_nodes **)**
.. rst-class:: classref-method
void **reserve_space** **(** :ref:`int<class_int>` num_nodes **)**
Reserves space internally for ``num_nodes`` points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_set_point_disabled:
- void **set_point_disabled** **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)**
.. rst-class:: classref-method
void **set_point_disabled** **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)**
Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_set_point_position:
- void **set_point_position** **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position **)**
.. rst-class:: classref-method
void **set_point_position** **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position **)**
Sets the ``position`` for the point with the given ``id``.
.. rst-class:: classref-item-separator
----
.. _class_AStar_method_set_point_weight_scale:
- void **set_point_weight_scale** **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)**
.. rst-class:: classref-method
void **set_point_weight_scale** **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)**
Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost<class_AStar_method__compute_cost>` when determining the overall cost of traveling across a segment from a neighboring point to this point.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,92 +14,115 @@ AStar2D
AStar class representation that uses 2D vectors as edges.
.. rst-class:: classref-introduction-group
Description
-----------
This is a wrapper for the :ref:`AStar<class_AStar>` class which uses 2D vectors instead of 3D vectors.
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_compute_cost<class_AStar2D_method__compute_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStar2D_method__estimate_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_point<class_AStar2D_method_add_point>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position, :ref:`float<class_float>` weight_scale=1.0 **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`are_points_connected<class_AStar2D_method_are_points_connected>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_AStar2D_method_clear>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`connect_points<class_AStar2D_method_connect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`disconnect_points<class_AStar2D_method_disconnect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_available_point_id<class_AStar2D_method_get_available_point_id>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_closest_point<class_AStar2D_method_get_closest_point>` **(** :ref:`Vector2<class_Vector2>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_closest_position_in_segment<class_AStar2D_method_get_closest_position_in_segment>` **(** :ref:`Vector2<class_Vector2>` to_position **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_id_path<class_AStar2D_method_get_id_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_capacity<class_AStar2D_method_get_point_capacity>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_point_connections<class_AStar2D_method_get_point_connections>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_count<class_AStar2D_method_get_point_count>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`get_point_path<class_AStar2D_method_get_point_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_point_position<class_AStar2D_method_get_point_position>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_point_weight_scale<class_AStar2D_method_get_point_weight_scale>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_points<class_AStar2D_method_get_points>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_point<class_AStar2D_method_has_point>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_point_disabled<class_AStar2D_method_is_point_disabled>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_point<class_AStar2D_method_remove_point>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`reserve_space<class_AStar2D_method_reserve_space>` **(** :ref:`int<class_int>` num_nodes **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_disabled<class_AStar2D_method_set_point_disabled>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_position<class_AStar2D_method_set_point_position>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_weight_scale<class_AStar2D_method_set_point_weight_scale>` **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_compute_cost<class_AStar2D_method__compute_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStar2D_method__estimate_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_point<class_AStar2D_method_add_point>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position, :ref:`float<class_float>` weight_scale=1.0 **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`are_points_connected<class_AStar2D_method_are_points_connected>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_AStar2D_method_clear>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`connect_points<class_AStar2D_method_connect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`disconnect_points<class_AStar2D_method_disconnect_points>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_available_point_id<class_AStar2D_method_get_available_point_id>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_closest_point<class_AStar2D_method_get_closest_point>` **(** :ref:`Vector2<class_Vector2>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_closest_position_in_segment<class_AStar2D_method_get_closest_position_in_segment>` **(** :ref:`Vector2<class_Vector2>` to_position **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_id_path<class_AStar2D_method_get_id_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_capacity<class_AStar2D_method_get_point_capacity>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_point_connections<class_AStar2D_method_get_point_connections>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_count<class_AStar2D_method_get_point_count>` **(** **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`get_point_path<class_AStar2D_method_get_point_path>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_point_position<class_AStar2D_method_get_point_position>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_point_weight_scale<class_AStar2D_method_get_point_weight_scale>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_points<class_AStar2D_method_get_points>` **(** **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_point<class_AStar2D_method_has_point>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_point_disabled<class_AStar2D_method_is_point_disabled>` **(** :ref:`int<class_int>` id **)** |const| |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_point<class_AStar2D_method_remove_point>` **(** :ref:`int<class_int>` id **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`reserve_space<class_AStar2D_method_reserve_space>` **(** :ref:`int<class_int>` num_nodes **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_disabled<class_AStar2D_method_set_point_disabled>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_position<class_AStar2D_method_set_point_position>` **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_point_weight_scale<class_AStar2D_method_set_point_weight_scale>` **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)** |
+-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AStar2D_method__compute_cost:
- :ref:`float<class_float>` **_compute_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
.. rst-class:: classref-method
:ref:`float<class_float>` **_compute_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
Called when computing the cost between two connected points.
Note that this function is hidden in the default ``AStar2D`` class.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method__estimate_cost:
- :ref:`float<class_float>` **_estimate_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
.. rst-class:: classref-method
:ref:`float<class_float>` **_estimate_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual|
Called when estimating the cost between a point and the path's ending point.
Note that this function is hidden in the default ``AStar2D`` class.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_add_point:
- void **add_point** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position, :ref:`float<class_float>` weight_scale=1.0 **)**
.. rst-class:: classref-method
void **add_point** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position, :ref:`float<class_float>` weight_scale=1.0 **)**
Adds a new point at the given position with the given identifier. The ``id`` must be 0 or larger, and the ``weight_scale`` must be 0.0 or greater.
@@ -112,27 +135,39 @@ The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost<class_AS
If there already exists a point for the given ``id``, its position and weight scale are updated to the given values.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_are_points_connected:
- :ref:`bool<class_bool>` **are_points_connected** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **are_points_connected** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)** |const|
Returns whether there is a connection/segment between the given points. If ``bidirectional`` is ``false``, returns whether movement from ``id`` to ``to_id`` is possible through this segment.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_clear:
- void **clear** **(** **)**
.. rst-class:: classref-method
void **clear** **(** **)**
Clears all the points and segments.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_connect_points:
- void **connect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
.. rst-class:: classref-method
void **connect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
Creates a segment between the given points. If ``bidirectional`` is ``false``, only movement from ``id`` to ``to_id`` is allowed, not the reverse direction.
@@ -143,37 +178,53 @@ Creates a segment between the given points. If ``bidirectional`` is ``false``, o
astar.add_point(2, Vector2(0, 5))
astar.connect_points(1, 2, false)
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_disconnect_points:
- void **disconnect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
.. rst-class:: classref-method
void **disconnect_points** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` to_id, :ref:`bool<class_bool>` bidirectional=true **)**
Deletes the segment between the given points. If ``bidirectional`` is ``false``, only movement from ``id`` to ``to_id`` is prevented, and a unidirectional segment possibly remains.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_get_available_point_id:
- :ref:`int<class_int>` **get_available_point_id** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_available_point_id** **(** **)** |const|
Returns the next available point ID with no point associated to it.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_get_closest_point:
- :ref:`int<class_int>` **get_closest_point** **(** :ref:`Vector2<class_Vector2>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_closest_point** **(** :ref:`Vector2<class_Vector2>` to_position, :ref:`bool<class_bool>` include_disabled=false **)** |const|
Returns the ID of the closest point to ``to_position``, optionally taking disabled points into account. Returns ``-1`` if there are no points in the points pool.
\ **Note:** If several points are the closest to ``to_position``, the one with the smallest ID will be returned, ensuring a deterministic result.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_get_closest_position_in_segment:
- :ref:`Vector2<class_Vector2>` **get_closest_position_in_segment** **(** :ref:`Vector2<class_Vector2>` to_position **)** |const|
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_closest_position_in_segment** **(** :ref:`Vector2<class_Vector2>` to_position **)** |const|
Returns the closest position to ``to_position`` that resides inside a segment between two connected points.
@@ -187,11 +238,15 @@ Returns the closest position to ``to_position`` that resides inside a segment be
The result is in the segment that goes from ``y = 0`` to ``y = 5``. It's the closest position in the segment to the given point.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_get_id_path:
- :ref:`PoolIntArray<class_PoolIntArray>` **get_id_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
.. rst-class:: classref-method
:ref:`PoolIntArray<class_PoolIntArray>` **get_id_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.
@@ -212,19 +267,27 @@ Returns an array with the IDs of the points that form the path found by AStar2D
If you change the 2nd point's weight to 3, then the result will be ``[1, 4, 3]`` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_get_point_capacity:
- :ref:`int<class_int>` **get_point_capacity** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_point_capacity** **(** **)** |const|
Returns the capacity of the structure backing the points, useful in conjunction with ``reserve_space``.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_get_point_connections:
- :ref:`PoolIntArray<class_PoolIntArray>` **get_point_connections** **(** :ref:`int<class_int>` id **)**
.. rst-class:: classref-method
:ref:`PoolIntArray<class_PoolIntArray>` **get_point_connections** **(** :ref:`int<class_int>` id **)**
Returns an array with the IDs of the points that form the connection with the given point.
@@ -241,104 +304,153 @@ Returns an array with the IDs of the points that form the connection with the gi
var neighbors = astar.get_point_connections(1) # Returns [2, 3]
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_get_point_count:
- :ref:`int<class_int>` **get_point_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_point_count** **(** **)** |const|
Returns the number of points currently in the points pool.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_get_point_path:
- :ref:`PoolVector2Array<class_PoolVector2Array>` **get_point_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
.. rst-class:: classref-method
:ref:`PoolVector2Array<class_PoolVector2Array>` **get_point_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
Returns an array with the points that are in the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path.
\ **Note:** This method is not thread-safe. If called from a :ref:`Thread<class_Thread>`, it will return an empty :ref:`PoolVector2Array<class_PoolVector2Array>` and will print an error message.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_get_point_position:
- :ref:`Vector2<class_Vector2>` **get_point_position** **(** :ref:`int<class_int>` id **)** |const|
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_point_position** **(** :ref:`int<class_int>` id **)** |const|
Returns the position of the point associated with the given ``id``.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_get_point_weight_scale:
- :ref:`float<class_float>` **get_point_weight_scale** **(** :ref:`int<class_int>` id **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_point_weight_scale** **(** :ref:`int<class_int>` id **)** |const|
Returns the weight scale of the point associated with the given ``id``.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_get_points:
- :ref:`Array<class_Array>` **get_points** **(** **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **get_points** **(** **)**
Returns an array of all points.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_has_point:
- :ref:`bool<class_bool>` **has_point** **(** :ref:`int<class_int>` id **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_point** **(** :ref:`int<class_int>` id **)** |const|
Returns whether a point associated with the given ``id`` exists.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_is_point_disabled:
- :ref:`bool<class_bool>` **is_point_disabled** **(** :ref:`int<class_int>` id **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_point_disabled** **(** :ref:`int<class_int>` id **)** |const|
Returns whether a point is disabled or not for pathfinding. By default, all points are enabled.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_remove_point:
- void **remove_point** **(** :ref:`int<class_int>` id **)**
.. rst-class:: classref-method
void **remove_point** **(** :ref:`int<class_int>` id **)**
Removes the point associated with the given ``id`` from the points pool.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_reserve_space:
- void **reserve_space** **(** :ref:`int<class_int>` num_nodes **)**
.. rst-class:: classref-method
void **reserve_space** **(** :ref:`int<class_int>` num_nodes **)**
Reserves space internally for ``num_nodes`` points, useful if you're adding a known large number of points at once, for a grid for instance. New capacity must be greater or equals to old capacity.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_set_point_disabled:
- void **set_point_disabled** **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)**
.. rst-class:: classref-method
void **set_point_disabled** **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)**
Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_set_point_position:
- void **set_point_position** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position **)**
.. rst-class:: classref-method
void **set_point_position** **(** :ref:`int<class_int>` id, :ref:`Vector2<class_Vector2>` position **)**
Sets the ``position`` for the point with the given ``id``.
.. rst-class:: classref-item-separator
----
.. _class_AStar2D_method_set_point_weight_scale:
- void **set_point_weight_scale** **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)**
.. rst-class:: classref-method
void **set_point_weight_scale** **(** :ref:`int<class_int>` id, :ref:`float<class_float>` weight_scale **)**
Sets the ``weight_scale`` for the point with the given ``id``. The ``weight_scale`` is multiplied by the result of :ref:`_compute_cost<class_AStar2D_method__compute_cost>` when determining the overall cost of traveling across a segment from a neighboring point to this point.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,93 +14,111 @@ AtlasTexture
Crops out one part of a texture, such as a texture from a texture atlas.
.. rst-class:: classref-introduction-group
Description
-----------
:ref:`Texture<class_Texture>` resource that crops out one part of the :ref:`atlas<class_AtlasTexture_property_atlas>` texture, defined by :ref:`region<class_AtlasTexture_property_region>`. The main use case is cropping out textures from a texture atlas, which is a big texture file that packs multiple smaller textures. Consists of a :ref:`Texture<class_Texture>` for the :ref:`atlas<class_AtlasTexture_property_atlas>`, a :ref:`region<class_AtlasTexture_property_region>` that defines the area of :ref:`atlas<class_AtlasTexture_property_atlas>` to use, and a :ref:`margin<class_AtlasTexture_property_margin>` that defines the border width.
\ ``AtlasTexture`` cannot be used in an :ref:`AnimatedTexture<class_AnimatedTexture>`, cannot be tiled in nodes such as :ref:`TextureRect<class_TextureRect>`, and does not work properly if used inside of other ``AtlasTexture`` resources. Multiple ``AtlasTexture`` resources can be used to crop multiple textures from the atlas. Using a texture atlas helps to optimize video memory costs and render calls compared to using multiple small files.
\ **AtlasTexture** cannot be used in an :ref:`AnimatedTexture<class_AnimatedTexture>`, cannot be tiled in nodes such as :ref:`TextureRect<class_TextureRect>`, and does not work properly if used inside of other **AtlasTexture** resources. Multiple **AtlasTexture** resources can be used to crop multiple textures from the atlas. Using a texture atlas helps to optimize video memory costs and render calls compared to using multiple small files.
\ **Note:** AtlasTextures don't support repetition. The :ref:`Texture.FLAG_REPEAT<class_Texture_constant_FLAG_REPEAT>` and :ref:`Texture.FLAG_MIRRORED_REPEAT<class_Texture_constant_FLAG_MIRRORED_REPEAT>` flags are ignored when using an AtlasTexture.
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`Texture<class_Texture>` | :ref:`atlas<class_AtlasTexture_property_atlas>` | |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`filter_clip<class_AtlasTexture_property_filter_clip>` | ``false`` |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | flags | ``0`` (overrides :ref:`Texture<class_Texture_property_flags>`) |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`Rect2<class_Rect2>` | :ref:`margin<class_AtlasTexture_property_margin>` | ``Rect2( 0, 0, 0, 0 )`` |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`Rect2<class_Rect2>` | :ref:`region<class_AtlasTexture_property_region>` | ``Rect2( 0, 0, 0, 0 )`` |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`Texture<class_Texture>` | :ref:`atlas<class_AtlasTexture_property_atlas>` | |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`filter_clip<class_AtlasTexture_property_filter_clip>` | ``false`` |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`int<class_int>` | flags | ``0`` (overrides :ref:`Texture<class_Texture_property_flags>`) |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`Rect2<class_Rect2>` | :ref:`margin<class_AtlasTexture_property_margin>` | ``Rect2( 0, 0, 0, 0 )`` |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
| :ref:`Rect2<class_Rect2>` | :ref:`region<class_AtlasTexture_property_region>` | ``Rect2( 0, 0, 0, 0 )`` |
+-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AtlasTexture_property_atlas:
- :ref:`Texture<class_Texture>` **atlas**
.. rst-class:: classref-property
+----------+------------------+
| *Setter* | set_atlas(value) |
+----------+------------------+
| *Getter* | get_atlas() |
+----------+------------------+
:ref:`Texture<class_Texture>` **atlas**
.. rst-class:: classref-property-setget
- void **set_atlas** **(** :ref:`Texture<class_Texture>` value **)**
- :ref:`Texture<class_Texture>` **get_atlas** **(** **)**
The texture that contains the atlas. Can be any :ref:`Texture<class_Texture>` subtype.
.. rst-class:: classref-item-separator
----
.. _class_AtlasTexture_property_filter_clip:
- :ref:`bool<class_bool>` **filter_clip**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``false`` |
+-----------+------------------------+
| *Setter* | set_filter_clip(value) |
+-----------+------------------------+
| *Getter* | has_filter_clip() |
+-----------+------------------------+
:ref:`bool<class_bool>` **filter_clip** = ``false``
.. rst-class:: classref-property-setget
- void **set_filter_clip** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **has_filter_clip** **(** **)**
If ``true``, clips the area outside of the region to avoid bleeding of the surrounding texture pixels.
.. rst-class:: classref-item-separator
----
.. _class_AtlasTexture_property_margin:
- :ref:`Rect2<class_Rect2>` **margin**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``Rect2( 0, 0, 0, 0 )`` |
+-----------+-------------------------+
| *Setter* | set_margin(value) |
+-----------+-------------------------+
| *Getter* | get_margin() |
+-----------+-------------------------+
:ref:`Rect2<class_Rect2>` **margin** = ``Rect2( 0, 0, 0, 0 )``
.. rst-class:: classref-property-setget
- void **set_margin** **(** :ref:`Rect2<class_Rect2>` value **)**
- :ref:`Rect2<class_Rect2>` **get_margin** **(** **)**
The margin around the region. The :ref:`Rect2<class_Rect2>`'s :ref:`Rect2.size<class_Rect2_property_size>` parameter ("w" and "h" in the editor) resizes the texture so it fits within the margin.
.. rst-class:: classref-item-separator
----
.. _class_AtlasTexture_property_region:
- :ref:`Rect2<class_Rect2>` **region**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``Rect2( 0, 0, 0, 0 )`` |
+-----------+-------------------------+
| *Setter* | set_region(value) |
+-----------+-------------------------+
| *Getter* | get_region() |
+-----------+-------------------------+
:ref:`Rect2<class_Rect2>` **region** = ``Rect2( 0, 0, 0, 0 )``
.. rst-class:: classref-property-setget
- void **set_region** **(** :ref:`Rect2<class_Rect2>` value **)**
- :ref:`Rect2<class_Rect2>` **get_region** **(** **)**
The AtlasTexture's used region.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioBusLayout
Stores information about the audio buses.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -22,3 +24,4 @@ Stores position, muting, solo, bypass, effects, effect position, volume, and the
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,11 +16,15 @@ AudioEffect
Audio effect for audio.
.. rst-class:: classref-introduction-group
Description
-----------
Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -29,3 +33,4 @@ Tutorials
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,35 +16,48 @@ Adds an amplifying audio effect to an audio bus.
Increases or decreases the volume of the selected audio bus.
.. rst-class:: classref-introduction-group
Description
-----------
Increases or decreases the volume being routed through the audio bus.
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+---------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioEffectAmplify_property_volume_db>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------+---------+
.. table::
:widths: auto
+---------------------------+---------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioEffectAmplify_property_volume_db>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------+---------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectAmplify_property_volume_db:
- :ref:`float<class_float>` **volume_db**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``0.0`` |
+-----------+----------------------+
| *Setter* | set_volume_db(value) |
+-----------+----------------------+
| *Getter* | get_volume_db() |
+-----------+----------------------+
:ref:`float<class_float>` **volume_db** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_volume_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_volume_db** **(** **)**
Amount of amplification in decibels. Positive values make the sound louder, negative values make it quieter. Value can range from -80 to 24.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioEffectBandLimitFilter
Adds a band limit filter to the audio bus.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -22,3 +24,4 @@ Limits the frequencies in a range around the :ref:`AudioEffectFilter.cutoff_hz<c
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioEffectBandPassFilter
Adds a band pass filter to the audio bus.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -22,3 +24,4 @@ Attenuates the frequencies inside of a range around the :ref:`AudioEffectFilter.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioEffectCapture
Captures audio from an audio bus in real-time.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,6 +25,8 @@ Application code should consume these audio frames from this ring buffer using :
\ **Note:** :ref:`ProjectSettings.audio/enable_audio_input<class_ProjectSettings_property_audio/enable_audio_input>` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -30,108 +34,156 @@ Tutorials
- `Audio Mic Record Demo <https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record>`__
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+-----------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`buffer_length<class_AudioEffectCapture_property_buffer_length>` | ``0.1`` |
+---------------------------+-----------------------------------------------------------------------+---------+
.. table::
:widths: auto
+---------------------------+-----------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`buffer_length<class_AudioEffectCapture_property_buffer_length>` | ``0.1`` |
+---------------------------+-----------------------------------------------------------------------+---------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`can_get_buffer<class_AudioEffectCapture_method_can_get_buffer>` **(** :ref:`int<class_int>` frames **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_buffer<class_AudioEffectCapture_method_clear_buffer>` **(** **)** |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`get_buffer<class_AudioEffectCapture_method_get_buffer>` **(** :ref:`int<class_int>` frames **)** |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_buffer_length_frames<class_AudioEffectCapture_method_get_buffer_length_frames>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_discarded_frames<class_AudioEffectCapture_method_get_discarded_frames>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_frames_available<class_AudioEffectCapture_method_get_frames_available>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_pushed_frames<class_AudioEffectCapture_method_get_pushed_frames>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`can_get_buffer<class_AudioEffectCapture_method_can_get_buffer>` **(** :ref:`int<class_int>` frames **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_buffer<class_AudioEffectCapture_method_clear_buffer>` **(** **)** |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`get_buffer<class_AudioEffectCapture_method_get_buffer>` **(** :ref:`int<class_int>` frames **)** |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_buffer_length_frames<class_AudioEffectCapture_method_get_buffer_length_frames>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_discarded_frames<class_AudioEffectCapture_method_get_discarded_frames>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_frames_available<class_AudioEffectCapture_method_get_frames_available>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_pushed_frames<class_AudioEffectCapture_method_get_pushed_frames>` **(** **)** |const| |
+-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectCapture_property_buffer_length:
- :ref:`float<class_float>` **buffer_length**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``0.1`` |
+-----------+--------------------------+
| *Setter* | set_buffer_length(value) |
+-----------+--------------------------+
| *Getter* | get_buffer_length() |
+-----------+--------------------------+
:ref:`float<class_float>` **buffer_length** = ``0.1``
.. rst-class:: classref-property-setget
- void **set_buffer_length** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_buffer_length** **(** **)**
Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect if already initialized.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AudioEffectCapture_method_can_get_buffer:
- :ref:`bool<class_bool>` **can_get_buffer** **(** :ref:`int<class_int>` frames **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **can_get_buffer** **(** :ref:`int<class_int>` frames **)** |const|
Returns ``true`` if at least ``frames`` audio frames are available to read in the internal ring buffer.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCapture_method_clear_buffer:
- void **clear_buffer** **(** **)**
.. rst-class:: classref-method
void **clear_buffer** **(** **)**
Clears the internal ring buffer.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCapture_method_get_buffer:
- :ref:`PoolVector2Array<class_PoolVector2Array>` **get_buffer** **(** :ref:`int<class_int>` frames **)**
.. rst-class:: classref-method
:ref:`PoolVector2Array<class_PoolVector2Array>` **get_buffer** **(** :ref:`int<class_int>` frames **)**
Gets the next ``frames`` audio samples from the internal ring buffer.
Returns a :ref:`PoolVector2Array<class_PoolVector2Array>` containing exactly ``frames`` audio samples if available, or an empty :ref:`PoolVector2Array<class_PoolVector2Array>` if insufficient data was available.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCapture_method_get_buffer_length_frames:
- :ref:`int<class_int>` **get_buffer_length_frames** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_buffer_length_frames** **(** **)** |const|
Returns the total size of the internal ring buffer in frames.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCapture_method_get_discarded_frames:
- :ref:`int<class_int>` **get_discarded_frames** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_discarded_frames** **(** **)** |const|
Returns the number of audio frames discarded from the audio bus due to full buffer.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCapture_method_get_frames_available:
- :ref:`int<class_int>` **get_frames_available** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_frames_available** **(** **)** |const|
Returns the number of frames available to read using :ref:`get_buffer<class_AudioEffectCapture_method_get_buffer>`.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCapture_method_get_pushed_frames:
- :ref:`int<class_int>` **get_pushed_frames** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_pushed_frames** **(** **)** |const|
Returns the number of audio frames inserted from the audio bus.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

File diff suppressed because it is too large Load Diff

View File

@@ -16,6 +16,8 @@ Adds a compressor audio effect to an audio bus.
Reduces sounds that exceed a certain threshold level, smooths out the dynamics and increases the overall volume.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -31,138 +33,155 @@ Compressor has many uses in the mix:
- Accentuates transients by using a wider attack, making effects sound more punchy.
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`attack_us<class_AudioEffectCompressor_property_attack_us>` | ``20.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`gain<class_AudioEffectCompressor_property_gain>` | ``0.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`mix<class_AudioEffectCompressor_property_mix>` | ``1.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`ratio<class_AudioEffectCompressor_property_ratio>` | ``4.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`release_ms<class_AudioEffectCompressor_property_release_ms>` | ``250.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`String<class_String>` | :ref:`sidechain<class_AudioEffectCompressor_property_sidechain>` | ``""`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`threshold<class_AudioEffectCompressor_property_threshold>` | ``0.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
.. table::
:widths: auto
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`attack_us<class_AudioEffectCompressor_property_attack_us>` | ``20.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`gain<class_AudioEffectCompressor_property_gain>` | ``0.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`mix<class_AudioEffectCompressor_property_mix>` | ``1.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`ratio<class_AudioEffectCompressor_property_ratio>` | ``4.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`release_ms<class_AudioEffectCompressor_property_release_ms>` | ``250.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`String<class_String>` | :ref:`sidechain<class_AudioEffectCompressor_property_sidechain>` | ``""`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`threshold<class_AudioEffectCompressor_property_threshold>` | ``0.0`` |
+-----------------------------+--------------------------------------------------------------------+-----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectCompressor_property_attack_us:
- :ref:`float<class_float>` **attack_us**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``20.0`` |
+-----------+----------------------+
| *Setter* | set_attack_us(value) |
+-----------+----------------------+
| *Getter* | get_attack_us() |
+-----------+----------------------+
:ref:`float<class_float>` **attack_us** = ``20.0``
.. rst-class:: classref-property-setget
- void **set_attack_us** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_attack_us** **(** **)**
Compressor's reaction time when the signal exceeds the threshold, in microseconds. Value can range from 20 to 2000.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCompressor_property_gain:
- :ref:`float<class_float>` **gain**
.. rst-class:: classref-property
+-----------+-----------------+
| *Default* | ``0.0`` |
+-----------+-----------------+
| *Setter* | set_gain(value) |
+-----------+-----------------+
| *Getter* | get_gain() |
+-----------+-----------------+
:ref:`float<class_float>` **gain** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_gain** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_gain** **(** **)**
Gain applied to the output signal.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCompressor_property_mix:
- :ref:`float<class_float>` **mix**
.. rst-class:: classref-property
+-----------+----------------+
| *Default* | ``1.0`` |
+-----------+----------------+
| *Setter* | set_mix(value) |
+-----------+----------------+
| *Getter* | get_mix() |
+-----------+----------------+
:ref:`float<class_float>` **mix** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_mix** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_mix** **(** **)**
Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet).
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCompressor_property_ratio:
- :ref:`float<class_float>` **ratio**
.. rst-class:: classref-property
+-----------+------------------+
| *Default* | ``4.0`` |
+-----------+------------------+
| *Setter* | set_ratio(value) |
+-----------+------------------+
| *Getter* | get_ratio() |
+-----------+------------------+
:ref:`float<class_float>` **ratio** = ``4.0``
.. rst-class:: classref-property-setget
- void **set_ratio** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_ratio** **(** **)**
Amount of compression applied to the audio once it passes the threshold level. The higher the ratio, the more the loud parts of the audio will be compressed. Value can range from 1 to 48.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCompressor_property_release_ms:
- :ref:`float<class_float>` **release_ms**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``250.0`` |
+-----------+-----------------------+
| *Setter* | set_release_ms(value) |
+-----------+-----------------------+
| *Getter* | get_release_ms() |
+-----------+-----------------------+
:ref:`float<class_float>` **release_ms** = ``250.0``
.. rst-class:: classref-property-setget
- void **set_release_ms** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_release_ms** **(** **)**
Compressor's delay time to stop reducing the signal after the signal level falls below the threshold, in milliseconds. Value can range from 20 to 2000.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCompressor_property_sidechain:
- :ref:`String<class_String>` **sidechain**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``""`` |
+-----------+----------------------+
| *Setter* | set_sidechain(value) |
+-----------+----------------------+
| *Getter* | get_sidechain() |
+-----------+----------------------+
:ref:`String<class_String>` **sidechain** = ``""``
.. rst-class:: classref-property-setget
- void **set_sidechain** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_sidechain** **(** **)**
Reduce the sound level using another audio bus for threshold detection.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectCompressor_property_threshold:
- :ref:`float<class_float>` **threshold**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``0.0`` |
+-----------+----------------------+
| *Setter* | set_threshold(value) |
+-----------+----------------------+
| *Getter* | get_threshold() |
+-----------+----------------------+
:ref:`float<class_float>` **threshold** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_threshold** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_threshold** **(** **)**
The level above which compression is applied to the audio. Value can range from -60 to 0.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,251 +16,276 @@ Adds a delay audio effect to an audio bus. Plays input signal back after a perio
Two tap delay and feedback options.
.. rst-class:: classref-introduction-group
Description
-----------
Plays input signal back after a period of time. The delayed signal may be played back multiple times to create the sound of a repeating, decaying echo. Delay effects range from a subtle echo effect to a pronounced blending of previous sounds with new sounds.
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`dry<class_AudioEffectDelay_property_dry>` | ``1.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`bool<class_bool>` | :ref:`feedback/active<class_AudioEffectDelay_property_feedback/active>` | ``false`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`feedback/delay_ms<class_AudioEffectDelay_property_feedback/delay_ms>` | ``340.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`feedback/level_db<class_AudioEffectDelay_property_feedback/level_db>` | ``-6.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`feedback/lowpass<class_AudioEffectDelay_property_feedback/lowpass>` | ``16000.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`bool<class_bool>` | :ref:`tap1/active<class_AudioEffectDelay_property_tap1/active>` | ``true`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap1/delay_ms<class_AudioEffectDelay_property_tap1/delay_ms>` | ``250.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap1/level_db<class_AudioEffectDelay_property_tap1/level_db>` | ``-6.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap1/pan<class_AudioEffectDelay_property_tap1/pan>` | ``0.2`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`bool<class_bool>` | :ref:`tap2/active<class_AudioEffectDelay_property_tap2/active>` | ``true`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap2/delay_ms<class_AudioEffectDelay_property_tap2/delay_ms>` | ``500.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap2/level_db<class_AudioEffectDelay_property_tap2/level_db>` | ``-12.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap2/pan<class_AudioEffectDelay_property_tap2/pan>` | ``-0.4`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
.. table::
:widths: auto
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`dry<class_AudioEffectDelay_property_dry>` | ``1.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`bool<class_bool>` | :ref:`feedback/active<class_AudioEffectDelay_property_feedback/active>` | ``false`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`feedback/delay_ms<class_AudioEffectDelay_property_feedback/delay_ms>` | ``340.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`feedback/level_db<class_AudioEffectDelay_property_feedback/level_db>` | ``-6.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`feedback/lowpass<class_AudioEffectDelay_property_feedback/lowpass>` | ``16000.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`bool<class_bool>` | :ref:`tap1/active<class_AudioEffectDelay_property_tap1/active>` | ``true`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap1/delay_ms<class_AudioEffectDelay_property_tap1/delay_ms>` | ``250.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap1/level_db<class_AudioEffectDelay_property_tap1/level_db>` | ``-6.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap1/pan<class_AudioEffectDelay_property_tap1/pan>` | ``0.2`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`bool<class_bool>` | :ref:`tap2/active<class_AudioEffectDelay_property_tap2/active>` | ``true`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap2/delay_ms<class_AudioEffectDelay_property_tap2/delay_ms>` | ``500.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap2/level_db<class_AudioEffectDelay_property_tap2/level_db>` | ``-12.0`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`tap2/pan<class_AudioEffectDelay_property_tap2/pan>` | ``-0.4`` |
+---------------------------+-----------------------------------------------------------------------------+-------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectDelay_property_dry:
- :ref:`float<class_float>` **dry**
.. rst-class:: classref-property
+-----------+----------------+
| *Default* | ``1.0`` |
+-----------+----------------+
| *Setter* | set_dry(value) |
+-----------+----------------+
| *Getter* | get_dry() |
+-----------+----------------+
:ref:`float<class_float>` **dry** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_dry** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_dry** **(** **)**
Output percent of original sound. At 0, only delayed sounds are output. Value can range from 0 to 1.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_feedback/active:
- :ref:`bool<class_bool>` **feedback/active**
.. rst-class:: classref-property
+-----------+----------------------------+
| *Default* | ``false`` |
+-----------+----------------------------+
| *Setter* | set_feedback_active(value) |
+-----------+----------------------------+
| *Getter* | is_feedback_active() |
+-----------+----------------------------+
:ref:`bool<class_bool>` **feedback/active** = ``false``
.. rst-class:: classref-property-setget
- void **set_feedback_active** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_feedback_active** **(** **)**
If ``true``, feedback is enabled.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_feedback/delay_ms:
- :ref:`float<class_float>` **feedback/delay_ms**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``340.0`` |
+-----------+------------------------------+
| *Setter* | set_feedback_delay_ms(value) |
+-----------+------------------------------+
| *Getter* | get_feedback_delay_ms() |
+-----------+------------------------------+
:ref:`float<class_float>` **feedback/delay_ms** = ``340.0``
.. rst-class:: classref-property-setget
- void **set_feedback_delay_ms** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_feedback_delay_ms** **(** **)**
Feedback delay time in milliseconds.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_feedback/level_db:
- :ref:`float<class_float>` **feedback/level_db**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``-6.0`` |
+-----------+------------------------------+
| *Setter* | set_feedback_level_db(value) |
+-----------+------------------------------+
| *Getter* | get_feedback_level_db() |
+-----------+------------------------------+
:ref:`float<class_float>` **feedback/level_db** = ``-6.0``
.. rst-class:: classref-property-setget
- void **set_feedback_level_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_feedback_level_db** **(** **)**
Sound level for ``tap1``.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_feedback/lowpass:
- :ref:`float<class_float>` **feedback/lowpass**
.. rst-class:: classref-property
+-----------+-----------------------------+
| *Default* | ``16000.0`` |
+-----------+-----------------------------+
| *Setter* | set_feedback_lowpass(value) |
+-----------+-----------------------------+
| *Getter* | get_feedback_lowpass() |
+-----------+-----------------------------+
:ref:`float<class_float>` **feedback/lowpass** = ``16000.0``
.. rst-class:: classref-property-setget
- void **set_feedback_lowpass** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_feedback_lowpass** **(** **)**
Low-pass filter for feedback, in Hz. Frequencies below this value are filtered out of the source signal.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_tap1/active:
- :ref:`bool<class_bool>` **tap1/active**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``true`` |
+-----------+------------------------+
| *Setter* | set_tap1_active(value) |
+-----------+------------------------+
| *Getter* | is_tap1_active() |
+-----------+------------------------+
:ref:`bool<class_bool>` **tap1/active** = ``true``
.. rst-class:: classref-property-setget
- void **set_tap1_active** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_tap1_active** **(** **)**
If ``true``, ``tap1`` will be enabled.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_tap1/delay_ms:
- :ref:`float<class_float>` **tap1/delay_ms**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``250.0`` |
+-----------+--------------------------+
| *Setter* | set_tap1_delay_ms(value) |
+-----------+--------------------------+
| *Getter* | get_tap1_delay_ms() |
+-----------+--------------------------+
:ref:`float<class_float>` **tap1/delay_ms** = ``250.0``
.. rst-class:: classref-property-setget
- void **set_tap1_delay_ms** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_tap1_delay_ms** **(** **)**
``tap1`` delay time in milliseconds.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_tap1/level_db:
- :ref:`float<class_float>` **tap1/level_db**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``-6.0`` |
+-----------+--------------------------+
| *Setter* | set_tap1_level_db(value) |
+-----------+--------------------------+
| *Getter* | get_tap1_level_db() |
+-----------+--------------------------+
:ref:`float<class_float>` **tap1/level_db** = ``-6.0``
.. rst-class:: classref-property-setget
- void **set_tap1_level_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_tap1_level_db** **(** **)**
Sound level for ``tap1``.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_tap1/pan:
- :ref:`float<class_float>` **tap1/pan**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``0.2`` |
+-----------+---------------------+
| *Setter* | set_tap1_pan(value) |
+-----------+---------------------+
| *Getter* | get_tap1_pan() |
+-----------+---------------------+
:ref:`float<class_float>` **tap1/pan** = ``0.2``
.. rst-class:: classref-property-setget
- void **set_tap1_pan** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_tap1_pan** **(** **)**
Pan position for ``tap1``. Value can range from -1 (fully left) to 1 (fully right).
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_tap2/active:
- :ref:`bool<class_bool>` **tap2/active**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``true`` |
+-----------+------------------------+
| *Setter* | set_tap2_active(value) |
+-----------+------------------------+
| *Getter* | is_tap2_active() |
+-----------+------------------------+
:ref:`bool<class_bool>` **tap2/active** = ``true``
.. rst-class:: classref-property-setget
- void **set_tap2_active** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_tap2_active** **(** **)**
If ``true``, ``tap2`` will be enabled.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_tap2/delay_ms:
- :ref:`float<class_float>` **tap2/delay_ms**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``500.0`` |
+-----------+--------------------------+
| *Setter* | set_tap2_delay_ms(value) |
+-----------+--------------------------+
| *Getter* | get_tap2_delay_ms() |
+-----------+--------------------------+
:ref:`float<class_float>` **tap2/delay_ms** = ``500.0``
.. rst-class:: classref-property-setget
- void **set_tap2_delay_ms** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_tap2_delay_ms** **(** **)**
**Tap2** delay time in milliseconds.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_tap2/level_db:
- :ref:`float<class_float>` **tap2/level_db**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``-12.0`` |
+-----------+--------------------------+
| *Setter* | set_tap2_level_db(value) |
+-----------+--------------------------+
| *Getter* | get_tap2_level_db() |
+-----------+--------------------------+
:ref:`float<class_float>` **tap2/level_db** = ``-12.0``
.. rst-class:: classref-property-setget
- void **set_tap2_level_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_tap2_level_db** **(** **)**
Sound level for ``tap2``.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDelay_property_tap2/pan:
- :ref:`float<class_float>` **tap2/pan**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``-0.4`` |
+-----------+---------------------+
| *Setter* | set_tap2_pan(value) |
+-----------+---------------------+
| *Getter* | get_tap2_pan() |
+-----------+---------------------+
:ref:`float<class_float>` **tap2/pan** = ``-0.4``
.. rst-class:: classref-property-setget
- void **set_tap2_pan** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_tap2_pan** **(** **)**
Pan position for ``tap2``. Value can range from -1 (fully left) to 1 (fully right).
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,6 +16,8 @@ Adds a distortion audio effect to an Audio bus.
Modify the sound to make it distorted.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,134 +25,179 @@ Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or wa
By distorting the waveform the frequency content change, which will often make the sound "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or speaker very efficiently.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
.. rst-class:: classref-reftable-group
Properties
----------
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`drive<class_AudioEffectDistortion_property_drive>` | ``0.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`keep_hf_hz<class_AudioEffectDistortion_property_keep_hf_hz>` | ``16000.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`Mode<enum_AudioEffectDistortion_Mode>` | :ref:`mode<class_AudioEffectDistortion_property_mode>` | ``0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`post_gain<class_AudioEffectDistortion_property_post_gain>` | ``0.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`pre_gain<class_AudioEffectDistortion_property_pre_gain>` | ``0.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
.. table::
:widths: auto
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`drive<class_AudioEffectDistortion_property_drive>` | ``0.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`keep_hf_hz<class_AudioEffectDistortion_property_keep_hf_hz>` | ``16000.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`Mode<enum_AudioEffectDistortion_Mode>` | :ref:`mode<class_AudioEffectDistortion_property_mode>` | ``0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`post_gain<class_AudioEffectDistortion_property_post_gain>` | ``0.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`pre_gain<class_AudioEffectDistortion_property_pre_gain>` | ``0.0`` |
+----------------------------------------------+--------------------------------------------------------------------+-------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AudioEffectDistortion_Mode:
.. _class_AudioEffectDistortion_constant_MODE_CLIP:
.. _class_AudioEffectDistortion_constant_MODE_ATAN:
.. _class_AudioEffectDistortion_constant_MODE_LOFI:
.. _class_AudioEffectDistortion_constant_MODE_OVERDRIVE:
.. _class_AudioEffectDistortion_constant_MODE_WAVESHAPE:
.. rst-class:: classref-enumeration
enum **Mode**:
- **MODE_CLIP** = **0** --- Digital distortion effect which cuts off peaks at the top and bottom of the waveform.
.. _class_AudioEffectDistortion_constant_MODE_CLIP:
- **MODE_ATAN** = **1**
.. rst-class:: classref-enumeration-constant
- **MODE_LOFI** = **2** --- Low-resolution digital distortion effect. You can use it to emulate the sound of early digital audio devices.
:ref:`Mode<enum_AudioEffectDistortion_Mode>` **MODE_CLIP** = ``0``
- **MODE_OVERDRIVE** = **3** --- Emulates the warm distortion produced by a field effect transistor, which is commonly used in solid-state musical instrument amplifiers.
Digital distortion effect which cuts off peaks at the top and bottom of the waveform.
- **MODE_WAVESHAPE** = **4** --- Waveshaper distortions are used mainly by electronic musicians to achieve an extra-abrasive sound.
.. _class_AudioEffectDistortion_constant_MODE_ATAN:
.. rst-class:: classref-enumeration-constant
:ref:`Mode<enum_AudioEffectDistortion_Mode>` **MODE_ATAN** = ``1``
.. _class_AudioEffectDistortion_constant_MODE_LOFI:
.. rst-class:: classref-enumeration-constant
:ref:`Mode<enum_AudioEffectDistortion_Mode>` **MODE_LOFI** = ``2``
Low-resolution digital distortion effect. You can use it to emulate the sound of early digital audio devices.
.. _class_AudioEffectDistortion_constant_MODE_OVERDRIVE:
.. rst-class:: classref-enumeration-constant
:ref:`Mode<enum_AudioEffectDistortion_Mode>` **MODE_OVERDRIVE** = ``3``
Emulates the warm distortion produced by a field effect transistor, which is commonly used in solid-state musical instrument amplifiers.
.. _class_AudioEffectDistortion_constant_MODE_WAVESHAPE:
.. rst-class:: classref-enumeration-constant
:ref:`Mode<enum_AudioEffectDistortion_Mode>` **MODE_WAVESHAPE** = ``4``
Waveshaper distortions are used mainly by electronic musicians to achieve an extra-abrasive sound.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectDistortion_property_drive:
- :ref:`float<class_float>` **drive**
.. rst-class:: classref-property
+-----------+------------------+
| *Default* | ``0.0`` |
+-----------+------------------+
| *Setter* | set_drive(value) |
+-----------+------------------+
| *Getter* | get_drive() |
+-----------+------------------+
:ref:`float<class_float>` **drive** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_drive** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_drive** **(** **)**
Distortion power. Value can range from 0 to 1.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDistortion_property_keep_hf_hz:
- :ref:`float<class_float>` **keep_hf_hz**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``16000.0`` |
+-----------+-----------------------+
| *Setter* | set_keep_hf_hz(value) |
+-----------+-----------------------+
| *Getter* | get_keep_hf_hz() |
+-----------+-----------------------+
:ref:`float<class_float>` **keep_hf_hz** = ``16000.0``
.. rst-class:: classref-property-setget
- void **set_keep_hf_hz** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_keep_hf_hz** **(** **)**
High-pass filter, in Hz. Frequencies higher than this value will not be affected by the distortion. Value can range from 1 to 20000.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDistortion_property_mode:
- :ref:`Mode<enum_AudioEffectDistortion_Mode>` **mode**
.. rst-class:: classref-property
+-----------+-----------------+
| *Default* | ``0`` |
+-----------+-----------------+
| *Setter* | set_mode(value) |
+-----------+-----------------+
| *Getter* | get_mode() |
+-----------+-----------------+
:ref:`Mode<enum_AudioEffectDistortion_Mode>` **mode** = ``0``
.. rst-class:: classref-property-setget
- void **set_mode** **(** :ref:`Mode<enum_AudioEffectDistortion_Mode>` value **)**
- :ref:`Mode<enum_AudioEffectDistortion_Mode>` **get_mode** **(** **)**
Distortion type.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDistortion_property_post_gain:
- :ref:`float<class_float>` **post_gain**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``0.0`` |
+-----------+----------------------+
| *Setter* | set_post_gain(value) |
+-----------+----------------------+
| *Getter* | get_post_gain() |
+-----------+----------------------+
:ref:`float<class_float>` **post_gain** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_post_gain** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_post_gain** **(** **)**
Increases or decreases the volume after the effect. Value can range from -80 to 24.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectDistortion_property_pre_gain:
- :ref:`float<class_float>` **pre_gain**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``0.0`` |
+-----------+---------------------+
| *Setter* | set_pre_gain(value) |
+-----------+---------------------+
| *Getter* | get_pre_gain() |
+-----------+---------------------+
:ref:`float<class_float>` **pre_gain** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_pre_gain** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_pre_gain** **(** **)**
Increases or decreases the volume before the effect. Value can range from -60 to 60.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -18,47 +18,71 @@ Base class for audio equalizers. Gives you control over frequencies.
Use it to create a custom equalizer if :ref:`AudioEffectEQ6<class_AudioEffectEQ6>`, :ref:`AudioEffectEQ10<class_AudioEffectEQ10>` or :ref:`AudioEffectEQ21<class_AudioEffectEQ21>` don't fit your needs.
.. rst-class:: classref-introduction-group
Description
-----------
AudioEffectEQ gives you control over frequencies. Use it to compensate for existing deficiencies in audio. AudioEffectEQs are useful on the Master bus to completely master a mix and give it more character. They are also useful when a game is run on a mobile device, to adjust the mix to that kind of speakers (it can be added but disabled when headphones are plugged).
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_band_count<class_AudioEffectEQ_method_get_band_count>` **(** **)** |const| |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_band_gain_db<class_AudioEffectEQ_method_get_band_gain_db>` **(** :ref:`int<class_int>` band_idx **)** |const| |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_band_gain_db<class_AudioEffectEQ_method_set_band_gain_db>` **(** :ref:`int<class_int>` band_idx, :ref:`float<class_float>` volume_db **)** |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_band_count<class_AudioEffectEQ_method_get_band_count>` **(** **)** |const| |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_band_gain_db<class_AudioEffectEQ_method_get_band_gain_db>` **(** :ref:`int<class_int>` band_idx **)** |const| |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_band_gain_db<class_AudioEffectEQ_method_set_band_gain_db>` **(** :ref:`int<class_int>` band_idx, :ref:`float<class_float>` volume_db **)** |
+---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AudioEffectEQ_method_get_band_count:
- :ref:`int<class_int>` **get_band_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_band_count** **(** **)** |const|
Returns the number of bands of the equalizer.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectEQ_method_get_band_gain_db:
- :ref:`float<class_float>` **get_band_gain_db** **(** :ref:`int<class_int>` band_idx **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_band_gain_db** **(** :ref:`int<class_int>` band_idx **)** |const|
Returns the band's gain at the specified index, in dB.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectEQ_method_set_band_gain_db:
- void **set_band_gain_db** **(** :ref:`int<class_int>` band_idx, :ref:`float<class_float>` volume_db **)**
.. rst-class:: classref-method
void **set_band_gain_db** **(** :ref:`int<class_int>` band_idx, :ref:`float<class_float>` volume_db **)**
Sets band's gain at the specified index, in dB.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,6 +16,8 @@ Adds a 10-band equalizer audio effect to an Audio bus. Gives you control over fr
Each frequency can be modulated between -60/+24 dB.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -46,3 +48,4 @@ See also :ref:`AudioEffectEQ<class_AudioEffectEQ>`, :ref:`AudioEffectEQ6<class_A
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,6 +16,8 @@ Adds a 21-band equalizer audio effect to an Audio bus. Gives you control over fr
Each frequency can be modulated between -60/+24 dB.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -68,3 +70,4 @@ See also :ref:`AudioEffectEQ<class_AudioEffectEQ>`, :ref:`AudioEffectEQ6<class_A
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,6 +16,8 @@ Adds a 6-band equalizer audio effect to an Audio bus. Gives you control over fre
Each frequency can be modulated between -60/+24 dB.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -38,3 +40,4 @@ See also :ref:`AudioEffectEQ<class_AudioEffectEQ>`, :ref:`AudioEffectEQ10<class_
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,115 +16,161 @@ AudioEffectFilter
Adds a filter to the audio bus.
.. rst-class:: classref-introduction-group
Description
-----------
Allows frequencies other than the :ref:`cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` to pass.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
.. rst-class:: classref-reftable-group
Properties
----------
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` | ``2000.0`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` | :ref:`db<class_AudioEffectFilter_property_db>` | ``0`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`gain<class_AudioEffectFilter_property_gain>` | ``1.0`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`resonance<class_AudioEffectFilter_property_resonance>` | ``0.5`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
.. table::
:widths: auto
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` | ``2000.0`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` | :ref:`db<class_AudioEffectFilter_property_db>` | ``0`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`gain<class_AudioEffectFilter_property_gain>` | ``1.0`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`resonance<class_AudioEffectFilter_property_resonance>` | ``0.5`` |
+--------------------------------------------------+--------------------------------------------------------------+------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AudioEffectFilter_FilterDB:
.. _class_AudioEffectFilter_constant_FILTER_6DB:
.. _class_AudioEffectFilter_constant_FILTER_12DB:
.. _class_AudioEffectFilter_constant_FILTER_18DB:
.. _class_AudioEffectFilter_constant_FILTER_24DB:
.. rst-class:: classref-enumeration
enum **FilterDB**:
- **FILTER_6DB** = **0**
.. _class_AudioEffectFilter_constant_FILTER_6DB:
- **FILTER_12DB** = **1**
.. rst-class:: classref-enumeration-constant
- **FILTER_18DB** = **2**
:ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` **FILTER_6DB** = ``0``
- **FILTER_24DB** = **3**
.. _class_AudioEffectFilter_constant_FILTER_12DB:
.. rst-class:: classref-enumeration-constant
:ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` **FILTER_12DB** = ``1``
.. _class_AudioEffectFilter_constant_FILTER_18DB:
.. rst-class:: classref-enumeration-constant
:ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` **FILTER_18DB** = ``2``
.. _class_AudioEffectFilter_constant_FILTER_24DB:
.. rst-class:: classref-enumeration-constant
:ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` **FILTER_24DB** = ``3``
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectFilter_property_cutoff_hz:
- :ref:`float<class_float>` **cutoff_hz**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``2000.0`` |
+-----------+-------------------+
| *Setter* | set_cutoff(value) |
+-----------+-------------------+
| *Getter* | get_cutoff() |
+-----------+-------------------+
:ref:`float<class_float>` **cutoff_hz** = ``2000.0``
.. rst-class:: classref-property-setget
- void **set_cutoff** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_cutoff** **(** **)**
Threshold frequency for the filter, in Hz.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectFilter_property_db:
- :ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` **db**
.. rst-class:: classref-property
+-----------+---------------+
| *Default* | ``0`` |
+-----------+---------------+
| *Setter* | set_db(value) |
+-----------+---------------+
| *Getter* | get_db() |
+-----------+---------------+
:ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` **db** = ``0``
.. rst-class:: classref-property-setget
- void **set_db** **(** :ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` value **)**
- :ref:`FilterDB<enum_AudioEffectFilter_FilterDB>` **get_db** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectFilter_property_gain:
- :ref:`float<class_float>` **gain**
.. rst-class:: classref-property
+-----------+-----------------+
| *Default* | ``1.0`` |
+-----------+-----------------+
| *Setter* | set_gain(value) |
+-----------+-----------------+
| *Getter* | get_gain() |
+-----------+-----------------+
:ref:`float<class_float>` **gain** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_gain** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_gain** **(** **)**
Gain amount of the frequencies after the filter.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectFilter_property_resonance:
- :ref:`float<class_float>` **resonance**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``0.5`` |
+-----------+----------------------+
| *Setter* | set_resonance(value) |
+-----------+----------------------+
| *Getter* | get_resonance() |
+-----------+----------------------+
:ref:`float<class_float>` **resonance** = ``0.5``
.. rst-class:: classref-property-setget
- void **set_resonance** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_resonance** **(** **)**
Amount of boost in the frequency range near the cutoff frequency.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioEffectHighPassFilter
Adds a high-pass filter to the Audio Bus.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -22,3 +24,4 @@ Cuts frequencies lower than the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEff
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioEffectHighShelfFilter
Reduces all frequencies above the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>`.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -22,3 +24,4 @@ Tutorials
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,8 +14,11 @@ AudioEffectInstance
**Inherited By:** :ref:`AudioEffectSpectrumAnalyzerInstance<class_AudioEffectSpectrumAnalyzerInstance>`
.. container:: contribute
There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioEffectLimiter
Adds a soft-clip limiter audio effect to an Audio bus.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -21,82 +23,100 @@ A limiter is similar to a compressor, but it's less flexible and designed to dis
Soft clipping starts to reduce the peaks a little below the threshold level and progressively increases its effect as the input level increases such that the threshold is never exceeded.
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`ceiling_db<class_AudioEffectLimiter_property_ceiling_db>` | ``-0.1`` |
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`soft_clip_db<class_AudioEffectLimiter_property_soft_clip_db>` | ``2.0`` |
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`soft_clip_ratio<class_AudioEffectLimiter_property_soft_clip_ratio>` | ``10.0`` |
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`threshold_db<class_AudioEffectLimiter_property_threshold_db>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------------------+----------+
.. table::
:widths: auto
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`ceiling_db<class_AudioEffectLimiter_property_ceiling_db>` | ``-0.1`` |
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`soft_clip_db<class_AudioEffectLimiter_property_soft_clip_db>` | ``2.0`` |
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`soft_clip_ratio<class_AudioEffectLimiter_property_soft_clip_ratio>` | ``10.0`` |
+---------------------------+---------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`threshold_db<class_AudioEffectLimiter_property_threshold_db>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------------------+----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectLimiter_property_ceiling_db:
- :ref:`float<class_float>` **ceiling_db**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``-0.1`` |
+-----------+-----------------------+
| *Setter* | set_ceiling_db(value) |
+-----------+-----------------------+
| *Getter* | get_ceiling_db() |
+-----------+-----------------------+
:ref:`float<class_float>` **ceiling_db** = ``-0.1``
.. rst-class:: classref-property-setget
- void **set_ceiling_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_ceiling_db** **(** **)**
The waveform's maximum allowed value, in decibels. Value can range from -20 to -0.1.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectLimiter_property_soft_clip_db:
- :ref:`float<class_float>` **soft_clip_db**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``2.0`` |
+-----------+-------------------------+
| *Setter* | set_soft_clip_db(value) |
+-----------+-------------------------+
| *Getter* | get_soft_clip_db() |
+-----------+-------------------------+
:ref:`float<class_float>` **soft_clip_db** = ``2.0``
.. rst-class:: classref-property-setget
- void **set_soft_clip_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_soft_clip_db** **(** **)**
Applies a gain to the limited waves, in decibels. Value can range from 0 to 6.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectLimiter_property_soft_clip_ratio:
- :ref:`float<class_float>` **soft_clip_ratio**
.. rst-class:: classref-property
+-----------+----------------------------+
| *Default* | ``10.0`` |
+-----------+----------------------------+
| *Setter* | set_soft_clip_ratio(value) |
+-----------+----------------------------+
| *Getter* | get_soft_clip_ratio() |
+-----------+----------------------------+
:ref:`float<class_float>` **soft_clip_ratio** = ``10.0``
.. rst-class:: classref-property-setget
- void **set_soft_clip_ratio** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_soft_clip_ratio** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectLimiter_property_threshold_db:
- :ref:`float<class_float>` **threshold_db**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``0.0`` |
+-----------+-------------------------+
| *Setter* | set_threshold_db(value) |
+-----------+-------------------------+
| *Getter* | get_threshold_db() |
+-----------+-------------------------+
:ref:`float<class_float>` **threshold_db** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_threshold_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_threshold_db** **(** **)**
Threshold from which the limiter begins to be active, in decibels. Value can range from -30 to 0.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioEffectLowPassFilter
Adds a low-pass filter to the Audio bus.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -22,3 +24,4 @@ Cuts frequencies higher than the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEf
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioEffectLowShelfFilter
Reduces all frequencies below the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>`.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -22,3 +24,4 @@ Tutorials
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioEffectNotchFilter
Adds a notch filter to the Audio bus.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -22,3 +24,4 @@ Attenuates frequencies in a narrow band around the :ref:`AudioEffectFilter.cutof
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,35 +14,48 @@ AudioEffectPanner
Adds a panner audio effect to an Audio bus. Pans sound left or right.
.. rst-class:: classref-introduction-group
Description
-----------
Determines how much of an audio signal is sent to the left and right buses.
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+--------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`pan<class_AudioEffectPanner_property_pan>` | ``0.0`` |
+---------------------------+--------------------------------------------------+---------+
.. table::
:widths: auto
+---------------------------+--------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`pan<class_AudioEffectPanner_property_pan>` | ``0.0`` |
+---------------------------+--------------------------------------------------+---------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectPanner_property_pan:
- :ref:`float<class_float>` **pan**
.. rst-class:: classref-property
+-----------+----------------+
| *Default* | ``0.0`` |
+-----------+----------------+
| *Setter* | set_pan(value) |
+-----------+----------------+
| *Getter* | get_pan() |
+-----------+----------------+
:ref:`float<class_float>` **pan** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_pan** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_pan** **(** **)**
Pan position. Value can range from -1 (fully left) to 1 (fully right).
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,107 +16,124 @@ Adds a phaser audio effect to an Audio bus.
Combines the original signal with a copy that is slightly out of phase with the original.
.. rst-class:: classref-introduction-group
Description
-----------
Combines phase-shifted signals with the original signal. The movement of the phase-shifted signals is controlled using a low-frequency oscillator.
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`depth<class_AudioEffectPhaser_property_depth>` | ``1.0`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`feedback<class_AudioEffectPhaser_property_feedback>` | ``0.7`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`range_max_hz<class_AudioEffectPhaser_property_range_max_hz>` | ``1600.0`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`range_min_hz<class_AudioEffectPhaser_property_range_min_hz>` | ``440.0`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`rate_hz<class_AudioEffectPhaser_property_rate_hz>` | ``0.5`` |
+---------------------------+--------------------------------------------------------------------+------------+
.. table::
:widths: auto
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`depth<class_AudioEffectPhaser_property_depth>` | ``1.0`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`feedback<class_AudioEffectPhaser_property_feedback>` | ``0.7`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`range_max_hz<class_AudioEffectPhaser_property_range_max_hz>` | ``1600.0`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`range_min_hz<class_AudioEffectPhaser_property_range_min_hz>` | ``440.0`` |
+---------------------------+--------------------------------------------------------------------+------------+
| :ref:`float<class_float>` | :ref:`rate_hz<class_AudioEffectPhaser_property_rate_hz>` | ``0.5`` |
+---------------------------+--------------------------------------------------------------------+------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectPhaser_property_depth:
- :ref:`float<class_float>` **depth**
.. rst-class:: classref-property
+-----------+------------------+
| *Default* | ``1.0`` |
+-----------+------------------+
| *Setter* | set_depth(value) |
+-----------+------------------+
| *Getter* | get_depth() |
+-----------+------------------+
:ref:`float<class_float>` **depth** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_depth** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_depth** **(** **)**
Governs how high the filter frequencies sweep. Low value will primarily affect bass frequencies. High value can sweep high into the treble. Value can range from 0.1 to 4.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectPhaser_property_feedback:
- :ref:`float<class_float>` **feedback**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``0.7`` |
+-----------+---------------------+
| *Setter* | set_feedback(value) |
+-----------+---------------------+
| *Getter* | get_feedback() |
+-----------+---------------------+
:ref:`float<class_float>` **feedback** = ``0.7``
.. rst-class:: classref-property-setget
- void **set_feedback** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_feedback** **(** **)**
Output percent of modified sound. Value can range from 0.1 to 0.9.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectPhaser_property_range_max_hz:
- :ref:`float<class_float>` **range_max_hz**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``1600.0`` |
+-----------+-------------------------+
| *Setter* | set_range_max_hz(value) |
+-----------+-------------------------+
| *Getter* | get_range_max_hz() |
+-----------+-------------------------+
:ref:`float<class_float>` **range_max_hz** = ``1600.0``
.. rst-class:: classref-property-setget
- void **set_range_max_hz** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_range_max_hz** **(** **)**
Determines the maximum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectPhaser_property_range_min_hz:
- :ref:`float<class_float>` **range_min_hz**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``440.0`` |
+-----------+-------------------------+
| *Setter* | set_range_min_hz(value) |
+-----------+-------------------------+
| *Getter* | get_range_min_hz() |
+-----------+-------------------------+
:ref:`float<class_float>` **range_min_hz** = ``440.0``
.. rst-class:: classref-property-setget
- void **set_range_min_hz** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_range_min_hz** **(** **)**
Determines the minimum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectPhaser_property_rate_hz:
- :ref:`float<class_float>` **rate_hz**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``0.5`` |
+-----------+--------------------+
| *Setter* | set_rate_hz(value) |
+-----------+--------------------+
| *Getter* | get_rate_hz() |
+-----------+--------------------+
:ref:`float<class_float>` **rate_hz** = ``0.5``
.. rst-class:: classref-property-setget
- void **set_rate_hz** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_rate_hz** **(** **)**
Adjusts the rate in Hz at which the effect sweeps up and down across the frequency range.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,102 +16,149 @@ Adds a pitch-shifting audio effect to an Audio bus.
Raises or lowers the pitch of original sound.
.. rst-class:: classref-introduction-group
Description
-----------
Allows modulation of pitch independently of tempo. All frequencies can be increased/decreased with minimal effect on transients.
.. rst-class:: classref-reftable-group
Properties
----------
+------------------------------------------------------+------------------------------------------------------------------------+---------+
| :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` | :ref:`fft_size<class_AudioEffectPitchShift_property_fft_size>` | ``3`` |
+------------------------------------------------------+------------------------------------------------------------------------+---------+
| :ref:`int<class_int>` | :ref:`oversampling<class_AudioEffectPitchShift_property_oversampling>` | ``4`` |
+------------------------------------------------------+------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioEffectPitchShift_property_pitch_scale>` | ``1.0`` |
+------------------------------------------------------+------------------------------------------------------------------------+---------+
.. table::
:widths: auto
+------------------------------------------------------+------------------------------------------------------------------------+---------+
| :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` | :ref:`fft_size<class_AudioEffectPitchShift_property_fft_size>` | ``3`` |
+------------------------------------------------------+------------------------------------------------------------------------+---------+
| :ref:`int<class_int>` | :ref:`oversampling<class_AudioEffectPitchShift_property_oversampling>` | ``4`` |
+------------------------------------------------------+------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioEffectPitchShift_property_pitch_scale>` | ``1.0`` |
+------------------------------------------------------+------------------------------------------------------------------------+---------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AudioEffectPitchShift_FFT_Size:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_256:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_512:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_1024:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_2048:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_4096:
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_MAX:
.. rst-class:: classref-enumeration
enum **FFT_Size**:
- **FFT_SIZE_256** = **0** --- Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time.
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_256:
- **FFT_SIZE_512** = **1** --- Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time.
.. rst-class:: classref-enumeration-constant
- **FFT_SIZE_1024** = **2** --- Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time.
:ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_256** = ``0``
- **FFT_SIZE_2048** = **3** --- Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time.
Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time.
- **FFT_SIZE_4096** = **4** --- Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time.
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_512:
- **FFT_SIZE_MAX** = **5** --- Represents the size of the :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` enum.
.. rst-class:: classref-enumeration-constant
:ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_512** = ``1``
Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time.
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_1024:
.. rst-class:: classref-enumeration-constant
:ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_1024** = ``2``
Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time.
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_2048:
.. rst-class:: classref-enumeration-constant
:ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_2048** = ``3``
Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time.
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_4096:
.. rst-class:: classref-enumeration-constant
:ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_4096** = ``4``
Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time.
.. _class_AudioEffectPitchShift_constant_FFT_SIZE_MAX:
.. rst-class:: classref-enumeration-constant
:ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **FFT_SIZE_MAX** = ``5``
Represents the size of the :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` enum.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectPitchShift_property_fft_size:
- :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **fft_size**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``3`` |
+-----------+---------------------+
| *Setter* | set_fft_size(value) |
+-----------+---------------------+
| *Getter* | get_fft_size() |
+-----------+---------------------+
:ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **fft_size** = ``3``
.. rst-class:: classref-property-setget
- void **set_fft_size** **(** :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` value **)**
- :ref:`FFT_Size<enum_AudioEffectPitchShift_FFT_Size>` **get_fft_size** **(** **)**
The size of the `Fast Fourier transform <https://en.wikipedia.org/wiki/Fast_Fourier_transform>`__ buffer. Higher values smooth out the effect over time, but have greater latency. The effects of this higher latency are especially noticeable on sounds that have sudden amplitude changes.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectPitchShift_property_oversampling:
- :ref:`int<class_int>` **oversampling**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``4`` |
+-----------+-------------------------+
| *Setter* | set_oversampling(value) |
+-----------+-------------------------+
| *Getter* | get_oversampling() |
+-----------+-------------------------+
:ref:`int<class_int>` **oversampling** = ``4``
.. rst-class:: classref-property-setget
- void **set_oversampling** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_oversampling** **(** **)**
The oversampling factor to use. Higher values result in better quality, but are more demanding on the CPU and may cause audio cracking if the CPU can't keep up.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectPitchShift_property_pitch_scale:
- :ref:`float<class_float>` **pitch_scale**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_pitch_scale(value) |
+-----------+------------------------+
| *Getter* | get_pitch_scale() |
+-----------+------------------------+
:ref:`float<class_float>` **pitch_scale** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_pitch_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_pitch_scale** **(** **)**
The pitch scale to use. ``1.0`` is the default pitch and plays sounds unaltered. :ref:`pitch_scale<class_AudioEffectPitchShift_property_pitch_scale>` can range from ``0.0`` (infinitely low pitch, inaudible) to ``16`` (16 times higher than the initial pitch).
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioEffectRecord
Audio effect used for recording the sound from an audio bus.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,6 +25,8 @@ Can be used (with an :ref:`AudioStreamMicrophone<class_AudioStreamMicrophone>`)
It sets and gets the format in which the audio file will be recorded (8-bit, 16-bit, or compressed). It checks whether or not the recording is active, and if it is, records the sound. It then returns the recorded sample.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -30,66 +34,98 @@ Tutorials
- `Audio Mic Record Demo <https://godotengine.org/asset-library/asset/527>`__
.. rst-class:: classref-reftable-group
Properties
----------
+----------------------------------------------+--------------------------------------------------------+-------+
| :ref:`Format<enum_AudioStreamSample_Format>` | :ref:`format<class_AudioEffectRecord_property_format>` | ``1`` |
+----------------------------------------------+--------------------------------------------------------+-------+
.. table::
:widths: auto
+----------------------------------------------+--------------------------------------------------------+-------+
| :ref:`Format<enum_AudioStreamSample_Format>` | :ref:`format<class_AudioEffectRecord_property_format>` | ``1`` |
+----------------------------------------------+--------------------------------------------------------+-------+
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamSample<class_AudioStreamSample>` | :ref:`get_recording<class_AudioEffectRecord_method_get_recording>` **(** **)** |const| |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_recording_active<class_AudioEffectRecord_method_is_recording_active>` **(** **)** |const| |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_recording_active<class_AudioEffectRecord_method_set_recording_active>` **(** :ref:`bool<class_bool>` record **)** |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamSample<class_AudioStreamSample>` | :ref:`get_recording<class_AudioEffectRecord_method_get_recording>` **(** **)** |const| |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_recording_active<class_AudioEffectRecord_method_is_recording_active>` **(** **)** |const| |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_recording_active<class_AudioEffectRecord_method_set_recording_active>` **(** :ref:`bool<class_bool>` record **)** |
+---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectRecord_property_format:
- :ref:`Format<enum_AudioStreamSample_Format>` **format**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``1`` |
+-----------+-------------------+
| *Setter* | set_format(value) |
+-----------+-------------------+
| *Getter* | get_format() |
+-----------+-------------------+
:ref:`Format<enum_AudioStreamSample_Format>` **format** = ``1``
.. rst-class:: classref-property-setget
- void **set_format** **(** :ref:`Format<enum_AudioStreamSample_Format>` value **)**
- :ref:`Format<enum_AudioStreamSample_Format>` **get_format** **(** **)**
Specifies the format in which the sample will be recorded. See :ref:`Format<enum_AudioStreamSample_Format>` for available formats.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AudioEffectRecord_method_get_recording:
- :ref:`AudioStreamSample<class_AudioStreamSample>` **get_recording** **(** **)** |const|
.. rst-class:: classref-method
:ref:`AudioStreamSample<class_AudioStreamSample>` **get_recording** **(** **)** |const|
Returns the recorded sample.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectRecord_method_is_recording_active:
- :ref:`bool<class_bool>` **is_recording_active** **(** **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_recording_active** **(** **)** |const|
Returns whether the recording is active or not.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectRecord_method_set_recording_active:
- void **set_recording_active** **(** :ref:`bool<class_bool>` record **)**
.. rst-class:: classref-method
void **set_recording_active** **(** :ref:`bool<class_bool>` record **)**
If ``true``, the sound will be recorded. Note that restarting the recording will remove the previously recorded sample.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,166 +16,188 @@ Adds a reverberation audio effect to an Audio bus.
Simulates the sound of acoustic environments such as rooms, concert halls, caverns, or an open spaces.
.. rst-class:: classref-introduction-group
Description
-----------
Simulates rooms of different sizes. Its parameters can be adjusted to simulate the sound of a specific room.
.. rst-class:: classref-introduction-group
Tutorials
---------
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`damping<class_AudioEffectReverb_property_damping>` | ``0.5`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`dry<class_AudioEffectReverb_property_dry>` | ``1.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`hipass<class_AudioEffectReverb_property_hipass>` | ``0.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`predelay_feedback<class_AudioEffectReverb_property_predelay_feedback>` | ``0.4`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`predelay_msec<class_AudioEffectReverb_property_predelay_msec>` | ``150.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`room_size<class_AudioEffectReverb_property_room_size>` | ``0.8`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`spread<class_AudioEffectReverb_property_spread>` | ``1.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`wet<class_AudioEffectReverb_property_wet>` | ``0.5`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
.. table::
:widths: auto
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`damping<class_AudioEffectReverb_property_damping>` | ``0.5`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`dry<class_AudioEffectReverb_property_dry>` | ``1.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`hipass<class_AudioEffectReverb_property_hipass>` | ``0.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`predelay_feedback<class_AudioEffectReverb_property_predelay_feedback>` | ``0.4`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`predelay_msec<class_AudioEffectReverb_property_predelay_msec>` | ``150.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`room_size<class_AudioEffectReverb_property_room_size>` | ``0.8`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`spread<class_AudioEffectReverb_property_spread>` | ``1.0`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`wet<class_AudioEffectReverb_property_wet>` | ``0.5`` |
+---------------------------+------------------------------------------------------------------------------+-----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectReverb_property_damping:
- :ref:`float<class_float>` **damping**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``0.5`` |
+-----------+--------------------+
| *Setter* | set_damping(value) |
+-----------+--------------------+
| *Getter* | get_damping() |
+-----------+--------------------+
:ref:`float<class_float>` **damping** = ``0.5``
.. rst-class:: classref-property-setget
- void **set_damping** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_damping** **(** **)**
Defines how reflective the imaginary room's walls are. Value can range from 0 to 1.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectReverb_property_dry:
- :ref:`float<class_float>` **dry**
.. rst-class:: classref-property
+-----------+----------------+
| *Default* | ``1.0`` |
+-----------+----------------+
| *Setter* | set_dry(value) |
+-----------+----------------+
| *Getter* | get_dry() |
+-----------+----------------+
:ref:`float<class_float>` **dry** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_dry** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_dry** **(** **)**
Output percent of original sound. At 0, only modified sound is outputted. Value can range from 0 to 1.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectReverb_property_hipass:
- :ref:`float<class_float>` **hipass**
.. rst-class:: classref-property
+-----------+----------------+
| *Default* | ``0.0`` |
+-----------+----------------+
| *Setter* | set_hpf(value) |
+-----------+----------------+
| *Getter* | get_hpf() |
+-----------+----------------+
:ref:`float<class_float>` **hipass** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_hpf** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_hpf** **(** **)**
High-pass filter passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency. Value can range from 0 to 1.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectReverb_property_predelay_feedback:
- :ref:`float<class_float>` **predelay_feedback**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``0.4`` |
+-----------+------------------------------+
| *Setter* | set_predelay_feedback(value) |
+-----------+------------------------------+
| *Getter* | get_predelay_feedback() |
+-----------+------------------------------+
:ref:`float<class_float>` **predelay_feedback** = ``0.4``
.. rst-class:: classref-property-setget
- void **set_predelay_feedback** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_predelay_feedback** **(** **)**
Output percent of predelay. Value can range from 0 to 1.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectReverb_property_predelay_msec:
- :ref:`float<class_float>` **predelay_msec**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``150.0`` |
+-----------+--------------------------+
| *Setter* | set_predelay_msec(value) |
+-----------+--------------------------+
| *Getter* | get_predelay_msec() |
+-----------+--------------------------+
:ref:`float<class_float>` **predelay_msec** = ``150.0``
.. rst-class:: classref-property-setget
- void **set_predelay_msec** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_predelay_msec** **(** **)**
Time between the original signal and the early reflections of the reverb signal, in milliseconds.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectReverb_property_room_size:
- :ref:`float<class_float>` **room_size**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``0.8`` |
+-----------+----------------------+
| *Setter* | set_room_size(value) |
+-----------+----------------------+
| *Getter* | get_room_size() |
+-----------+----------------------+
:ref:`float<class_float>` **room_size** = ``0.8``
.. rst-class:: classref-property-setget
- void **set_room_size** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_room_size** **(** **)**
Dimensions of simulated room. Bigger means more echoes. Value can range from 0 to 1.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectReverb_property_spread:
- :ref:`float<class_float>` **spread**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``1.0`` |
+-----------+-------------------+
| *Setter* | set_spread(value) |
+-----------+-------------------+
| *Getter* | get_spread() |
+-----------+-------------------+
:ref:`float<class_float>` **spread** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_spread** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_spread** **(** **)**
Widens or narrows the stereo image of the reverb tail. 1 means fully widens. Value can range from 0 to 1.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectReverb_property_wet:
- :ref:`float<class_float>` **wet**
.. rst-class:: classref-property
+-----------+----------------+
| *Default* | ``0.5`` |
+-----------+----------------+
| *Setter* | set_wet(value) |
+-----------+----------------+
| *Getter* | get_wet() |
+-----------+----------------+
:ref:`float<class_float>` **wet** = ``0.5``
.. rst-class:: classref-property-setget
- void **set_wet** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_wet** **(** **)**
Output percent of modified sound. At 0, only original sound is outputted. Value can range from 0 to 1.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioEffectSpectrumAnalyzer
Audio effect that can be used for real-time audio visualizations.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -21,6 +23,8 @@ This audio effect does not affect sound output, but can be used for real-time au
See also :ref:`AudioStreamGenerator<class_AudioStreamGenerator>` for procedurally generating sounds.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -28,95 +32,144 @@ Tutorials
- `Godot 3.2 will get new audio features <https://godotengine.org/article/godot-32-will-get-new-audio-features>`__
.. rst-class:: classref-reftable-group
Properties
----------
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`buffer_length<class_AudioEffectSpectrumAnalyzer_property_buffer_length>` | ``2.0`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
| :ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` | :ref:`fft_size<class_AudioEffectSpectrumAnalyzer_property_fft_size>` | ``2`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`tap_back_pos<class_AudioEffectSpectrumAnalyzer_property_tap_back_pos>` | ``0.01`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
.. table::
:widths: auto
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`buffer_length<class_AudioEffectSpectrumAnalyzer_property_buffer_length>` | ``2.0`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
| :ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` | :ref:`fft_size<class_AudioEffectSpectrumAnalyzer_property_fft_size>` | ``2`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
| :ref:`float<class_float>` | :ref:`tap_back_pos<class_AudioEffectSpectrumAnalyzer_property_tap_back_pos>` | ``0.01`` |
+------------------------------------------------------------+--------------------------------------------------------------------------------+----------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AudioEffectSpectrumAnalyzer_FFT_Size:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_256:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_512:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_1024:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_2048:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_4096:
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_MAX:
.. rst-class:: classref-enumeration
enum **FFT_Size**:
- **FFT_SIZE_256** = **0** --- Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time.
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_256:
- **FFT_SIZE_512** = **1** --- Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time.
.. rst-class:: classref-enumeration-constant
- **FFT_SIZE_1024** = **2** --- Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time.
:ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` **FFT_SIZE_256** = ``0``
- **FFT_SIZE_2048** = **3** --- Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time.
Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time.
- **FFT_SIZE_4096** = **4** --- Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time.
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_512:
- **FFT_SIZE_MAX** = **5** --- Represents the size of the :ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` enum.
.. rst-class:: classref-enumeration-constant
:ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` **FFT_SIZE_512** = ``1``
Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time.
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_1024:
.. rst-class:: classref-enumeration-constant
:ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` **FFT_SIZE_1024** = ``2``
Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time.
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_2048:
.. rst-class:: classref-enumeration-constant
:ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` **FFT_SIZE_2048** = ``3``
Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time.
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_4096:
.. rst-class:: classref-enumeration-constant
:ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` **FFT_SIZE_4096** = ``4``
Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time.
.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_MAX:
.. rst-class:: classref-enumeration-constant
:ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` **FFT_SIZE_MAX** = ``5``
Represents the size of the :ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` enum.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectSpectrumAnalyzer_property_buffer_length:
- :ref:`float<class_float>` **buffer_length**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``2.0`` |
+-----------+--------------------------+
| *Setter* | set_buffer_length(value) |
+-----------+--------------------------+
| *Getter* | get_buffer_length() |
+-----------+--------------------------+
:ref:`float<class_float>` **buffer_length** = ``2.0``
.. rst-class:: classref-property-setget
- void **set_buffer_length** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_buffer_length** **(** **)**
The length of the buffer to keep (in seconds). Higher values keep data around for longer, but require more memory.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectSpectrumAnalyzer_property_fft_size:
- :ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` **fft_size**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``2`` |
+-----------+---------------------+
| *Setter* | set_fft_size(value) |
+-----------+---------------------+
| *Getter* | get_fft_size() |
+-----------+---------------------+
:ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` **fft_size** = ``2``
.. rst-class:: classref-property-setget
- void **set_fft_size** **(** :ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` value **)**
- :ref:`FFT_Size<enum_AudioEffectSpectrumAnalyzer_FFT_Size>` **get_fft_size** **(** **)**
The size of the `Fast Fourier transform <https://en.wikipedia.org/wiki/Fast_Fourier_transform>`__ buffer. Higher values smooth out the spectrum analysis over time, but have greater latency. The effects of this higher latency are especially noticeable with sudden amplitude changes.
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectSpectrumAnalyzer_property_tap_back_pos:
- :ref:`float<class_float>` **tap_back_pos**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``0.01`` |
+-----------+-------------------------+
| *Setter* | set_tap_back_pos(value) |
+-----------+-------------------------+
| *Getter* | get_tap_back_pos() |
+-----------+-------------------------+
:ref:`float<class_float>` **tap_back_pos** = ``0.01``
.. rst-class:: classref-property-setget
- void **set_tap_back_pos** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_tap_back_pos** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -12,37 +12,73 @@ AudioEffectSpectrumAnalyzerInstance
**Inherits:** :ref:`AudioEffectInstance<class_AudioEffectInstance>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
.. container:: contribute
There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_magnitude_for_frequency_range<class_AudioEffectSpectrumAnalyzerInstance_method_get_magnitude_for_frequency_range>` **(** :ref:`float<class_float>` from_hz, :ref:`float<class_float>` to_hz, :ref:`MagnitudeMode<enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode>` mode=1 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_magnitude_for_frequency_range<class_AudioEffectSpectrumAnalyzerInstance_method_get_magnitude_for_frequency_range>` **(** :ref:`float<class_float>` from_hz, :ref:`float<class_float>` to_hz, :ref:`MagnitudeMode<enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode>` mode=1 **)** |const| |
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode:
.. _class_AudioEffectSpectrumAnalyzerInstance_constant_MAGNITUDE_AVERAGE:
.. _class_AudioEffectSpectrumAnalyzerInstance_constant_MAGNITUDE_MAX:
.. rst-class:: classref-enumeration
enum **MagnitudeMode**:
- **MAGNITUDE_AVERAGE** = **0** --- Use the average value as magnitude.
.. _class_AudioEffectSpectrumAnalyzerInstance_constant_MAGNITUDE_AVERAGE:
- **MAGNITUDE_MAX** = **1** --- Use the maximum value as magnitude.
.. rst-class:: classref-enumeration-constant
:ref:`MagnitudeMode<enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode>` **MAGNITUDE_AVERAGE** = ``0``
Use the average value as magnitude.
.. _class_AudioEffectSpectrumAnalyzerInstance_constant_MAGNITUDE_MAX:
.. rst-class:: classref-enumeration-constant
:ref:`MagnitudeMode<enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode>` **MAGNITUDE_MAX** = ``1``
Use the maximum value as magnitude.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AudioEffectSpectrumAnalyzerInstance_method_get_magnitude_for_frequency_range:
- :ref:`Vector2<class_Vector2>` **get_magnitude_for_frequency_range** **(** :ref:`float<class_float>` from_hz, :ref:`float<class_float>` to_hz, :ref:`MagnitudeMode<enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode>` mode=1 **)** |const|
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_magnitude_for_frequency_range** **(** :ref:`float<class_float>` from_hz, :ref:`float<class_float>` to_hz, :ref:`MagnitudeMode<enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode>` mode=1 **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -12,62 +12,89 @@ AudioEffectStereoEnhance
**Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
.. container:: contribute
There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+---------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`pan_pullout<class_AudioEffectStereoEnhance_property_pan_pullout>` | ``1.0`` |
+---------------------------+---------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`surround<class_AudioEffectStereoEnhance_property_surround>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`time_pullout_ms<class_AudioEffectStereoEnhance_property_time_pullout_ms>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------------------------+---------+
.. table::
:widths: auto
+---------------------------+---------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`pan_pullout<class_AudioEffectStereoEnhance_property_pan_pullout>` | ``1.0`` |
+---------------------------+---------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`surround<class_AudioEffectStereoEnhance_property_surround>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`time_pullout_ms<class_AudioEffectStereoEnhance_property_time_pullout_ms>` | ``0.0`` |
+---------------------------+---------------------------------------------------------------------------------+---------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioEffectStereoEnhance_property_pan_pullout:
- :ref:`float<class_float>` **pan_pullout**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_pan_pullout(value) |
+-----------+------------------------+
| *Getter* | get_pan_pullout() |
+-----------+------------------------+
:ref:`float<class_float>` **pan_pullout** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_pan_pullout** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_pan_pullout** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectStereoEnhance_property_surround:
- :ref:`float<class_float>` **surround**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``0.0`` |
+-----------+---------------------+
| *Setter* | set_surround(value) |
+-----------+---------------------+
| *Getter* | get_surround() |
+-----------+---------------------+
:ref:`float<class_float>` **surround** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_surround** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_surround** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AudioEffectStereoEnhance_property_time_pullout_ms:
- :ref:`float<class_float>` **time_pullout_ms**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``0.0`` |
+-----------+-------------------------+
| *Setter* | set_time_pullout(value) |
+-----------+-------------------------+
| *Getter* | get_time_pullout() |
+-----------+-------------------------+
:ref:`float<class_float>` **time_pullout_ms** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_time_pullout** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_time_pullout** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,10 +14,14 @@ AudioServer
Server interface for low-level audio access.
.. rst-class:: classref-introduction-group
Description
-----------
``AudioServer`` is a low-level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface.
**AudioServer** is a low-level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -30,508 +34,715 @@ Tutorials
- `Audio Spectrum Demo <https://godotengine.org/asset-library/asset/528>`__
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`int<class_int>` | :ref:`bus_count<class_AudioServer_property_bus_count>` | ``1`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`String<class_String>` | :ref:`capture_device<class_AudioServer_property_capture_device>` | ``"Default"`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`String<class_String>` | :ref:`device<class_AudioServer_property_device>` | ``"Default"`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`float<class_float>` | :ref:`global_rate_scale<class_AudioServer_property_global_rate_scale>` | ``1.0`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
.. table::
:widths: auto
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`int<class_int>` | :ref:`bus_count<class_AudioServer_property_bus_count>` | ``1`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`String<class_String>` | :ref:`capture_device<class_AudioServer_property_capture_device>` | ``"Default"`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`String<class_String>` | :ref:`device<class_AudioServer_property_device>` | ``"Default"`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
| :ref:`float<class_float>` | :ref:`global_rate_scale<class_AudioServer_property_global_rate_scale>` | ``1.0`` |
+-----------------------------+------------------------------------------------------------------------+---------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_bus<class_AudioServer_method_add_bus>` **(** :ref:`int<class_int>` at_position=-1 **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_bus_effect<class_AudioServer_method_add_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`AudioEffect<class_AudioEffect>` effect, :ref:`int<class_int>` at_position=-1 **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`capture_get_device_list<class_AudioServer_method_capture_get_device_list>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioBusLayout<class_AudioBusLayout>` | :ref:`generate_bus_layout<class_AudioServer_method_generate_bus_layout>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_bus_channels<class_AudioServer_method_get_bus_channels>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioEffect<class_AudioEffect>` | :ref:`get_bus_effect<class_AudioServer_method_get_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_bus_effect_count<class_AudioServer_method_get_bus_effect_count>` **(** :ref:`int<class_int>` bus_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioEffectInstance<class_AudioEffectInstance>` | :ref:`get_bus_effect_instance<class_AudioServer_method_get_bus_effect_instance>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` channel=0 **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_bus_index<class_AudioServer_method_get_bus_index>` **(** :ref:`String<class_String>` bus_name **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_bus_name<class_AudioServer_method_get_bus_name>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_bus_peak_volume_left_db<class_AudioServer_method_get_bus_peak_volume_left_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_bus_peak_volume_right_db<class_AudioServer_method_get_bus_peak_volume_right_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_bus_send<class_AudioServer_method_get_bus_send>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_bus_volume_db<class_AudioServer_method_get_bus_volume_db>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_device_list<class_AudioServer_method_get_device_list>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_mix_rate<class_AudioServer_method_get_mix_rate>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_output_latency<class_AudioServer_method_get_output_latency>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` | :ref:`get_speaker_mode<class_AudioServer_method_get_speaker_mode>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_time_since_last_mix<class_AudioServer_method_get_time_since_last_mix>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_time_to_next_mix<class_AudioServer_method_get_time_to_next_mix>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_bypassing_effects<class_AudioServer_method_is_bus_bypassing_effects>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_effect_enabled<class_AudioServer_method_is_bus_effect_enabled>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_mute<class_AudioServer_method_is_bus_mute>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_solo<class_AudioServer_method_is_bus_solo>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`lock<class_AudioServer_method_lock>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`move_bus<class_AudioServer_method_move_bus>` **(** :ref:`int<class_int>` index, :ref:`int<class_int>` to_index **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_bus<class_AudioServer_method_remove_bus>` **(** :ref:`int<class_int>` index **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_bus_effect<class_AudioServer_method_remove_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_bypass_effects<class_AudioServer_method_set_bus_bypass_effects>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_effect_enabled<class_AudioServer_method_set_bus_effect_enabled>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`bool<class_bool>` enabled **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_layout<class_AudioServer_method_set_bus_layout>` **(** :ref:`AudioBusLayout<class_AudioBusLayout>` bus_layout **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_mute<class_AudioServer_method_set_bus_mute>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_name<class_AudioServer_method_set_bus_name>` **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` name **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_send<class_AudioServer_method_set_bus_send>` **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` send **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_solo<class_AudioServer_method_set_bus_solo>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_volume_db<class_AudioServer_method_set_bus_volume_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`float<class_float>` volume_db **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`swap_bus_effects<class_AudioServer_method_swap_bus_effects>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` by_effect_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`unlock<class_AudioServer_method_unlock>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_bus<class_AudioServer_method_add_bus>` **(** :ref:`int<class_int>` at_position=-1 **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_bus_effect<class_AudioServer_method_add_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`AudioEffect<class_AudioEffect>` effect, :ref:`int<class_int>` at_position=-1 **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`capture_get_device_list<class_AudioServer_method_capture_get_device_list>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioBusLayout<class_AudioBusLayout>` | :ref:`generate_bus_layout<class_AudioServer_method_generate_bus_layout>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_bus_channels<class_AudioServer_method_get_bus_channels>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioEffect<class_AudioEffect>` | :ref:`get_bus_effect<class_AudioServer_method_get_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_bus_effect_count<class_AudioServer_method_get_bus_effect_count>` **(** :ref:`int<class_int>` bus_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`AudioEffectInstance<class_AudioEffectInstance>` | :ref:`get_bus_effect_instance<class_AudioServer_method_get_bus_effect_instance>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` channel=0 **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_bus_index<class_AudioServer_method_get_bus_index>` **(** :ref:`String<class_String>` bus_name **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_bus_name<class_AudioServer_method_get_bus_name>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_bus_peak_volume_left_db<class_AudioServer_method_get_bus_peak_volume_left_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_bus_peak_volume_right_db<class_AudioServer_method_get_bus_peak_volume_right_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_bus_send<class_AudioServer_method_get_bus_send>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_bus_volume_db<class_AudioServer_method_get_bus_volume_db>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_device_list<class_AudioServer_method_get_device_list>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_mix_rate<class_AudioServer_method_get_mix_rate>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_output_latency<class_AudioServer_method_get_output_latency>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` | :ref:`get_speaker_mode<class_AudioServer_method_get_speaker_mode>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_time_since_last_mix<class_AudioServer_method_get_time_since_last_mix>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_time_to_next_mix<class_AudioServer_method_get_time_to_next_mix>` **(** **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_bypassing_effects<class_AudioServer_method_is_bus_bypassing_effects>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_effect_enabled<class_AudioServer_method_is_bus_effect_enabled>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_mute<class_AudioServer_method_is_bus_mute>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_bus_solo<class_AudioServer_method_is_bus_solo>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`lock<class_AudioServer_method_lock>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`move_bus<class_AudioServer_method_move_bus>` **(** :ref:`int<class_int>` index, :ref:`int<class_int>` to_index **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_bus<class_AudioServer_method_remove_bus>` **(** :ref:`int<class_int>` index **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_bus_effect<class_AudioServer_method_remove_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_bypass_effects<class_AudioServer_method_set_bus_bypass_effects>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_effect_enabled<class_AudioServer_method_set_bus_effect_enabled>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`bool<class_bool>` enabled **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_layout<class_AudioServer_method_set_bus_layout>` **(** :ref:`AudioBusLayout<class_AudioBusLayout>` bus_layout **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_mute<class_AudioServer_method_set_bus_mute>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_name<class_AudioServer_method_set_bus_name>` **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` name **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_send<class_AudioServer_method_set_bus_send>` **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` send **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_solo<class_AudioServer_method_set_bus_solo>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bus_volume_db<class_AudioServer_method_set_bus_volume_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`float<class_float>` volume_db **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`swap_bus_effects<class_AudioServer_method_swap_bus_effects>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` by_effect_idx **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`unlock<class_AudioServer_method_unlock>` **(** **)** |
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_AudioServer_signal_bus_layout_changed:
- **bus_layout_changed** **(** **)**
.. rst-class:: classref-signal
**bus_layout_changed** **(** **)**
Emitted when the :ref:`AudioBusLayout<class_AudioBusLayout>` changes.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AudioServer_SpeakerMode:
.. _class_AudioServer_constant_SPEAKER_MODE_STEREO:
.. _class_AudioServer_constant_SPEAKER_SURROUND_31:
.. _class_AudioServer_constant_SPEAKER_SURROUND_51:
.. _class_AudioServer_constant_SPEAKER_SURROUND_71:
.. rst-class:: classref-enumeration
enum **SpeakerMode**:
- **SPEAKER_MODE_STEREO** = **0** --- Two or fewer speakers were detected.
.. _class_AudioServer_constant_SPEAKER_MODE_STEREO:
- **SPEAKER_SURROUND_31** = **1** --- A 3.1 channel surround setup was detected.
.. rst-class:: classref-enumeration-constant
- **SPEAKER_SURROUND_51** = **2** --- A 5.1 channel surround setup was detected.
:ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **SPEAKER_MODE_STEREO** = ``0``
- **SPEAKER_SURROUND_71** = **3** --- A 7.1 channel surround setup was detected.
Two or fewer speakers were detected.
.. _class_AudioServer_constant_SPEAKER_SURROUND_31:
.. rst-class:: classref-enumeration-constant
:ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **SPEAKER_SURROUND_31** = ``1``
A 3.1 channel surround setup was detected.
.. _class_AudioServer_constant_SPEAKER_SURROUND_51:
.. rst-class:: classref-enumeration-constant
:ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **SPEAKER_SURROUND_51** = ``2``
A 5.1 channel surround setup was detected.
.. _class_AudioServer_constant_SPEAKER_SURROUND_71:
.. rst-class:: classref-enumeration-constant
:ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **SPEAKER_SURROUND_71** = ``3``
A 7.1 channel surround setup was detected.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioServer_property_bus_count:
- :ref:`int<class_int>` **bus_count**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``1`` |
+-----------+----------------------+
| *Setter* | set_bus_count(value) |
+-----------+----------------------+
| *Getter* | get_bus_count() |
+-----------+----------------------+
:ref:`int<class_int>` **bus_count** = ``1``
.. rst-class:: classref-property-setget
- void **set_bus_count** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_bus_count** **(** **)**
Number of available audio buses.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_property_capture_device:
- :ref:`String<class_String>` **capture_device**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``"Default"`` |
+-----------+---------------------------+
| *Setter* | capture_set_device(value) |
+-----------+---------------------------+
| *Getter* | capture_get_device() |
+-----------+---------------------------+
:ref:`String<class_String>` **capture_device** = ``"Default"``
.. rst-class:: classref-property-setget
- void **capture_set_device** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **capture_get_device** **(** **)**
Name of the current device for audio input (see :ref:`capture_get_device_list<class_AudioServer_method_capture_get_device_list>`). On systems with multiple audio inputs (such as analog, USB and HDMI audio), this can be used to select the audio input device. The value ``"Default"`` will record audio on the system-wide default audio input. If an invalid device name is set, the value will be reverted back to ``"Default"``.
\ **Note:** :ref:`ProjectSettings.audio/enable_audio_input<class_ProjectSettings_property_audio/enable_audio_input>` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_property_device:
- :ref:`String<class_String>` **device**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``"Default"`` |
+-----------+-------------------+
| *Setter* | set_device(value) |
+-----------+-------------------+
| *Getter* | get_device() |
+-----------+-------------------+
:ref:`String<class_String>` **device** = ``"Default"``
.. rst-class:: classref-property-setget
- void **set_device** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_device** **(** **)**
Name of the current device for audio output (see :ref:`get_device_list<class_AudioServer_method_get_device_list>`). On systems with multiple audio outputs (such as analog, USB and HDMI audio), this can be used to select the audio output device. The value ``"Default"`` will play audio on the system-wide default audio output. If an invalid device name is set, the value will be reverted back to ``"Default"``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_property_global_rate_scale:
- :ref:`float<class_float>` **global_rate_scale**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------------+
| *Setter* | set_global_rate_scale(value) |
+-----------+------------------------------+
| *Getter* | get_global_rate_scale() |
+-----------+------------------------------+
:ref:`float<class_float>` **global_rate_scale** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_global_rate_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_global_rate_scale** **(** **)**
Scales the rate at which audio is played (i.e. setting it to ``0.5`` will make the audio be played twice as fast).
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AudioServer_method_add_bus:
- void **add_bus** **(** :ref:`int<class_int>` at_position=-1 **)**
.. rst-class:: classref-method
void **add_bus** **(** :ref:`int<class_int>` at_position=-1 **)**
Adds a bus at ``at_position``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_add_bus_effect:
- void **add_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`AudioEffect<class_AudioEffect>` effect, :ref:`int<class_int>` at_position=-1 **)**
.. rst-class:: classref-method
void **add_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`AudioEffect<class_AudioEffect>` effect, :ref:`int<class_int>` at_position=-1 **)**
Adds an :ref:`AudioEffect<class_AudioEffect>` effect to the bus ``bus_idx`` at ``at_position``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_capture_get_device_list:
- :ref:`Array<class_Array>` **capture_get_device_list** **(** **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **capture_get_device_list** **(** **)**
Returns the names of all audio input devices detected on the system.
\ **Note:** :ref:`ProjectSettings.audio/enable_audio_input<class_ProjectSettings_property_audio/enable_audio_input>` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_generate_bus_layout:
- :ref:`AudioBusLayout<class_AudioBusLayout>` **generate_bus_layout** **(** **)** |const|
.. rst-class:: classref-method
:ref:`AudioBusLayout<class_AudioBusLayout>` **generate_bus_layout** **(** **)** |const|
Generates an :ref:`AudioBusLayout<class_AudioBusLayout>` using the available buses and effects.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_bus_channels:
- :ref:`int<class_int>` **get_bus_channels** **(** :ref:`int<class_int>` bus_idx **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_bus_channels** **(** :ref:`int<class_int>` bus_idx **)** |const|
Returns the amount of channels of the bus at index ``bus_idx``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_bus_effect:
- :ref:`AudioEffect<class_AudioEffect>` **get_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)**
.. rst-class:: classref-method
:ref:`AudioEffect<class_AudioEffect>` **get_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)**
Returns the :ref:`AudioEffect<class_AudioEffect>` at position ``effect_idx`` in bus ``bus_idx``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_bus_effect_count:
- :ref:`int<class_int>` **get_bus_effect_count** **(** :ref:`int<class_int>` bus_idx **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **get_bus_effect_count** **(** :ref:`int<class_int>` bus_idx **)**
Returns the number of effects on the bus at ``bus_idx``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_bus_effect_instance:
- :ref:`AudioEffectInstance<class_AudioEffectInstance>` **get_bus_effect_instance** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` channel=0 **)**
.. rst-class:: classref-method
:ref:`AudioEffectInstance<class_AudioEffectInstance>` **get_bus_effect_instance** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` channel=0 **)**
Returns the :ref:`AudioEffectInstance<class_AudioEffectInstance>` assigned to the given bus and effect indices (and optionally channel).
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_bus_index:
- :ref:`int<class_int>` **get_bus_index** **(** :ref:`String<class_String>` bus_name **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_bus_index** **(** :ref:`String<class_String>` bus_name **)** |const|
Returns the index of the bus with the name ``bus_name``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_bus_name:
- :ref:`String<class_String>` **get_bus_name** **(** :ref:`int<class_int>` bus_idx **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_bus_name** **(** :ref:`int<class_int>` bus_idx **)** |const|
Returns the name of the bus with the index ``bus_idx``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_bus_peak_volume_left_db:
- :ref:`float<class_float>` **get_bus_peak_volume_left_db** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_bus_peak_volume_left_db** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const|
Returns the peak volume of the left speaker at bus index ``bus_idx`` and channel index ``channel``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_bus_peak_volume_right_db:
- :ref:`float<class_float>` **get_bus_peak_volume_right_db** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_bus_peak_volume_right_db** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const|
Returns the peak volume of the right speaker at bus index ``bus_idx`` and channel index ``channel``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_bus_send:
- :ref:`String<class_String>` **get_bus_send** **(** :ref:`int<class_int>` bus_idx **)** |const|
.. rst-class:: classref-method
:ref:`String<class_String>` **get_bus_send** **(** :ref:`int<class_int>` bus_idx **)** |const|
Returns the name of the bus that the bus at index ``bus_idx`` sends to.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_bus_volume_db:
- :ref:`float<class_float>` **get_bus_volume_db** **(** :ref:`int<class_int>` bus_idx **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_bus_volume_db** **(** :ref:`int<class_int>` bus_idx **)** |const|
Returns the volume of the bus at index ``bus_idx`` in dB.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_device_list:
- :ref:`Array<class_Array>` **get_device_list** **(** **)**
.. rst-class:: classref-method
:ref:`Array<class_Array>` **get_device_list** **(** **)**
Returns the names of all audio devices detected on the system.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_mix_rate:
- :ref:`float<class_float>` **get_mix_rate** **(** **)** |const|
.. rst-class:: classref-method
Returns the sample rate at the output of the ``AudioServer``.
:ref:`float<class_float>` **get_mix_rate** **(** **)** |const|
Returns the sample rate at the output of the **AudioServer**.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_output_latency:
- :ref:`float<class_float>` **get_output_latency** **(** **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_output_latency** **(** **)** |const|
Returns the audio driver's output latency.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_speaker_mode:
- :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **get_speaker_mode** **(** **)** |const|
.. rst-class:: classref-method
:ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **get_speaker_mode** **(** **)** |const|
Returns the speaker configuration.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_time_since_last_mix:
- :ref:`float<class_float>` **get_time_since_last_mix** **(** **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_time_since_last_mix** **(** **)** |const|
Returns the relative time since the last mix occurred.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_get_time_to_next_mix:
- :ref:`float<class_float>` **get_time_to_next_mix** **(** **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_time_to_next_mix** **(** **)** |const|
Returns the relative time until the next mix occurs.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_is_bus_bypassing_effects:
- :ref:`bool<class_bool>` **is_bus_bypassing_effects** **(** :ref:`int<class_int>` bus_idx **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_bus_bypassing_effects** **(** :ref:`int<class_int>` bus_idx **)** |const|
If ``true``, the bus at index ``bus_idx`` is bypassing effects.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_is_bus_effect_enabled:
- :ref:`bool<class_bool>` **is_bus_effect_enabled** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_bus_effect_enabled** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |const|
If ``true``, the effect at index ``effect_idx`` on the bus at index ``bus_idx`` is enabled.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_is_bus_mute:
- :ref:`bool<class_bool>` **is_bus_mute** **(** :ref:`int<class_int>` bus_idx **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_bus_mute** **(** :ref:`int<class_int>` bus_idx **)** |const|
If ``true``, the bus at index ``bus_idx`` is muted.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_is_bus_solo:
- :ref:`bool<class_bool>` **is_bus_solo** **(** :ref:`int<class_int>` bus_idx **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_bus_solo** **(** :ref:`int<class_int>` bus_idx **)** |const|
If ``true``, the bus at index ``bus_idx`` is in solo mode.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_lock:
- void **lock** **(** **)**
.. rst-class:: classref-method
void **lock** **(** **)**
Locks the audio driver's main loop.
\ **Note:** Remember to unlock it afterwards.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_move_bus:
- void **move_bus** **(** :ref:`int<class_int>` index, :ref:`int<class_int>` to_index **)**
.. rst-class:: classref-method
void **move_bus** **(** :ref:`int<class_int>` index, :ref:`int<class_int>` to_index **)**
Moves the bus from index ``index`` to index ``to_index``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_remove_bus:
- void **remove_bus** **(** :ref:`int<class_int>` index **)**
.. rst-class:: classref-method
void **remove_bus** **(** :ref:`int<class_int>` index **)**
Removes the bus at index ``index``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_remove_bus_effect:
- void **remove_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)**
.. rst-class:: classref-method
void **remove_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)**
Removes the effect at index ``effect_idx`` from the bus at index ``bus_idx``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_set_bus_bypass_effects:
- void **set_bus_bypass_effects** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
.. rst-class:: classref-method
void **set_bus_bypass_effects** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
If ``true``, the bus at index ``bus_idx`` is bypassing effects.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_set_bus_effect_enabled:
- void **set_bus_effect_enabled** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`bool<class_bool>` enabled **)**
.. rst-class:: classref-method
void **set_bus_effect_enabled** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`bool<class_bool>` enabled **)**
If ``true``, the effect at index ``effect_idx`` on the bus at index ``bus_idx`` is enabled.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_set_bus_layout:
- void **set_bus_layout** **(** :ref:`AudioBusLayout<class_AudioBusLayout>` bus_layout **)**
.. rst-class:: classref-method
void **set_bus_layout** **(** :ref:`AudioBusLayout<class_AudioBusLayout>` bus_layout **)**
Overwrites the currently used :ref:`AudioBusLayout<class_AudioBusLayout>`.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_set_bus_mute:
- void **set_bus_mute** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
.. rst-class:: classref-method
void **set_bus_mute** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
If ``true``, the bus at index ``bus_idx`` is muted.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_set_bus_name:
- void **set_bus_name** **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` name **)**
.. rst-class:: classref-method
void **set_bus_name** **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` name **)**
Sets the name of the bus at index ``bus_idx`` to ``name``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_set_bus_send:
- void **set_bus_send** **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` send **)**
.. rst-class:: classref-method
void **set_bus_send** **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` send **)**
Connects the output of the bus at ``bus_idx`` to the bus named ``send``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_set_bus_solo:
- void **set_bus_solo** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
.. rst-class:: classref-method
void **set_bus_solo** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
If ``true``, the bus at index ``bus_idx`` is in solo mode.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_set_bus_volume_db:
- void **set_bus_volume_db** **(** :ref:`int<class_int>` bus_idx, :ref:`float<class_float>` volume_db **)**
.. rst-class:: classref-method
void **set_bus_volume_db** **(** :ref:`int<class_int>` bus_idx, :ref:`float<class_float>` volume_db **)**
Sets the volume of the bus at index ``bus_idx`` to ``volume_db``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_swap_bus_effects:
- void **swap_bus_effects** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` by_effect_idx **)**
.. rst-class:: classref-method
void **swap_bus_effects** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` by_effect_idx **)**
Swaps the position of two effects in bus ``bus_idx``.
.. rst-class:: classref-item-separator
----
.. _class_AudioServer_method_unlock:
- void **unlock** **(** **)**
.. rst-class:: classref-method
void **unlock** **(** **)**
Unlocks the audio driver's main loop. (After locking it, you should always unlock it.)
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -12,15 +12,19 @@ AudioStream
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`AudioStreamGenerator<class_AudioStreamGenerator>`, :ref:`AudioStreamMP3<class_AudioStreamMP3>`, :ref:`AudioStreamMicrophone<class_AudioStreamMicrophone>`, :ref:`AudioStreamOGGVorbis<class_AudioStreamOGGVorbis>`, :ref:`AudioStreamRandomPitch<class_AudioStreamRandomPitch>`, :ref:`AudioStreamSample<class_AudioStreamSample>`
**Inherited By:** :ref:`AudioStreamGenerator<class_AudioStreamGenerator>`, :ref:`AudioStreamMicrophone<class_AudioStreamMicrophone>`, :ref:`AudioStreamMP3<class_AudioStreamMP3>`, :ref:`AudioStreamOGGVorbis<class_AudioStreamOGGVorbis>`, :ref:`AudioStreamRandomPitch<class_AudioStreamRandomPitch>`, :ref:`AudioStreamSample<class_AudioStreamSample>`
Base class for audio streams.
.. rst-class:: classref-introduction-group
Description
-----------
Base class for audio streams. Audio streams are used for sound effects and music playback, and support WAV (via :ref:`AudioStreamSample<class_AudioStreamSample>`) and OGG (via :ref:`AudioStreamOGGVorbis<class_AudioStreamOGGVorbis>`) file formats.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -32,22 +36,36 @@ Tutorials
- `Audio Spectrum Demo <https://godotengine.org/asset-library/asset/528>`__
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------+----------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_length<class_AudioStream_method_get_length>` **(** **)** |const| |
+---------------------------+----------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------+----------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_length<class_AudioStream_method_get_length>` **(** **)** |const| |
+---------------------------+----------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AudioStream_method_get_length:
- :ref:`float<class_float>` **get_length** **(** **)** |const|
.. rst-class:: classref-method
:ref:`float<class_float>` **get_length** **(** **)** |const|
Returns the length of the audio stream in seconds.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioStreamGenerator
Audio stream that generates sounds procedurally.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,6 +25,8 @@ See also :ref:`AudioEffectSpectrumAnalyzer<class_AudioEffectSpectrumAnalyzer>` f
\ **Note:** Due to performance constraints, this class is best used from C# or from a compiled language via GDNative. If you still want to use this class from GDScript, consider using a lower :ref:`mix_rate<class_AudioStreamGenerator_property_mix_rate>` such as 11,025 Hz or 22,050 Hz.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -30,45 +34,56 @@ Tutorials
- `Godot 3.2 will get new audio features <https://godotengine.org/article/godot-32-will-get-new-audio-features>`__
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------+-------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`buffer_length<class_AudioStreamGenerator_property_buffer_length>` | ``0.5`` |
+---------------------------+-------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`mix_rate<class_AudioStreamGenerator_property_mix_rate>` | ``44100.0`` |
+---------------------------+-------------------------------------------------------------------------+-------------+
.. table::
:widths: auto
+---------------------------+-------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`buffer_length<class_AudioStreamGenerator_property_buffer_length>` | ``0.5`` |
+---------------------------+-------------------------------------------------------------------------+-------------+
| :ref:`float<class_float>` | :ref:`mix_rate<class_AudioStreamGenerator_property_mix_rate>` | ``44100.0`` |
+---------------------------+-------------------------------------------------------------------------+-------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioStreamGenerator_property_buffer_length:
- :ref:`float<class_float>` **buffer_length**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``0.5`` |
+-----------+--------------------------+
| *Setter* | set_buffer_length(value) |
+-----------+--------------------------+
| *Getter* | get_buffer_length() |
+-----------+--------------------------+
:ref:`float<class_float>` **buffer_length** = ``0.5``
.. rst-class:: classref-property-setget
- void **set_buffer_length** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_buffer_length** **(** **)**
The length of the buffer to generate (in seconds). Lower values result in less latency, but require the script to generate audio data faster, resulting in increased CPU usage and more risk for audio cracking if the CPU can't keep up.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamGenerator_property_mix_rate:
- :ref:`float<class_float>` **mix_rate**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``44100.0`` |
+-----------+---------------------+
| *Setter* | set_mix_rate(value) |
+-----------+---------------------+
| *Getter* | get_mix_rate() |
+-----------+---------------------+
:ref:`float<class_float>` **mix_rate** = ``44100.0``
.. rst-class:: classref-property-setget
- void **set_mix_rate** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_mix_rate** **(** **)**
The sample rate to use (in Hz). Higher values are more demanding for the CPU to generate, but result in better quality.
@@ -79,3 +94,4 @@ According to the `Nyquist-Shannon sampling theorem <https://en.wikipedia.org/wik
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,11 +14,15 @@ AudioStreamGeneratorPlayback
Plays back audio generated using :ref:`AudioStreamGenerator<class_AudioStreamGenerator>`.
.. rst-class:: classref-introduction-group
Description
-----------
This class is meant to be used with :ref:`AudioStreamGenerator<class_AudioStreamGenerator>` to play back the generated audio in real-time.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -26,70 +30,108 @@ Tutorials
- `Godot 3.2 will get new audio features <https://godotengine.org/article/godot-32-will-get-new-audio-features>`__
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`can_push_buffer<class_AudioStreamGeneratorPlayback_method_can_push_buffer>` **(** :ref:`int<class_int>` amount **)** |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_buffer<class_AudioStreamGeneratorPlayback_method_clear_buffer>` **(** **)** |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_frames_available<class_AudioStreamGeneratorPlayback_method_get_frames_available>` **(** **)** |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_skips<class_AudioStreamGeneratorPlayback_method_get_skips>` **(** **)** |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>` **(** :ref:`PoolVector2Array<class_PoolVector2Array>` frames **)** |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>` **(** :ref:`Vector2<class_Vector2>` frame **)** |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`can_push_buffer<class_AudioStreamGeneratorPlayback_method_can_push_buffer>` **(** :ref:`int<class_int>` amount **)** |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_buffer<class_AudioStreamGeneratorPlayback_method_clear_buffer>` **(** **)** |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_frames_available<class_AudioStreamGeneratorPlayback_method_get_frames_available>` **(** **)** |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_skips<class_AudioStreamGeneratorPlayback_method_get_skips>` **(** **)** |const| |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>` **(** :ref:`PoolVector2Array<class_PoolVector2Array>` frames **)** |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>` **(** :ref:`Vector2<class_Vector2>` frame **)** |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AudioStreamGeneratorPlayback_method_can_push_buffer:
- :ref:`bool<class_bool>` **can_push_buffer** **(** :ref:`int<class_int>` amount **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **can_push_buffer** **(** :ref:`int<class_int>` amount **)** |const|
Returns ``true`` if a buffer of the size ``amount`` can be pushed to the audio sample data buffer without overflowing it, ``false`` otherwise.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamGeneratorPlayback_method_clear_buffer:
- void **clear_buffer** **(** **)**
.. rst-class:: classref-method
void **clear_buffer** **(** **)**
Clears the audio sample data buffer.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamGeneratorPlayback_method_get_frames_available:
- :ref:`int<class_int>` **get_frames_available** **(** **)** |const|
.. rst-class:: classref-method
Returns the number of audio data frames left to play. If this returned number reaches ``0``, the audio will stop playing until frames are added again. Therefore, make sure your script can always generate and push new audio frames fast enough to avoid audio cracking.
:ref:`int<class_int>` **get_frames_available** **(** **)** |const|
Returns the number of frames that can be pushed to the audio sample data buffer without overflowing it. If the result is ``0``, the buffer is full.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamGeneratorPlayback_method_get_skips:
- :ref:`int<class_int>` **get_skips** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_skips** **(** **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamGeneratorPlayback_method_push_buffer:
- :ref:`bool<class_bool>` **push_buffer** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` frames **)**
.. rst-class:: classref-method
:ref:`bool<class_bool>` **push_buffer** **(** :ref:`PoolVector2Array<class_PoolVector2Array>` frames **)**
Pushes several audio data frames to the buffer. This is usually more efficient than :ref:`push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>` in C# and compiled languages via GDNative, but :ref:`push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>` may be *less* efficient in GDScript.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamGeneratorPlayback_method_push_frame:
- :ref:`bool<class_bool>` **push_frame** **(** :ref:`Vector2<class_Vector2>` frame **)**
.. rst-class:: classref-method
:ref:`bool<class_bool>` **push_frame** **(** :ref:`Vector2<class_Vector2>` frame **)**
Pushes a single audio data frame to the buffer. This is usually less efficient than :ref:`push_buffer<class_AudioStreamGeneratorPlayback_method_push_buffer>` in C# and compiled languages via GDNative, but :ref:`push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>` may be *more* efficient in GDScript.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,13 +14,17 @@ AudioStreamMicrophone
Plays real-time audio input data.
.. rst-class:: classref-introduction-group
Description
-----------
When used directly in an :ref:`AudioStreamPlayer<class_AudioStreamPlayer>` node, ``AudioStreamMicrophone`` plays back microphone input in real-time. This can be used in conjunction with :ref:`AudioEffectCapture<class_AudioEffectCapture>` to process the data or save it.
When used directly in an :ref:`AudioStreamPlayer<class_AudioStreamPlayer>` node, **AudioStreamMicrophone** plays back microphone input in real-time. This can be used in conjunction with :ref:`AudioEffectCapture<class_AudioEffectCapture>` to process the data or save it.
\ **Note:** :ref:`ProjectSettings.audio/enable_audio_input<class_ProjectSettings_property_audio/enable_audio_input>` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -29,3 +33,4 @@ Tutorials
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,71 +14,86 @@ AudioStreamMP3
MP3 audio stream driver.
.. rst-class:: classref-introduction-group
Description
-----------
MP3 audio stream driver.
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`data<class_AudioStreamMP3_property_data>` | ``PoolByteArray( )`` |
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`loop<class_AudioStreamMP3_property_loop>` | ``false`` |
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
| :ref:`float<class_float>` | :ref:`loop_offset<class_AudioStreamMP3_property_loop_offset>` | ``0.0`` |
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
.. table::
:widths: auto
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`data<class_AudioStreamMP3_property_data>` | ``PoolByteArray( )`` |
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`loop<class_AudioStreamMP3_property_loop>` | ``false`` |
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
| :ref:`float<class_float>` | :ref:`loop_offset<class_AudioStreamMP3_property_loop_offset>` | ``0.0`` |
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioStreamMP3_property_data:
- :ref:`PoolByteArray<class_PoolByteArray>` **data**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``PoolByteArray( )`` |
+-----------+-----------------------+
| *Setter* | set_data(value) |
+-----------+-----------------------+
| *Getter* | get_data() |
+-----------+-----------------------+
:ref:`PoolByteArray<class_PoolByteArray>` **data** = ``PoolByteArray( )``
.. rst-class:: classref-property-setget
- void **set_data** **(** :ref:`PoolByteArray<class_PoolByteArray>` value **)**
- :ref:`PoolByteArray<class_PoolByteArray>` **get_data** **(** **)**
Contains the audio data in bytes.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamMP3_property_loop:
- :ref:`bool<class_bool>` **loop**
.. rst-class:: classref-property
+-----------+-----------------+
| *Default* | ``false`` |
+-----------+-----------------+
| *Setter* | set_loop(value) |
+-----------+-----------------+
| *Getter* | has_loop() |
+-----------+-----------------+
:ref:`bool<class_bool>` **loop** = ``false``
.. rst-class:: classref-property-setget
- void **set_loop** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **has_loop** **(** **)**
If ``true``, the stream will automatically loop when it reaches the end.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamMP3_property_loop_offset:
- :ref:`float<class_float>` **loop_offset**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``0.0`` |
+-----------+------------------------+
| *Setter* | set_loop_offset(value) |
+-----------+------------------------+
| *Getter* | get_loop_offset() |
+-----------+------------------------+
:ref:`float<class_float>` **loop_offset** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_loop_offset** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_loop_offset** **(** **)**
Time in seconds at which the stream starts after being looped.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,71 +14,86 @@ AudioStreamOGGVorbis
OGG Vorbis audio stream driver.
.. rst-class:: classref-introduction-group
Description
-----------
OGG Vorbis audio stream driver.
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`data<class_AudioStreamOGGVorbis_property_data>` | ``PoolByteArray( )`` |
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`loop<class_AudioStreamOGGVorbis_property_loop>` | ``false`` |
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
| :ref:`float<class_float>` | :ref:`loop_offset<class_AudioStreamOGGVorbis_property_loop_offset>` | ``0.0`` |
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
.. table::
:widths: auto
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`data<class_AudioStreamOGGVorbis_property_data>` | ``PoolByteArray( )`` |
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`loop<class_AudioStreamOGGVorbis_property_loop>` | ``false`` |
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
| :ref:`float<class_float>` | :ref:`loop_offset<class_AudioStreamOGGVorbis_property_loop_offset>` | ``0.0`` |
+-------------------------------------------+---------------------------------------------------------------------+-----------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioStreamOGGVorbis_property_data:
- :ref:`PoolByteArray<class_PoolByteArray>` **data**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``PoolByteArray( )`` |
+-----------+-----------------------+
| *Setter* | set_data(value) |
+-----------+-----------------------+
| *Getter* | get_data() |
+-----------+-----------------------+
:ref:`PoolByteArray<class_PoolByteArray>` **data** = ``PoolByteArray( )``
.. rst-class:: classref-property-setget
- void **set_data** **(** :ref:`PoolByteArray<class_PoolByteArray>` value **)**
- :ref:`PoolByteArray<class_PoolByteArray>` **get_data** **(** **)**
Contains the audio data in bytes.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamOGGVorbis_property_loop:
- :ref:`bool<class_bool>` **loop**
.. rst-class:: classref-property
+-----------+-----------------+
| *Default* | ``false`` |
+-----------+-----------------+
| *Setter* | set_loop(value) |
+-----------+-----------------+
| *Getter* | has_loop() |
+-----------+-----------------+
:ref:`bool<class_bool>` **loop** = ``false``
.. rst-class:: classref-property-setget
- void **set_loop** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **has_loop** **(** **)**
If ``true``, the stream will automatically loop when it reaches the end.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamOGGVorbis_property_loop_offset:
- :ref:`float<class_float>` **loop_offset**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``0.0`` |
+-----------+------------------------+
| *Setter* | set_loop_offset(value) |
+-----------+------------------------+
| *Getter* | get_loop_offset() |
+-----------+------------------------+
:ref:`float<class_float>` **loop_offset** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_loop_offset** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_loop_offset** **(** **)**
Time in seconds at which the stream starts after being looped.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,11 +16,15 @@ AudioStreamPlayback
Meta class for playing back audio.
.. rst-class:: classref-introduction-group
Description
-----------
Can play, loop, pause a scroll through audio. See :ref:`AudioStream<class_AudioStream>` and :ref:`AudioStreamOGGVorbis<class_AudioStreamOGGVorbis>` for usage.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -29,3 +33,4 @@ Tutorials
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,8 +14,11 @@ AudioStreamPlaybackResampled
**Inherited By:** :ref:`AudioStreamGeneratorPlayback<class_AudioStreamGeneratorPlayback>`
.. container:: contribute
There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,12 +14,16 @@ AudioStreamPlayer
Plays back audio non-positionally.
.. rst-class:: classref-introduction-group
Description
-----------
Plays an audio stream non-positionally.
To play audio positionally, use :ref:`AudioStreamPlayer2D<class_AudioStreamPlayer2D>` or :ref:`AudioStreamPlayer3D<class_AudioStreamPlayer3D>` instead of ``AudioStreamPlayer``.
To play audio positionally, use :ref:`AudioStreamPlayer2D<class_AudioStreamPlayer2D>` or :ref:`AudioStreamPlayer3D<class_AudioStreamPlayer3D>` instead of **AudioStreamPlayer**.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -36,238 +40,316 @@ Tutorials
- `Audio Spectrum Demo <https://godotengine.org/asset-library/asset/528>`__
.. rst-class:: classref-reftable-group
Properties
----------
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`autoplay<class_AudioStreamPlayer_property_autoplay>` | ``false`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`String<class_String>` | :ref:`bus<class_AudioStreamPlayer_property_bus>` | ``"Master"`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` | :ref:`mix_target<class_AudioStreamPlayer_property_mix_target>` | ``0`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer_property_pitch_scale>` | ``1.0`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer_property_playing>` | ``false`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer_property_stream>` | |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer_property_stream_paused>` | ``false`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioStreamPlayer_property_volume_db>` | ``0.0`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
.. table::
:widths: auto
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`autoplay<class_AudioStreamPlayer_property_autoplay>` | ``false`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`String<class_String>` | :ref:`bus<class_AudioStreamPlayer_property_bus>` | ``"Master"`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` | :ref:`mix_target<class_AudioStreamPlayer_property_mix_target>` | ``0`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer_property_pitch_scale>` | ``1.0`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer_property_playing>` | ``false`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer_property_stream>` | |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer_property_stream_paused>` | ``false`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioStreamPlayer_property_volume_db>` | ``0.0`` |
+----------------------------------------------------+----------------------------------------------------------------------+--------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer_method_get_playback_position>` **(** **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer_method_get_stream_playback>` **(** **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AudioStreamPlayer_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AudioStreamPlayer_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AudioStreamPlayer_method_stop>` **(** **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer_method_get_playback_position>` **(** **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer_method_get_stream_playback>` **(** **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AudioStreamPlayer_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AudioStreamPlayer_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AudioStreamPlayer_method_stop>` **(** **)** |
+-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_AudioStreamPlayer_signal_finished:
- **finished** **(** **)**
.. rst-class:: classref-signal
**finished** **(** **)**
Emitted when the audio stops playing.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AudioStreamPlayer_MixTarget:
.. _class_AudioStreamPlayer_constant_MIX_TARGET_STEREO:
.. _class_AudioStreamPlayer_constant_MIX_TARGET_SURROUND:
.. _class_AudioStreamPlayer_constant_MIX_TARGET_CENTER:
.. rst-class:: classref-enumeration
enum **MixTarget**:
- **MIX_TARGET_STEREO** = **0** --- The audio will be played only on the first channel.
.. _class_AudioStreamPlayer_constant_MIX_TARGET_STEREO:
- **MIX_TARGET_SURROUND** = **1** --- The audio will be played on all surround channels.
.. rst-class:: classref-enumeration-constant
- **MIX_TARGET_CENTER** = **2** --- The audio will be played on the second channel, which is usually the center.
:ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` **MIX_TARGET_STEREO** = ``0``
The audio will be played only on the first channel.
.. _class_AudioStreamPlayer_constant_MIX_TARGET_SURROUND:
.. rst-class:: classref-enumeration-constant
:ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` **MIX_TARGET_SURROUND** = ``1``
The audio will be played on all surround channels.
.. _class_AudioStreamPlayer_constant_MIX_TARGET_CENTER:
.. rst-class:: classref-enumeration-constant
:ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` **MIX_TARGET_CENTER** = ``2``
The audio will be played on the second channel, which is usually the center.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioStreamPlayer_property_autoplay:
- :ref:`bool<class_bool>` **autoplay**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``false`` |
+-----------+-----------------------+
| *Setter* | set_autoplay(value) |
+-----------+-----------------------+
| *Getter* | is_autoplay_enabled() |
+-----------+-----------------------+
:ref:`bool<class_bool>` **autoplay** = ``false``
.. rst-class:: classref-property-setget
- void **set_autoplay** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
If ``true``, audio plays when added to scene tree.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer_property_bus:
- :ref:`String<class_String>` **bus**
.. rst-class:: classref-property
+-----------+----------------+
| *Default* | ``"Master"`` |
+-----------+----------------+
| *Setter* | set_bus(value) |
+-----------+----------------+
| *Getter* | get_bus() |
+-----------+----------------+
:ref:`String<class_String>` **bus** = ``"Master"``
.. rst-class:: classref-property-setget
- void **set_bus** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_bus** **(** **)**
Bus on which this audio is playing.
\ **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to ``"Master"``.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer_property_mix_target:
- :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` **mix_target**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``0`` |
+-----------+-----------------------+
| *Setter* | set_mix_target(value) |
+-----------+-----------------------+
| *Getter* | get_mix_target() |
+-----------+-----------------------+
:ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` **mix_target** = ``0``
.. rst-class:: classref-property-setget
- void **set_mix_target** **(** :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` value **)**
- :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` **get_mix_target** **(** **)**
If the audio configuration has more than two speakers, this sets the target channels. See :ref:`MixTarget<enum_AudioStreamPlayer_MixTarget>` constants.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer_property_pitch_scale:
- :ref:`float<class_float>` **pitch_scale**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_pitch_scale(value) |
+-----------+------------------------+
| *Getter* | get_pitch_scale() |
+-----------+------------------------+
:ref:`float<class_float>` **pitch_scale** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_pitch_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_pitch_scale** **(** **)**
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer_property_playing:
- :ref:`bool<class_bool>` **playing**
.. rst-class:: classref-property
+-----------+--------------+
| *Default* | ``false`` |
+-----------+--------------+
| *Getter* | is_playing() |
+-----------+--------------+
:ref:`bool<class_bool>` **playing** = ``false``
.. rst-class:: classref-property-setget
- :ref:`bool<class_bool>` **is_playing** **(** **)**
If ``true``, audio is playing.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer_property_stream:
- :ref:`AudioStream<class_AudioStream>` **stream**
.. rst-class:: classref-property
+----------+-------------------+
| *Setter* | set_stream(value) |
+----------+-------------------+
| *Getter* | get_stream() |
+----------+-------------------+
:ref:`AudioStream<class_AudioStream>` **stream**
.. rst-class:: classref-property-setget
- void **set_stream** **(** :ref:`AudioStream<class_AudioStream>` value **)**
- :ref:`AudioStream<class_AudioStream>` **get_stream** **(** **)**
The :ref:`AudioStream<class_AudioStream>` object to be played.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer_property_stream_paused:
- :ref:`bool<class_bool>` **stream_paused**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``false`` |
+-----------+--------------------------+
| *Setter* | set_stream_paused(value) |
+-----------+--------------------------+
| *Getter* | get_stream_paused() |
+-----------+--------------------------+
:ref:`bool<class_bool>` **stream_paused** = ``false``
.. rst-class:: classref-property-setget
- void **set_stream_paused** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_stream_paused** **(** **)**
If ``true``, the playback is paused. You can resume it by setting ``stream_paused`` to ``false``.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer_property_volume_db:
- :ref:`float<class_float>` **volume_db**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``0.0`` |
+-----------+----------------------+
| *Setter* | set_volume_db(value) |
+-----------+----------------------+
| *Getter* | get_volume_db() |
+-----------+----------------------+
:ref:`float<class_float>` **volume_db** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_volume_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_volume_db** **(** **)**
Volume of sound, in dB.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AudioStreamPlayer_method_get_playback_position:
- :ref:`float<class_float>` **get_playback_position** **(** **)**
.. rst-class:: classref-method
:ref:`float<class_float>` **get_playback_position** **(** **)**
Returns the position in the :ref:`AudioStream<class_AudioStream>` in seconds.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer_method_get_stream_playback:
- :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
.. rst-class:: classref-method
Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this ``AudioStreamPlayer``.
:ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this **AudioStreamPlayer**.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer_method_play:
- void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
.. rst-class:: classref-method
void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
Plays the audio from the given ``from_position``, in seconds.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer_method_seek:
- void **seek** **(** :ref:`float<class_float>` to_position **)**
.. rst-class:: classref-method
void **seek** **(** :ref:`float<class_float>` to_position **)**
Sets the position from which audio will be played, in seconds.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer_method_stop:
- void **stop** **(** **)**
.. rst-class:: classref-method
void **stop** **(** **)**
Stops the audio.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioStreamPlayer2D
Plays positional sound in 2D space.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,280 +25,343 @@ By default, audio is heard from the screen center. This can be changed by adding
See also :ref:`AudioStreamPlayer<class_AudioStreamPlayer>` to play a sound non-positionally.
\ **Note:** Hiding an ``AudioStreamPlayer2D`` node does not disable its audio output. To temporarily disable an ``AudioStreamPlayer2D``'s audio output, set :ref:`volume_db<class_AudioStreamPlayer2D_property_volume_db>` to a very low value like ``-100`` (which isn't audible to human hearing).
\ **Note:** Hiding an **AudioStreamPlayer2D** node does not disable its audio output. To temporarily disable an **AudioStreamPlayer2D**'s audio output, set :ref:`volume_db<class_AudioStreamPlayer2D_property_volume_db>` to a very low value like ``-100`` (which isn't audible to human hearing).
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/audio/audio_streams`
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`int<class_int>` | :ref:`area_mask<class_AudioStreamPlayer2D_property_area_mask>` | ``1`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`attenuation<class_AudioStreamPlayer2D_property_attenuation>` | ``1.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`autoplay<class_AudioStreamPlayer2D_property_autoplay>` | ``false`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`String<class_String>` | :ref:`bus<class_AudioStreamPlayer2D_property_bus>` | ``"Master"`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`max_distance<class_AudioStreamPlayer2D_property_max_distance>` | ``2000.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`panning_strength<class_AudioStreamPlayer2D_property_panning_strength>` | ``1.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer2D_property_pitch_scale>` | ``1.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer2D_property_playing>` | ``false`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer2D_property_stream>` | |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer2D_property_stream_paused>` | ``false`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioStreamPlayer2D_property_volume_db>` | ``0.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
.. table::
:widths: auto
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`int<class_int>` | :ref:`area_mask<class_AudioStreamPlayer2D_property_area_mask>` | ``1`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`attenuation<class_AudioStreamPlayer2D_property_attenuation>` | ``1.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`autoplay<class_AudioStreamPlayer2D_property_autoplay>` | ``false`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`String<class_String>` | :ref:`bus<class_AudioStreamPlayer2D_property_bus>` | ``"Master"`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`max_distance<class_AudioStreamPlayer2D_property_max_distance>` | ``2000.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`panning_strength<class_AudioStreamPlayer2D_property_panning_strength>` | ``1.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer2D_property_pitch_scale>` | ``1.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer2D_property_playing>` | ``false`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer2D_property_stream>` | |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer2D_property_stream_paused>` | ``false`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioStreamPlayer2D_property_volume_db>` | ``0.0`` |
+---------------------------------------+------------------------------------------------------------------------------+--------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer2D_method_get_playback_position>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer2D_method_get_stream_playback>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AudioStreamPlayer2D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AudioStreamPlayer2D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AudioStreamPlayer2D_method_stop>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer2D_method_get_playback_position>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer2D_method_get_stream_playback>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AudioStreamPlayer2D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AudioStreamPlayer2D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AudioStreamPlayer2D_method_stop>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_AudioStreamPlayer2D_signal_finished:
- **finished** **(** **)**
.. rst-class:: classref-signal
**finished** **(** **)**
Emitted when the audio stops playing.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioStreamPlayer2D_property_area_mask:
- :ref:`int<class_int>` **area_mask**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``1`` |
+-----------+----------------------+
| *Setter* | set_area_mask(value) |
+-----------+----------------------+
| *Getter* | get_area_mask() |
+-----------+----------------------+
:ref:`int<class_int>` **area_mask** = ``1``
.. rst-class:: classref-property-setget
- void **set_area_mask** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_area_mask** **(** **)**
Determines which :ref:`Area2D<class_Area2D>` layers affect the sound for reverb and audio bus effects. Areas can be used to redirect :ref:`AudioStream<class_AudioStream>`\ s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_property_attenuation:
- :ref:`float<class_float>` **attenuation**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_attenuation(value) |
+-----------+------------------------+
| *Getter* | get_attenuation() |
+-----------+------------------------+
:ref:`float<class_float>` **attenuation** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_attenuation** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_attenuation** **(** **)**
Dampens audio over distance with this as an exponent.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_property_autoplay:
- :ref:`bool<class_bool>` **autoplay**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``false`` |
+-----------+-----------------------+
| *Setter* | set_autoplay(value) |
+-----------+-----------------------+
| *Getter* | is_autoplay_enabled() |
+-----------+-----------------------+
:ref:`bool<class_bool>` **autoplay** = ``false``
.. rst-class:: classref-property-setget
- void **set_autoplay** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
If ``true``, audio plays when added to scene tree.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_property_bus:
- :ref:`String<class_String>` **bus**
.. rst-class:: classref-property
+-----------+----------------+
| *Default* | ``"Master"`` |
+-----------+----------------+
| *Setter* | set_bus(value) |
+-----------+----------------+
| *Getter* | get_bus() |
+-----------+----------------+
:ref:`String<class_String>` **bus** = ``"Master"``
.. rst-class:: classref-property-setget
- void **set_bus** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_bus** **(** **)**
Bus on which this audio is playing.
\ **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to ``"Master"``.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_property_max_distance:
- :ref:`float<class_float>` **max_distance**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``2000.0`` |
+-----------+-------------------------+
| *Setter* | set_max_distance(value) |
+-----------+-------------------------+
| *Getter* | get_max_distance() |
+-----------+-------------------------+
:ref:`float<class_float>` **max_distance** = ``2000.0``
.. rst-class:: classref-property-setget
- void **set_max_distance** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_max_distance** **(** **)**
Maximum distance from which audio is still hearable.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_property_panning_strength:
- :ref:`float<class_float>` **panning_strength**
.. rst-class:: classref-property
+-----------+-----------------------------+
| *Default* | ``1.0`` |
+-----------+-----------------------------+
| *Setter* | set_panning_strength(value) |
+-----------+-----------------------------+
| *Getter* | get_panning_strength() |
+-----------+-----------------------------+
:ref:`float<class_float>` **panning_strength** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_panning_strength** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_panning_strength** **(** **)**
Scales the panning strength for this node by multiplying the base :ref:`ProjectSettings.audio/2d_panning_strength<class_ProjectSettings_property_audio/2d_panning_strength>` with this factor. Higher values will pan audio from left to right more dramatically than lower values.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_property_pitch_scale:
- :ref:`float<class_float>` **pitch_scale**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_pitch_scale(value) |
+-----------+------------------------+
| *Getter* | get_pitch_scale() |
+-----------+------------------------+
:ref:`float<class_float>` **pitch_scale** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_pitch_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_pitch_scale** **(** **)**
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_property_playing:
- :ref:`bool<class_bool>` **playing**
.. rst-class:: classref-property
+-----------+--------------+
| *Default* | ``false`` |
+-----------+--------------+
| *Getter* | is_playing() |
+-----------+--------------+
:ref:`bool<class_bool>` **playing** = ``false``
.. rst-class:: classref-property-setget
- :ref:`bool<class_bool>` **is_playing** **(** **)**
If ``true``, audio is playing.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_property_stream:
- :ref:`AudioStream<class_AudioStream>` **stream**
.. rst-class:: classref-property
+----------+-------------------+
| *Setter* | set_stream(value) |
+----------+-------------------+
| *Getter* | get_stream() |
+----------+-------------------+
:ref:`AudioStream<class_AudioStream>` **stream**
.. rst-class:: classref-property-setget
- void **set_stream** **(** :ref:`AudioStream<class_AudioStream>` value **)**
- :ref:`AudioStream<class_AudioStream>` **get_stream** **(** **)**
The :ref:`AudioStream<class_AudioStream>` object to be played.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_property_stream_paused:
- :ref:`bool<class_bool>` **stream_paused**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``false`` |
+-----------+--------------------------+
| *Setter* | set_stream_paused(value) |
+-----------+--------------------------+
| *Getter* | get_stream_paused() |
+-----------+--------------------------+
:ref:`bool<class_bool>` **stream_paused** = ``false``
.. rst-class:: classref-property-setget
- void **set_stream_paused** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_stream_paused** **(** **)**
If ``true``, the playback is paused. You can resume it by setting ``stream_paused`` to ``false``.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_property_volume_db:
- :ref:`float<class_float>` **volume_db**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``0.0`` |
+-----------+----------------------+
| *Setter* | set_volume_db(value) |
+-----------+----------------------+
| *Getter* | get_volume_db() |
+-----------+----------------------+
:ref:`float<class_float>` **volume_db** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_volume_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_volume_db** **(** **)**
Base volume without dampening.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AudioStreamPlayer2D_method_get_playback_position:
- :ref:`float<class_float>` **get_playback_position** **(** **)**
.. rst-class:: classref-method
:ref:`float<class_float>` **get_playback_position** **(** **)**
Returns the position in the :ref:`AudioStream<class_AudioStream>`.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_method_get_stream_playback:
- :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
.. rst-class:: classref-method
Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this ``AudioStreamPlayer2D``.
:ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this **AudioStreamPlayer2D**.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_method_play:
- void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
.. rst-class:: classref-method
void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
Plays the audio from the given position ``from_position``, in seconds.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_method_seek:
- void **seek** **(** :ref:`float<class_float>` to_position **)**
.. rst-class:: classref-method
void **seek** **(** :ref:`float<class_float>` to_position **)**
Sets the position from which audio will be played, in seconds.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer2D_method_stop:
- void **stop** **(** **)**
.. rst-class:: classref-method
void **stop** **(** **)**
Stops the audio.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioStreamPlayer3D
Plays positional sound in 3D space.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,499 +25,623 @@ By default, audio is heard from the camera position. This can be changed by addi
See also :ref:`AudioStreamPlayer<class_AudioStreamPlayer>` to play a sound non-positionally.
\ **Note:** Hiding an ``AudioStreamPlayer3D`` node does not disable its audio output. To temporarily disable an ``AudioStreamPlayer3D``'s audio output, set :ref:`unit_db<class_AudioStreamPlayer3D_property_unit_db>` to a very low value like ``-100`` (which isn't audible to human hearing).
\ **Note:** Hiding an **AudioStreamPlayer3D** node does not disable its audio output. To temporarily disable an **AudioStreamPlayer3D**'s audio output, set :ref:`unit_db<class_AudioStreamPlayer3D_property_unit_db>` to a very low value like ``-100`` (which isn't audible to human hearing).
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/audio/audio_streams`
.. rst-class:: classref-reftable-group
Properties
----------
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`int<class_int>` | :ref:`area_mask<class_AudioStreamPlayer3D_property_area_mask>` | ``1`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`attenuation_filter_cutoff_hz<class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz>` | ``5000.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`attenuation_filter_db<class_AudioStreamPlayer3D_property_attenuation_filter_db>` | ``-24.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` | :ref:`attenuation_model<class_AudioStreamPlayer3D_property_attenuation_model>` | ``0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`autoplay<class_AudioStreamPlayer3D_property_autoplay>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`String<class_String>` | :ref:`bus<class_AudioStreamPlayer3D_property_bus>` | ``"Master"`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` | :ref:`doppler_tracking<class_AudioStreamPlayer3D_property_doppler_tracking>` | ``0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`emission_angle_degrees<class_AudioStreamPlayer3D_property_emission_angle_degrees>` | ``45.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`emission_angle_enabled<class_AudioStreamPlayer3D_property_emission_angle_enabled>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`emission_angle_filter_attenuation_db<class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db>` | ``-12.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`max_db<class_AudioStreamPlayer3D_property_max_db>` | ``3.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` | ``0.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` | :ref:`out_of_range_mode<class_AudioStreamPlayer3D_property_out_of_range_mode>` | ``0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`panning_strength<class_AudioStreamPlayer3D_property_panning_strength>` | ``1.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer3D_property_pitch_scale>` | ``1.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer3D_property_playing>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer3D_property_stream>` | |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`unit_db<class_AudioStreamPlayer3D_property_unit_db>` | ``0.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>` | ``1.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
.. table::
:widths: auto
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`int<class_int>` | :ref:`area_mask<class_AudioStreamPlayer3D_property_area_mask>` | ``1`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`attenuation_filter_cutoff_hz<class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz>` | ``5000.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`attenuation_filter_db<class_AudioStreamPlayer3D_property_attenuation_filter_db>` | ``-24.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` | :ref:`attenuation_model<class_AudioStreamPlayer3D_property_attenuation_model>` | ``0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`autoplay<class_AudioStreamPlayer3D_property_autoplay>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`String<class_String>` | :ref:`bus<class_AudioStreamPlayer3D_property_bus>` | ``"Master"`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` | :ref:`doppler_tracking<class_AudioStreamPlayer3D_property_doppler_tracking>` | ``0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`emission_angle_degrees<class_AudioStreamPlayer3D_property_emission_angle_degrees>` | ``45.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`emission_angle_enabled<class_AudioStreamPlayer3D_property_emission_angle_enabled>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`emission_angle_filter_attenuation_db<class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db>` | ``-12.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`max_db<class_AudioStreamPlayer3D_property_max_db>` | ``3.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` | ``0.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` | :ref:`out_of_range_mode<class_AudioStreamPlayer3D_property_out_of_range_mode>` | ``0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`panning_strength<class_AudioStreamPlayer3D_property_panning_strength>` | ``1.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer3D_property_pitch_scale>` | ``1.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer3D_property_playing>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer3D_property_stream>` | |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` | ``false`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`unit_db<class_AudioStreamPlayer3D_property_unit_db>` | ``0.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
| :ref:`float<class_float>` | :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>` | ``1.0`` |
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer3D_method_get_playback_position>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer3D_method_get_stream_playback>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AudioStreamPlayer3D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AudioStreamPlayer3D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AudioStreamPlayer3D_method_stop>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer3D_method_get_playback_position>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer3D_method_get_stream_playback>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`play<class_AudioStreamPlayer3D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_AudioStreamPlayer3D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
| void | :ref:`stop<class_AudioStreamPlayer3D_method_stop>` **(** **)** |
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_AudioStreamPlayer3D_signal_finished:
- **finished** **(** **)**
.. rst-class:: classref-signal
**finished** **(** **)**
Emitted when the audio stops playing.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AudioStreamPlayer3D_AttenuationModel:
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_DISTANCE:
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_SQUARE_DISTANCE:
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_LOGARITHMIC:
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED:
.. rst-class:: classref-enumeration
enum **AttenuationModel**:
- **ATTENUATION_INVERSE_DISTANCE** = **0** --- Linear dampening of loudness according to distance.
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_DISTANCE:
- **ATTENUATION_INVERSE_SQUARE_DISTANCE** = **1** --- Squared dampening of loudness according to distance.
.. rst-class:: classref-enumeration-constant
- **ATTENUATION_LOGARITHMIC** = **2** --- Logarithmic dampening of loudness according to distance.
:ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_INVERSE_DISTANCE** = ``0``
- **ATTENUATION_DISABLED** = **3** --- No dampening of loudness according to distance. The sound will still be heard positionally, unlike an :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`. :ref:`ATTENUATION_DISABLED<class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED>` can be combined with a :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` value greater than ``0.0`` to achieve linear attenuation clamped to a sphere of a defined size.
Linear dampening of loudness according to distance.
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_SQUARE_DISTANCE:
.. rst-class:: classref-enumeration-constant
:ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_INVERSE_SQUARE_DISTANCE** = ``1``
Squared dampening of loudness according to distance.
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_LOGARITHMIC:
.. rst-class:: classref-enumeration-constant
:ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_LOGARITHMIC** = ``2``
Logarithmic dampening of loudness according to distance.
.. _class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED:
.. rst-class:: classref-enumeration-constant
:ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_DISABLED** = ``3``
No dampening of loudness according to distance. The sound will still be heard positionally, unlike an :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`. :ref:`ATTENUATION_DISABLED<class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED>` can be combined with a :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` value greater than ``0.0`` to achieve linear attenuation clamped to a sphere of a defined size.
.. rst-class:: classref-item-separator
----
.. _enum_AudioStreamPlayer3D_OutOfRangeMode:
.. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_MIX:
.. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_PAUSE:
.. rst-class:: classref-enumeration
enum **OutOfRangeMode**:
- **OUT_OF_RANGE_MIX** = **0** --- Mix this audio in, even when it's out of range. This increases CPU usage, but keeps the sound playing at the correct position if the camera leaves and enters the ``AudioStreamPlayer3D``'s :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` radius.
.. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_MIX:
- **OUT_OF_RANGE_PAUSE** = **1** --- Pause this audio when it gets out of range. This decreases CPU usage, but will cause the sound to restart if the camera leaves and enters the ``AudioStreamPlayer3D``'s :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` radius.
.. rst-class:: classref-enumeration-constant
:ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **OUT_OF_RANGE_MIX** = ``0``
Mix this audio in, even when it's out of range. This increases CPU usage, but keeps the sound playing at the correct position if the camera leaves and enters the **AudioStreamPlayer3D**'s :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` radius.
.. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_PAUSE:
.. rst-class:: classref-enumeration-constant
:ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **OUT_OF_RANGE_PAUSE** = ``1``
Pause this audio when it gets out of range. This decreases CPU usage, but will cause the sound to restart if the camera leaves and enters the **AudioStreamPlayer3D**'s :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` radius.
.. rst-class:: classref-item-separator
----
.. _enum_AudioStreamPlayer3D_DopplerTracking:
.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED:
.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_IDLE_STEP:
.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_PHYSICS_STEP:
.. rst-class:: classref-enumeration
enum **DopplerTracking**:
- **DOPPLER_TRACKING_DISABLED** = **0** --- Disables doppler tracking.
.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED:
- **DOPPLER_TRACKING_IDLE_STEP** = **1** --- Executes doppler tracking in idle step (every rendered frame).
.. rst-class:: classref-enumeration-constant
- **DOPPLER_TRACKING_PHYSICS_STEP** = **2** --- Executes doppler tracking in physics step (every simulated physics frame).
:ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_DISABLED** = ``0``
Disables doppler tracking.
.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_IDLE_STEP:
.. rst-class:: classref-enumeration-constant
:ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_IDLE_STEP** = ``1``
Executes doppler tracking in idle step (every rendered frame).
.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_PHYSICS_STEP:
.. rst-class:: classref-enumeration-constant
:ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_PHYSICS_STEP** = ``2``
Executes doppler tracking in physics step (every simulated physics frame).
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioStreamPlayer3D_property_area_mask:
- :ref:`int<class_int>` **area_mask**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``1`` |
+-----------+----------------------+
| *Setter* | set_area_mask(value) |
+-----------+----------------------+
| *Getter* | get_area_mask() |
+-----------+----------------------+
:ref:`int<class_int>` **area_mask** = ``1``
.. rst-class:: classref-property-setget
- void **set_area_mask** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_area_mask** **(** **)**
Determines which :ref:`Area<class_Area>` layers affect the sound for reverb and audio bus effects. Areas can be used to redirect :ref:`AudioStream<class_AudioStream>`\ s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz:
- :ref:`float<class_float>` **attenuation_filter_cutoff_hz**
.. rst-class:: classref-property
+-----------+-----------------------------------------+
| *Default* | ``5000.0`` |
+-----------+-----------------------------------------+
| *Setter* | set_attenuation_filter_cutoff_hz(value) |
+-----------+-----------------------------------------+
| *Getter* | get_attenuation_filter_cutoff_hz() |
+-----------+-----------------------------------------+
:ref:`float<class_float>` **attenuation_filter_cutoff_hz** = ``5000.0``
.. rst-class:: classref-property-setget
- void **set_attenuation_filter_cutoff_hz** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_attenuation_filter_cutoff_hz** **(** **)**
Dampens audio using a low-pass filter above this frequency, in Hz. To disable the dampening effect entirely, set this to ``20500`` as this frequency is above the human hearing limit.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_attenuation_filter_db:
- :ref:`float<class_float>` **attenuation_filter_db**
.. rst-class:: classref-property
+-----------+----------------------------------+
| *Default* | ``-24.0`` |
+-----------+----------------------------------+
| *Setter* | set_attenuation_filter_db(value) |
+-----------+----------------------------------+
| *Getter* | get_attenuation_filter_db() |
+-----------+----------------------------------+
:ref:`float<class_float>` **attenuation_filter_db** = ``-24.0``
.. rst-class:: classref-property-setget
- void **set_attenuation_filter_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_attenuation_filter_db** **(** **)**
Amount how much the filter affects the loudness, in decibels.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_attenuation_model:
- :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **attenuation_model**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``0`` |
+-----------+------------------------------+
| *Setter* | set_attenuation_model(value) |
+-----------+------------------------------+
| *Getter* | get_attenuation_model() |
+-----------+------------------------------+
:ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **attenuation_model** = ``0``
.. rst-class:: classref-property-setget
- void **set_attenuation_model** **(** :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` value **)**
- :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **get_attenuation_model** **(** **)**
Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_autoplay:
- :ref:`bool<class_bool>` **autoplay**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``false`` |
+-----------+-----------------------+
| *Setter* | set_autoplay(value) |
+-----------+-----------------------+
| *Getter* | is_autoplay_enabled() |
+-----------+-----------------------+
:ref:`bool<class_bool>` **autoplay** = ``false``
.. rst-class:: classref-property-setget
- void **set_autoplay** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
If ``true``, audio plays when the AudioStreamPlayer3D node is added to scene tree.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_bus:
- :ref:`String<class_String>` **bus**
.. rst-class:: classref-property
+-----------+----------------+
| *Default* | ``"Master"`` |
+-----------+----------------+
| *Setter* | set_bus(value) |
+-----------+----------------+
| *Getter* | get_bus() |
+-----------+----------------+
:ref:`String<class_String>` **bus** = ``"Master"``
.. rst-class:: classref-property-setget
- void **set_bus** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_bus** **(** **)**
The bus on which this audio is playing.
\ **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to ``"Master"``.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_doppler_tracking:
- :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **doppler_tracking**
.. rst-class:: classref-property
+-----------+-----------------------------+
| *Default* | ``0`` |
+-----------+-----------------------------+
| *Setter* | set_doppler_tracking(value) |
+-----------+-----------------------------+
| *Getter* | get_doppler_tracking() |
+-----------+-----------------------------+
:ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **doppler_tracking** = ``0``
.. rst-class:: classref-property-setget
- void **set_doppler_tracking** **(** :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` value **)**
- :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **get_doppler_tracking** **(** **)**
Decides in which step the `Doppler effect <https://en.wikipedia.org/wiki/Doppler_effect>`__ should be calculated.
\ **Note:** Only effective if the current :ref:`Camera<class_Camera>`'s :ref:`Camera.doppler_tracking<class_Camera_property_doppler_tracking>` property is set to a value other than :ref:`Camera.DOPPLER_TRACKING_DISABLED<class_Camera_constant_DOPPLER_TRACKING_DISABLED>`.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_emission_angle_degrees:
- :ref:`float<class_float>` **emission_angle_degrees**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``45.0`` |
+-----------+---------------------------+
| *Setter* | set_emission_angle(value) |
+-----------+---------------------------+
| *Getter* | get_emission_angle() |
+-----------+---------------------------+
:ref:`float<class_float>` **emission_angle_degrees** = ``45.0``
.. rst-class:: classref-property-setget
- void **set_emission_angle** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_emission_angle** **(** **)**
The angle in which the audio reaches cameras undampened.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_emission_angle_enabled:
- :ref:`bool<class_bool>` **emission_angle_enabled**
.. rst-class:: classref-property
+-----------+-----------------------------------+
| *Default* | ``false`` |
+-----------+-----------------------------------+
| *Setter* | set_emission_angle_enabled(value) |
+-----------+-----------------------------------+
| *Getter* | is_emission_angle_enabled() |
+-----------+-----------------------------------+
:ref:`bool<class_bool>` **emission_angle_enabled** = ``false``
.. rst-class:: classref-property-setget
- void **set_emission_angle_enabled** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_emission_angle_enabled** **(** **)**
If ``true``, the audio should be dampened according to the direction of the sound.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db:
- :ref:`float<class_float>` **emission_angle_filter_attenuation_db**
.. rst-class:: classref-property
+-----------+-------------------------------------------------+
| *Default* | ``-12.0`` |
+-----------+-------------------------------------------------+
| *Setter* | set_emission_angle_filter_attenuation_db(value) |
+-----------+-------------------------------------------------+
| *Getter* | get_emission_angle_filter_attenuation_db() |
+-----------+-------------------------------------------------+
:ref:`float<class_float>` **emission_angle_filter_attenuation_db** = ``-12.0``
.. rst-class:: classref-property-setget
- void **set_emission_angle_filter_attenuation_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_emission_angle_filter_attenuation_db** **(** **)**
Dampens audio if camera is outside of :ref:`emission_angle_degrees<class_AudioStreamPlayer3D_property_emission_angle_degrees>` and :ref:`emission_angle_enabled<class_AudioStreamPlayer3D_property_emission_angle_enabled>` is set by this factor, in decibels.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_max_db:
- :ref:`float<class_float>` **max_db**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``3.0`` |
+-----------+-------------------+
| *Setter* | set_max_db(value) |
+-----------+-------------------+
| *Getter* | get_max_db() |
+-----------+-------------------+
:ref:`float<class_float>` **max_db** = ``3.0``
.. rst-class:: classref-property-setget
- void **set_max_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_max_db** **(** **)**
Sets the absolute maximum of the soundlevel, in decibels.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_max_distance:
- :ref:`float<class_float>` **max_distance**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``0.0`` |
+-----------+-------------------------+
| *Setter* | set_max_distance(value) |
+-----------+-------------------------+
| *Getter* | get_max_distance() |
+-----------+-------------------------+
:ref:`float<class_float>` **max_distance** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_max_distance** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_max_distance** **(** **)**
Sets the distance from which the :ref:`out_of_range_mode<class_AudioStreamPlayer3D_property_out_of_range_mode>` takes effect. Has no effect if set to 0.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_out_of_range_mode:
- :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **out_of_range_mode**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``0`` |
+-----------+------------------------------+
| *Setter* | set_out_of_range_mode(value) |
+-----------+------------------------------+
| *Getter* | get_out_of_range_mode() |
+-----------+------------------------------+
:ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **out_of_range_mode** = ``0``
.. rst-class:: classref-property-setget
- void **set_out_of_range_mode** **(** :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` value **)**
- :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **get_out_of_range_mode** **(** **)**
Decides if audio should pause when source is outside of :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` range.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_panning_strength:
- :ref:`float<class_float>` **panning_strength**
.. rst-class:: classref-property
+-----------+-----------------------------+
| *Default* | ``1.0`` |
+-----------+-----------------------------+
| *Setter* | set_panning_strength(value) |
+-----------+-----------------------------+
| *Getter* | get_panning_strength() |
+-----------+-----------------------------+
:ref:`float<class_float>` **panning_strength** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_panning_strength** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_panning_strength** **(** **)**
Scales the panning strength for this node by multiplying the base :ref:`ProjectSettings.audio/3d_panning_strength<class_ProjectSettings_property_audio/3d_panning_strength>` with this factor. Higher values will pan audio from left to right more dramatically than lower values.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_pitch_scale:
- :ref:`float<class_float>` **pitch_scale**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1.0`` |
+-----------+------------------------+
| *Setter* | set_pitch_scale(value) |
+-----------+------------------------+
| *Getter* | get_pitch_scale() |
+-----------+------------------------+
:ref:`float<class_float>` **pitch_scale** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_pitch_scale** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_pitch_scale** **(** **)**
The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_playing:
- :ref:`bool<class_bool>` **playing**
.. rst-class:: classref-property
+-----------+--------------+
| *Default* | ``false`` |
+-----------+--------------+
| *Getter* | is_playing() |
+-----------+--------------+
:ref:`bool<class_bool>` **playing** = ``false``
.. rst-class:: classref-property-setget
- :ref:`bool<class_bool>` **is_playing** **(** **)**
If ``true``, audio is playing.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_stream:
- :ref:`AudioStream<class_AudioStream>` **stream**
.. rst-class:: classref-property
+----------+-------------------+
| *Setter* | set_stream(value) |
+----------+-------------------+
| *Getter* | get_stream() |
+----------+-------------------+
:ref:`AudioStream<class_AudioStream>` **stream**
.. rst-class:: classref-property-setget
- void **set_stream** **(** :ref:`AudioStream<class_AudioStream>` value **)**
- :ref:`AudioStream<class_AudioStream>` **get_stream** **(** **)**
The :ref:`AudioStream<class_AudioStream>` resource to be played.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_stream_paused:
- :ref:`bool<class_bool>` **stream_paused**
.. rst-class:: classref-property
+-----------+--------------------------+
| *Default* | ``false`` |
+-----------+--------------------------+
| *Setter* | set_stream_paused(value) |
+-----------+--------------------------+
| *Getter* | get_stream_paused() |
+-----------+--------------------------+
:ref:`bool<class_bool>` **stream_paused** = ``false``
.. rst-class:: classref-property-setget
- void **set_stream_paused** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_stream_paused** **(** **)**
If ``true``, the playback is paused. You can resume it by setting :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` to ``false``.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_unit_db:
- :ref:`float<class_float>` **unit_db**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``0.0`` |
+-----------+--------------------+
| *Setter* | set_unit_db(value) |
+-----------+--------------------+
| *Getter* | get_unit_db() |
+-----------+--------------------+
:ref:`float<class_float>` **unit_db** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_unit_db** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_unit_db** **(** **)**
The base sound level unaffected by dampening, in decibels.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_property_unit_size:
- :ref:`float<class_float>` **unit_size**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``1.0`` |
+-----------+----------------------+
| *Setter* | set_unit_size(value) |
+-----------+----------------------+
| *Getter* | get_unit_size() |
+-----------+----------------------+
:ref:`float<class_float>` **unit_size** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_unit_size** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_unit_size** **(** **)**
The factor for the attenuation effect. Higher values make the sound audible over a larger distance.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AudioStreamPlayer3D_method_get_playback_position:
- :ref:`float<class_float>` **get_playback_position** **(** **)**
.. rst-class:: classref-method
:ref:`float<class_float>` **get_playback_position** **(** **)**
Returns the position in the :ref:`AudioStream<class_AudioStream>`.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_method_get_stream_playback:
- :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
.. rst-class:: classref-method
Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this ``AudioStreamPlayer3D``.
:ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this **AudioStreamPlayer3D**.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_method_play:
- void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
.. rst-class:: classref-method
void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
Plays the audio from the given position ``from_position``, in seconds.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_method_seek:
- void **seek** **(** :ref:`float<class_float>` to_position **)**
.. rst-class:: classref-method
void **seek** **(** :ref:`float<class_float>` to_position **)**
Sets the position from which audio will be played, in seconds.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamPlayer3D_method_stop:
- void **stop** **(** **)**
.. rst-class:: classref-method
void **stop** **(** **)**
Stops the audio.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,51 +14,67 @@ AudioStreamRandomPitch
Plays audio with random pitch shifting.
.. rst-class:: classref-introduction-group
Description
-----------
Randomly varies pitch on each start.
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------------------+-------------------------------------------------------------------------+---------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`audio_stream<class_AudioStreamRandomPitch_property_audio_stream>` | |
+---------------------------------------+-------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`random_pitch<class_AudioStreamRandomPitch_property_random_pitch>` | ``1.1`` |
+---------------------------------------+-------------------------------------------------------------------------+---------+
.. table::
:widths: auto
+---------------------------------------+-------------------------------------------------------------------------+---------+
| :ref:`AudioStream<class_AudioStream>` | :ref:`audio_stream<class_AudioStreamRandomPitch_property_audio_stream>` | |
+---------------------------------------+-------------------------------------------------------------------------+---------+
| :ref:`float<class_float>` | :ref:`random_pitch<class_AudioStreamRandomPitch_property_random_pitch>` | ``1.1`` |
+---------------------------------------+-------------------------------------------------------------------------+---------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioStreamRandomPitch_property_audio_stream:
- :ref:`AudioStream<class_AudioStream>` **audio_stream**
.. rst-class:: classref-property
+----------+-------------------------+
| *Setter* | set_audio_stream(value) |
+----------+-------------------------+
| *Getter* | get_audio_stream() |
+----------+-------------------------+
:ref:`AudioStream<class_AudioStream>` **audio_stream**
.. rst-class:: classref-property-setget
- void **set_audio_stream** **(** :ref:`AudioStream<class_AudioStream>` value **)**
- :ref:`AudioStream<class_AudioStream>` **get_audio_stream** **(** **)**
The current :ref:`AudioStream<class_AudioStream>`.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamRandomPitch_property_random_pitch:
- :ref:`float<class_float>` **random_pitch**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``1.1`` |
+-----------+-------------------------+
| *Setter* | set_random_pitch(value) |
+-----------+-------------------------+
| *Getter* | get_random_pitch() |
+-----------+-------------------------+
:ref:`float<class_float>` **random_pitch** = ``1.1``
.. rst-class:: classref-property-setget
- void **set_random_pitch** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_random_pitch** **(** **)**
The intensity of random pitch variation.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ AudioStreamSample
Stores audio data loaded from WAV files.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -21,169 +23,229 @@ AudioStreamSample stores sound samples loaded from WAV files. To play the stored
This class can also be used to store dynamically-generated PCM audio data. See also :ref:`AudioStreamGenerator<class_AudioStreamGenerator>` for procedural audio generation.
.. rst-class:: classref-reftable-group
Properties
----------
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`data<class_AudioStreamSample_property_data>` | ``PoolByteArray( )`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`Format<enum_AudioStreamSample_Format>` | :ref:`format<class_AudioStreamSample_property_format>` | ``0`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`int<class_int>` | :ref:`loop_begin<class_AudioStreamSample_property_loop_begin>` | ``0`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`int<class_int>` | :ref:`loop_end<class_AudioStreamSample_property_loop_end>` | ``0`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`LoopMode<enum_AudioStreamSample_LoopMode>` | :ref:`loop_mode<class_AudioStreamSample_property_loop_mode>` | ``0`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`int<class_int>` | :ref:`mix_rate<class_AudioStreamSample_property_mix_rate>` | ``44100`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`stereo<class_AudioStreamSample_property_stereo>` | ``false`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
.. table::
:widths: auto
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`data<class_AudioStreamSample_property_data>` | ``PoolByteArray( )`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`Format<enum_AudioStreamSample_Format>` | :ref:`format<class_AudioStreamSample_property_format>` | ``0`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`int<class_int>` | :ref:`loop_begin<class_AudioStreamSample_property_loop_begin>` | ``0`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`int<class_int>` | :ref:`loop_end<class_AudioStreamSample_property_loop_end>` | ``0`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`LoopMode<enum_AudioStreamSample_LoopMode>` | :ref:`loop_mode<class_AudioStreamSample_property_loop_mode>` | ``0`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`int<class_int>` | :ref:`mix_rate<class_AudioStreamSample_property_mix_rate>` | ``44100`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
| :ref:`bool<class_bool>` | :ref:`stereo<class_AudioStreamSample_property_stereo>` | ``false`` |
+--------------------------------------------------+----------------------------------------------------------------+-----------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------------------+-------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_to_wav<class_AudioStreamSample_method_save_to_wav>` **(** :ref:`String<class_String>` path **)** |
+---------------------------------------+-------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------------------+-------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_to_wav<class_AudioStreamSample_method_save_to_wav>` **(** :ref:`String<class_String>` path **)** |
+---------------------------------------+-------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_AudioStreamSample_Format:
.. _class_AudioStreamSample_constant_FORMAT_8_BITS:
.. _class_AudioStreamSample_constant_FORMAT_16_BITS:
.. _class_AudioStreamSample_constant_FORMAT_IMA_ADPCM:
.. rst-class:: classref-enumeration
enum **Format**:
- **FORMAT_8_BITS** = **0** --- 8-bit audio codec.
.. _class_AudioStreamSample_constant_FORMAT_8_BITS:
- **FORMAT_16_BITS** = **1** --- 16-bit audio codec.
.. rst-class:: classref-enumeration-constant
- **FORMAT_IMA_ADPCM** = **2** --- Audio is compressed using IMA ADPCM.
:ref:`Format<enum_AudioStreamSample_Format>` **FORMAT_8_BITS** = ``0``
8-bit audio codec.
.. _class_AudioStreamSample_constant_FORMAT_16_BITS:
.. rst-class:: classref-enumeration-constant
:ref:`Format<enum_AudioStreamSample_Format>` **FORMAT_16_BITS** = ``1``
16-bit audio codec.
.. _class_AudioStreamSample_constant_FORMAT_IMA_ADPCM:
.. rst-class:: classref-enumeration-constant
:ref:`Format<enum_AudioStreamSample_Format>` **FORMAT_IMA_ADPCM** = ``2``
Audio is compressed using IMA ADPCM.
.. rst-class:: classref-item-separator
----
.. _enum_AudioStreamSample_LoopMode:
.. _class_AudioStreamSample_constant_LOOP_DISABLED:
.. _class_AudioStreamSample_constant_LOOP_FORWARD:
.. _class_AudioStreamSample_constant_LOOP_PING_PONG:
.. _class_AudioStreamSample_constant_LOOP_BACKWARD:
.. rst-class:: classref-enumeration
enum **LoopMode**:
- **LOOP_DISABLED** = **0** --- Audio does not loop.
.. _class_AudioStreamSample_constant_LOOP_DISABLED:
- **LOOP_FORWARD** = **1** --- Audio loops the data between :ref:`loop_begin<class_AudioStreamSample_property_loop_begin>` and :ref:`loop_end<class_AudioStreamSample_property_loop_end>`, playing forward only.
.. rst-class:: classref-enumeration-constant
- **LOOP_PING_PONG** = **2** --- Audio loops the data between :ref:`loop_begin<class_AudioStreamSample_property_loop_begin>` and :ref:`loop_end<class_AudioStreamSample_property_loop_end>`, playing back and forth.
:ref:`LoopMode<enum_AudioStreamSample_LoopMode>` **LOOP_DISABLED** = ``0``
- **LOOP_BACKWARD** = **3** --- Audio loops the data between :ref:`loop_begin<class_AudioStreamSample_property_loop_begin>` and :ref:`loop_end<class_AudioStreamSample_property_loop_end>`, playing backward only.
Audio does not loop.
.. _class_AudioStreamSample_constant_LOOP_FORWARD:
.. rst-class:: classref-enumeration-constant
:ref:`LoopMode<enum_AudioStreamSample_LoopMode>` **LOOP_FORWARD** = ``1``
Audio loops the data between :ref:`loop_begin<class_AudioStreamSample_property_loop_begin>` and :ref:`loop_end<class_AudioStreamSample_property_loop_end>`, playing forward only.
.. _class_AudioStreamSample_constant_LOOP_PING_PONG:
.. rst-class:: classref-enumeration-constant
:ref:`LoopMode<enum_AudioStreamSample_LoopMode>` **LOOP_PING_PONG** = ``2``
Audio loops the data between :ref:`loop_begin<class_AudioStreamSample_property_loop_begin>` and :ref:`loop_end<class_AudioStreamSample_property_loop_end>`, playing back and forth.
.. _class_AudioStreamSample_constant_LOOP_BACKWARD:
.. rst-class:: classref-enumeration-constant
:ref:`LoopMode<enum_AudioStreamSample_LoopMode>` **LOOP_BACKWARD** = ``3``
Audio loops the data between :ref:`loop_begin<class_AudioStreamSample_property_loop_begin>` and :ref:`loop_end<class_AudioStreamSample_property_loop_end>`, playing backward only.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_AudioStreamSample_property_data:
- :ref:`PoolByteArray<class_PoolByteArray>` **data**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``PoolByteArray( )`` |
+-----------+-----------------------+
| *Setter* | set_data(value) |
+-----------+-----------------------+
| *Getter* | get_data() |
+-----------+-----------------------+
:ref:`PoolByteArray<class_PoolByteArray>` **data** = ``PoolByteArray( )``
.. rst-class:: classref-property-setget
- void **set_data** **(** :ref:`PoolByteArray<class_PoolByteArray>` value **)**
- :ref:`PoolByteArray<class_PoolByteArray>` **get_data** **(** **)**
Contains the audio data in bytes.
\ **Note:** This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamSample_property_format:
- :ref:`Format<enum_AudioStreamSample_Format>` **format**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``0`` |
+-----------+-------------------+
| *Setter* | set_format(value) |
+-----------+-------------------+
| *Getter* | get_format() |
+-----------+-------------------+
:ref:`Format<enum_AudioStreamSample_Format>` **format** = ``0``
.. rst-class:: classref-property-setget
- void **set_format** **(** :ref:`Format<enum_AudioStreamSample_Format>` value **)**
- :ref:`Format<enum_AudioStreamSample_Format>` **get_format** **(** **)**
Audio format. See :ref:`Format<enum_AudioStreamSample_Format>` constants for values.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamSample_property_loop_begin:
- :ref:`int<class_int>` **loop_begin**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``0`` |
+-----------+-----------------------+
| *Setter* | set_loop_begin(value) |
+-----------+-----------------------+
| *Getter* | get_loop_begin() |
+-----------+-----------------------+
:ref:`int<class_int>` **loop_begin** = ``0``
.. rst-class:: classref-property-setget
- void **set_loop_begin** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_loop_begin** **(** **)**
The loop start point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamSample_property_loop_end:
- :ref:`int<class_int>` **loop_end**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``0`` |
+-----------+---------------------+
| *Setter* | set_loop_end(value) |
+-----------+---------------------+
| *Getter* | get_loop_end() |
+-----------+---------------------+
:ref:`int<class_int>` **loop_end** = ``0``
.. rst-class:: classref-property-setget
- void **set_loop_end** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_loop_end** **(** **)**
The loop end point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamSample_property_loop_mode:
- :ref:`LoopMode<enum_AudioStreamSample_LoopMode>` **loop_mode**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``0`` |
+-----------+----------------------+
| *Setter* | set_loop_mode(value) |
+-----------+----------------------+
| *Getter* | get_loop_mode() |
+-----------+----------------------+
:ref:`LoopMode<enum_AudioStreamSample_LoopMode>` **loop_mode** = ``0``
.. rst-class:: classref-property-setget
- void **set_loop_mode** **(** :ref:`LoopMode<enum_AudioStreamSample_LoopMode>` value **)**
- :ref:`LoopMode<enum_AudioStreamSample_LoopMode>` **get_loop_mode** **(** **)**
The loop mode. This information will be imported automatically from the WAV file if present. See :ref:`LoopMode<enum_AudioStreamSample_LoopMode>` constants for values.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamSample_property_mix_rate:
- :ref:`int<class_int>` **mix_rate**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``44100`` |
+-----------+---------------------+
| *Setter* | set_mix_rate(value) |
+-----------+---------------------+
| *Getter* | get_mix_rate() |
+-----------+---------------------+
:ref:`int<class_int>` **mix_rate** = ``44100``
.. rst-class:: classref-property-setget
- void **set_mix_rate** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_mix_rate** **(** **)**
The sample rate for mixing this audio. Higher values require more storage space, but result in better quality.
@@ -191,28 +253,37 @@ In games, common sample rates in use are ``11025``, ``16000``, ``22050``, ``3200
According to the `Nyquist-Shannon sampling theorem <https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem>`__, there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are using lower-pitched sounds such as voices, lower sample rates such as ``32000`` or ``22050`` may be usable with no loss in quality.
.. rst-class:: classref-item-separator
----
.. _class_AudioStreamSample_property_stereo:
- :ref:`bool<class_bool>` **stereo**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``false`` |
+-----------+-------------------+
| *Setter* | set_stereo(value) |
+-----------+-------------------+
| *Getter* | is_stereo() |
+-----------+-------------------+
:ref:`bool<class_bool>` **stereo** = ``false``
.. rst-class:: classref-property-setget
- void **set_stereo** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_stereo** **(** **)**
If ``true``, audio is stereo.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_AudioStreamSample_method_save_to_wav:
- :ref:`Error<enum_@GlobalScope_Error>` **save_to_wav** **(** :ref:`String<class_String>` path **)**
.. rst-class:: classref-method
:ref:`Error<enum_@GlobalScope_Error>` **save_to_wav** **(** :ref:`String<class_String>` path **)**
Saves the AudioStreamSample as a WAV file to ``path``. Samples with IMA ADPCM format can't be saved.
@@ -221,3 +292,4 @@ Saves the AudioStreamSample as a WAV file to ``path``. Samples with IMA ADPCM fo
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,74 +14,108 @@ BackBufferCopy
Copies a region of the screen (or the whole screen) to a buffer so it can be accessed in your shader scripts through the ``texture(SCREEN_TEXTURE, ...)`` function.
.. rst-class:: classref-introduction-group
Description
-----------
Node for back-buffering the currently-displayed screen. The region defined in the BackBufferCopy node is buffered with the content of the screen it covers, or the entire screen according to the copy mode set. Use the ``texture(SCREEN_TEXTURE, ...)`` function in your shader scripts to access the buffer.
Node for back-buffering the currently-displayed screen. The region defined in the **BackBufferCopy** node is buffered with the content of the screen it covers, or the entire screen according to the copy mode set. Use the ``texture(SCREEN_TEXTURE, ...)`` function in your shader scripts to access the buffer.
\ **Note:** Since this node inherits from :ref:`Node2D<class_Node2D>` (and not :ref:`Control<class_Control>`), anchors and margins won't apply to child :ref:`Control<class_Control>`-derived nodes. This can be problematic when resizing the window. To avoid this, add :ref:`Control<class_Control>`-derived nodes as *siblings* to the BackBufferCopy node instead of adding them as children.
\ **Note:** Since this node inherits from :ref:`Node2D<class_Node2D>` (and not :ref:`Control<class_Control>`), anchors and margins won't apply to child :ref:`Control<class_Control>`-derived nodes. This can be problematic when resizing the window. To avoid this, add :ref:`Control<class_Control>`-derived nodes as *siblings* to the **BackBufferCopy** node instead of adding them as children.
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------------------------+-----------------------------------------------------------+-----------------------------------+
| :ref:`CopyMode<enum_BackBufferCopy_CopyMode>` | :ref:`copy_mode<class_BackBufferCopy_property_copy_mode>` | ``1`` |
+-----------------------------------------------+-----------------------------------------------------------+-----------------------------------+
| :ref:`Rect2<class_Rect2>` | :ref:`rect<class_BackBufferCopy_property_rect>` | ``Rect2( -100, -100, 200, 200 )`` |
+-----------------------------------------------+-----------------------------------------------------------+-----------------------------------+
.. table::
:widths: auto
+-----------------------------------------------+-----------------------------------------------------------+-----------------------------------+
| :ref:`CopyMode<enum_BackBufferCopy_CopyMode>` | :ref:`copy_mode<class_BackBufferCopy_property_copy_mode>` | ``1`` |
+-----------------------------------------------+-----------------------------------------------------------+-----------------------------------+
| :ref:`Rect2<class_Rect2>` | :ref:`rect<class_BackBufferCopy_property_rect>` | ``Rect2( -100, -100, 200, 200 )`` |
+-----------------------------------------------+-----------------------------------------------------------+-----------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_BackBufferCopy_CopyMode:
.. _class_BackBufferCopy_constant_COPY_MODE_DISABLED:
.. _class_BackBufferCopy_constant_COPY_MODE_RECT:
.. _class_BackBufferCopy_constant_COPY_MODE_VIEWPORT:
.. rst-class:: classref-enumeration
enum **CopyMode**:
- **COPY_MODE_DISABLED** = **0** --- Disables the buffering mode. This means the BackBufferCopy node will directly use the portion of screen it covers.
.. _class_BackBufferCopy_constant_COPY_MODE_DISABLED:
- **COPY_MODE_RECT** = **1** --- BackBufferCopy buffers a rectangular region.
.. rst-class:: classref-enumeration-constant
- **COPY_MODE_VIEWPORT** = **2** --- BackBufferCopy buffers the entire screen.
:ref:`CopyMode<enum_BackBufferCopy_CopyMode>` **COPY_MODE_DISABLED** = ``0``
Disables the buffering mode. This means the **BackBufferCopy** node will directly use the portion of screen it covers.
.. _class_BackBufferCopy_constant_COPY_MODE_RECT:
.. rst-class:: classref-enumeration-constant
:ref:`CopyMode<enum_BackBufferCopy_CopyMode>` **COPY_MODE_RECT** = ``1``
**BackBufferCopy** buffers a rectangular region.
.. _class_BackBufferCopy_constant_COPY_MODE_VIEWPORT:
.. rst-class:: classref-enumeration-constant
:ref:`CopyMode<enum_BackBufferCopy_CopyMode>` **COPY_MODE_VIEWPORT** = ``2``
**BackBufferCopy** buffers the entire screen.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_BackBufferCopy_property_copy_mode:
- :ref:`CopyMode<enum_BackBufferCopy_CopyMode>` **copy_mode**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``1`` |
+-----------+----------------------+
| *Setter* | set_copy_mode(value) |
+-----------+----------------------+
| *Getter* | get_copy_mode() |
+-----------+----------------------+
:ref:`CopyMode<enum_BackBufferCopy_CopyMode>` **copy_mode** = ``1``
.. rst-class:: classref-property-setget
- void **set_copy_mode** **(** :ref:`CopyMode<enum_BackBufferCopy_CopyMode>` value **)**
- :ref:`CopyMode<enum_BackBufferCopy_CopyMode>` **get_copy_mode** **(** **)**
Buffer mode. See :ref:`CopyMode<enum_BackBufferCopy_CopyMode>` constants.
.. rst-class:: classref-item-separator
----
.. _class_BackBufferCopy_property_rect:
- :ref:`Rect2<class_Rect2>` **rect**
.. rst-class:: classref-property
+-----------+-----------------------------------+
| *Default* | ``Rect2( -100, -100, 200, 200 )`` |
+-----------+-----------------------------------+
| *Setter* | set_rect(value) |
+-----------+-----------------------------------+
| *Getter* | get_rect() |
+-----------+-----------------------------------+
:ref:`Rect2<class_Rect2>` **rect** = ``Rect2( -100, -100, 200, 200 )``
The area covered by the BackBufferCopy. Only used if :ref:`copy_mode<class_BackBufferCopy_property_copy_mode>` is :ref:`COPY_MODE_RECT<class_BackBufferCopy_constant_COPY_MODE_RECT>`.
.. rst-class:: classref-property-setget
- void **set_rect** **(** :ref:`Rect2<class_Rect2>` value **)**
- :ref:`Rect2<class_Rect2>` **get_rect** **(** **)**
The area covered by the **BackBufferCopy**. Only used if :ref:`copy_mode<class_BackBufferCopy_property_copy_mode>` is :ref:`COPY_MODE_RECT<class_BackBufferCopy_constant_COPY_MODE_RECT>`.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,537 +14,683 @@ BakedLightmap
Prerendered indirect light map for a scene.
.. rst-class:: classref-introduction-group
Description
-----------
Baked lightmaps are an alternative workflow for adding indirect (or baked) lighting to a scene. Unlike the :ref:`GIProbe<class_GIProbe>` approach, baked lightmaps work fine on low-end PCs and mobile devices as they consume almost no resources in run-time.
\ **Procedural generation:** Lightmap baking functionality is only available in the editor. This means ``BakedLightmap`` is not suited to procedurally generated or user-built levels. For procedurally generated or user-built levels, use :ref:`GIProbe<class_GIProbe>` instead.
\ **Procedural generation:** Lightmap baking functionality is only available in the editor. This means **BakedLightmap** is not suited to procedurally generated or user-built levels. For procedurally generated or user-built levels, use :ref:`GIProbe<class_GIProbe>` instead.
\ **Note:** Due to how lightmaps work, most properties only have a visible effect once lightmaps are baked again.
.. rst-class:: classref-introduction-group
Tutorials
---------
- :doc:`../tutorials/3d/baked_lightmaps`
.. rst-class:: classref-reftable-group
Properties
----------
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`bool<class_bool>` | :ref:`atlas_generate<class_BakedLightmap_property_atlas_generate>` | ``true`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`int<class_int>` | :ref:`atlas_max_size<class_BakedLightmap_property_atlas_max_size>` | ``4096`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`bias<class_BakedLightmap_property_bias>` | ``0.005`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`bounce_indirect_energy<class_BakedLightmap_property_bounce_indirect_energy>` | ``1.0`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`int<class_int>` | :ref:`bounces<class_BakedLightmap_property_bounces>` | ``3`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`capture_cell_size<class_BakedLightmap_property_capture_cell_size>` | ``0.5`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`bool<class_bool>` | :ref:`capture_enabled<class_BakedLightmap_property_capture_enabled>` | ``true`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`capture_propagation<class_BakedLightmap_property_capture_propagation>` | ``1.0`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` | :ref:`capture_quality<class_BakedLightmap_property_capture_quality>` | ``1`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`default_texels_per_unit<class_BakedLightmap_property_default_texels_per_unit>` | ``16.0`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`Color<class_Color>` | :ref:`environment_custom_color<class_BakedLightmap_property_environment_custom_color>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`environment_custom_energy<class_BakedLightmap_property_environment_custom_energy>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`Sky<class_Sky>` | :ref:`environment_custom_sky<class_BakedLightmap_property_environment_custom_sky>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`environment_custom_sky_rotation_degrees<class_BakedLightmap_property_environment_custom_sky_rotation_degrees>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`Color<class_Color>` | :ref:`environment_min_light<class_BakedLightmap_property_environment_min_light>` | ``Color( 0, 0, 0, 1 )`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` | :ref:`environment_mode<class_BakedLightmap_property_environment_mode>` | ``0`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`extents<class_BakedLightmap_property_extents>` | ``Vector3( 10, 10, 10 )`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`String<class_String>` | :ref:`image_path<class_BakedLightmap_property_image_path>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`BakedLightmapData<class_BakedLightmapData>` | :ref:`light_data<class_BakedLightmap_property_light_data>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` | :ref:`quality<class_BakedLightmap_property_quality>` | ``1`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`bool<class_bool>` | :ref:`use_color<class_BakedLightmap_property_use_color>` | ``true`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`bool<class_bool>` | :ref:`use_denoiser<class_BakedLightmap_property_use_denoiser>` | ``true`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`bool<class_bool>` | :ref:`use_hdr<class_BakedLightmap_property_use_hdr>` | ``true`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
.. table::
:widths: auto
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`bool<class_bool>` | :ref:`atlas_generate<class_BakedLightmap_property_atlas_generate>` | ``true`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`int<class_int>` | :ref:`atlas_max_size<class_BakedLightmap_property_atlas_max_size>` | ``4096`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`bias<class_BakedLightmap_property_bias>` | ``0.005`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`bounce_indirect_energy<class_BakedLightmap_property_bounce_indirect_energy>` | ``1.0`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`int<class_int>` | :ref:`bounces<class_BakedLightmap_property_bounces>` | ``3`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`capture_cell_size<class_BakedLightmap_property_capture_cell_size>` | ``0.5`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`bool<class_bool>` | :ref:`capture_enabled<class_BakedLightmap_property_capture_enabled>` | ``true`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`capture_propagation<class_BakedLightmap_property_capture_propagation>` | ``1.0`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` | :ref:`capture_quality<class_BakedLightmap_property_capture_quality>` | ``1`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`default_texels_per_unit<class_BakedLightmap_property_default_texels_per_unit>` | ``16.0`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`Color<class_Color>` | :ref:`environment_custom_color<class_BakedLightmap_property_environment_custom_color>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`float<class_float>` | :ref:`environment_custom_energy<class_BakedLightmap_property_environment_custom_energy>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`Sky<class_Sky>` | :ref:`environment_custom_sky<class_BakedLightmap_property_environment_custom_sky>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`environment_custom_sky_rotation_degrees<class_BakedLightmap_property_environment_custom_sky_rotation_degrees>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`Color<class_Color>` | :ref:`environment_min_light<class_BakedLightmap_property_environment_min_light>` | ``Color( 0, 0, 0, 1 )`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` | :ref:`environment_mode<class_BakedLightmap_property_environment_mode>` | ``0`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`extents<class_BakedLightmap_property_extents>` | ``Vector3( 10, 10, 10 )`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`String<class_String>` | :ref:`image_path<class_BakedLightmap_property_image_path>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`BakedLightmapData<class_BakedLightmapData>` | :ref:`light_data<class_BakedLightmap_property_light_data>` | |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` | :ref:`quality<class_BakedLightmap_property_quality>` | ``1`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`bool<class_bool>` | :ref:`use_color<class_BakedLightmap_property_use_color>` | ``true`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`bool<class_bool>` | :ref:`use_denoiser<class_BakedLightmap_property_use_denoiser>` | ``true`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
| :ref:`bool<class_bool>` | :ref:`use_hdr<class_BakedLightmap_property_use_hdr>` | ``true`` |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`BakeError<enum_BakedLightmap_BakeError>` | :ref:`bake<class_BakedLightmap_method_bake>` **(** :ref:`Node<class_Node>` from_node=null, :ref:`String<class_String>` data_save_path="" **)** |
+------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`BakeError<enum_BakedLightmap_BakeError>` | :ref:`bake<class_BakedLightmap_method_bake>` **(** :ref:`Node<class_Node>` from_node=null, :ref:`String<class_String>` data_save_path="" **)** |
+------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_BakedLightmap_BakeQuality:
.. _class_BakedLightmap_constant_BAKE_QUALITY_LOW:
.. _class_BakedLightmap_constant_BAKE_QUALITY_MEDIUM:
.. _class_BakedLightmap_constant_BAKE_QUALITY_HIGH:
.. _class_BakedLightmap_constant_BAKE_QUALITY_ULTRA:
.. rst-class:: classref-enumeration
enum **BakeQuality**:
- **BAKE_QUALITY_LOW** = **0** --- The lowest bake quality mode. Fastest to calculate.
.. _class_BakedLightmap_constant_BAKE_QUALITY_LOW:
- **BAKE_QUALITY_MEDIUM** = **1** --- The default bake quality mode.
.. rst-class:: classref-enumeration-constant
- **BAKE_QUALITY_HIGH** = **2** --- A higher bake quality mode. Takes longer to calculate.
:ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **BAKE_QUALITY_LOW** = ``0``
- **BAKE_QUALITY_ULTRA** = **3** --- The highest bake quality mode. Takes the longest to calculate.
The lowest bake quality mode. Fastest to calculate.
.. _class_BakedLightmap_constant_BAKE_QUALITY_MEDIUM:
.. rst-class:: classref-enumeration-constant
:ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **BAKE_QUALITY_MEDIUM** = ``1``
The default bake quality mode.
.. _class_BakedLightmap_constant_BAKE_QUALITY_HIGH:
.. rst-class:: classref-enumeration-constant
:ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **BAKE_QUALITY_HIGH** = ``2``
A higher bake quality mode. Takes longer to calculate.
.. _class_BakedLightmap_constant_BAKE_QUALITY_ULTRA:
.. rst-class:: classref-enumeration-constant
:ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **BAKE_QUALITY_ULTRA** = ``3``
The highest bake quality mode. Takes the longest to calculate.
.. rst-class:: classref-item-separator
----
.. _enum_BakedLightmap_BakeError:
.. _class_BakedLightmap_constant_BAKE_ERROR_OK:
.. _class_BakedLightmap_constant_BAKE_ERROR_NO_SAVE_PATH:
.. _class_BakedLightmap_constant_BAKE_ERROR_NO_MESHES:
.. _class_BakedLightmap_constant_BAKE_ERROR_CANT_CREATE_IMAGE:
.. _class_BakedLightmap_constant_BAKE_ERROR_LIGHTMAP_SIZE:
.. _class_BakedLightmap_constant_BAKE_ERROR_INVALID_MESH:
.. _class_BakedLightmap_constant_BAKE_ERROR_USER_ABORTED:
.. _class_BakedLightmap_constant_BAKE_ERROR_NO_LIGHTMAPPER:
.. _class_BakedLightmap_constant_BAKE_ERROR_NO_ROOT:
.. rst-class:: classref-enumeration
enum **BakeError**:
- **BAKE_ERROR_OK** = **0** --- Baking was successful.
.. _class_BakedLightmap_constant_BAKE_ERROR_OK:
- **BAKE_ERROR_NO_SAVE_PATH** = **1** --- Returns if no viable save path is found. This can happen where an :ref:`image_path<class_BakedLightmap_property_image_path>` is not specified or when the save location is invalid.
.. rst-class:: classref-enumeration-constant
- **BAKE_ERROR_NO_MESHES** = **2** --- Currently unused.
:ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_OK** = ``0``
- **BAKE_ERROR_CANT_CREATE_IMAGE** = **3** --- Returns when the baker cannot save per-mesh textures to file.
Baking was successful.
- **BAKE_ERROR_LIGHTMAP_SIZE** = **4** --- The size of the generated lightmaps is too large.
.. _class_BakedLightmap_constant_BAKE_ERROR_NO_SAVE_PATH:
- **BAKE_ERROR_INVALID_MESH** = **5** --- Some mesh contains UV2 values outside the ``[0,1]`` range.
.. rst-class:: classref-enumeration-constant
- **BAKE_ERROR_USER_ABORTED** = **6** --- Returns if user cancels baking.
:ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_NO_SAVE_PATH** = ``1``
- **BAKE_ERROR_NO_LIGHTMAPPER** = **7** --- Returns if lightmapper can't be created. Unless you are using a custom lightmapper, please report this as bug.
Returns if no viable save path is found. This can happen where an :ref:`image_path<class_BakedLightmap_property_image_path>` is not specified or when the save location is invalid.
- **BAKE_ERROR_NO_ROOT** = **8** --- There is no root node to start baking from. Either provide ``from_node`` argument or attach this node to a parent that should be used as root.
.. _class_BakedLightmap_constant_BAKE_ERROR_NO_MESHES:
.. rst-class:: classref-enumeration-constant
:ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_NO_MESHES** = ``2``
Currently unused.
.. _class_BakedLightmap_constant_BAKE_ERROR_CANT_CREATE_IMAGE:
.. rst-class:: classref-enumeration-constant
:ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_CANT_CREATE_IMAGE** = ``3``
Returns when the baker cannot save per-mesh textures to file.
.. _class_BakedLightmap_constant_BAKE_ERROR_LIGHTMAP_SIZE:
.. rst-class:: classref-enumeration-constant
:ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_LIGHTMAP_SIZE** = ``4``
The size of the generated lightmaps is too large.
.. _class_BakedLightmap_constant_BAKE_ERROR_INVALID_MESH:
.. rst-class:: classref-enumeration-constant
:ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_INVALID_MESH** = ``5``
Some mesh contains UV2 values outside the ``[0,1]`` range.
.. _class_BakedLightmap_constant_BAKE_ERROR_USER_ABORTED:
.. rst-class:: classref-enumeration-constant
:ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_USER_ABORTED** = ``6``
Returns if user cancels baking.
.. _class_BakedLightmap_constant_BAKE_ERROR_NO_LIGHTMAPPER:
.. rst-class:: classref-enumeration-constant
:ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_NO_LIGHTMAPPER** = ``7``
Returns if lightmapper can't be created. Unless you are using a custom lightmapper, please report this as bug.
.. _class_BakedLightmap_constant_BAKE_ERROR_NO_ROOT:
.. rst-class:: classref-enumeration-constant
:ref:`BakeError<enum_BakedLightmap_BakeError>` **BAKE_ERROR_NO_ROOT** = ``8``
There is no root node to start baking from. Either provide ``from_node`` argument or attach this node to a parent that should be used as root.
.. rst-class:: classref-item-separator
----
.. _enum_BakedLightmap_EnvironmentMode:
.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_DISABLED:
.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_SCENE:
.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_SKY:
.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_COLOR:
.. rst-class:: classref-enumeration
enum **EnvironmentMode**:
- **ENVIRONMENT_MODE_DISABLED** = **0** --- No environment is used during baking.
.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_DISABLED:
- **ENVIRONMENT_MODE_SCENE** = **1** --- The baked environment is automatically picked from the current scene.
.. rst-class:: classref-enumeration-constant
- **ENVIRONMENT_MODE_CUSTOM_SKY** = **2** --- A custom sky is used as environment during baking.
:ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **ENVIRONMENT_MODE_DISABLED** = ``0``
- **ENVIRONMENT_MODE_CUSTOM_COLOR** = **3** --- A custom solid color is used as environment during baking.
No environment is used during baking.
.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_SCENE:
.. rst-class:: classref-enumeration-constant
:ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **ENVIRONMENT_MODE_SCENE** = ``1``
The baked environment is automatically picked from the current scene.
.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_SKY:
.. rst-class:: classref-enumeration-constant
:ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **ENVIRONMENT_MODE_CUSTOM_SKY** = ``2``
A custom sky is used as environment during baking.
.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_COLOR:
.. rst-class:: classref-enumeration-constant
:ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **ENVIRONMENT_MODE_CUSTOM_COLOR** = ``3``
A custom solid color is used as environment during baking.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_BakedLightmap_property_atlas_generate:
- :ref:`bool<class_bool>` **atlas_generate**
.. rst-class:: classref-property
+-----------+-----------------------------+
| *Default* | ``true`` |
+-----------+-----------------------------+
| *Setter* | set_generate_atlas(value) |
+-----------+-----------------------------+
| *Getter* | is_generate_atlas_enabled() |
+-----------+-----------------------------+
:ref:`bool<class_bool>` **atlas_generate** = ``true``
.. rst-class:: classref-property-setget
- void **set_generate_atlas** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_generate_atlas_enabled** **(** **)**
If ``true``, the lightmapper will merge the textures for all meshes into one or several large layered textures. If ``false``, every mesh will get its own lightmap texture, which is less efficient.
\ **Note:** Atlas lightmap rendering is only supported in GLES3, *not* GLES2. Non-atlas lightmap rendering is supported by both GLES3 and GLES2. If :ref:`ProjectSettings.rendering/quality/driver/fallback_to_gles2<class_ProjectSettings_property_rendering/quality/driver/fallback_to_gles2>` is ``true``, consider baking lightmaps with :ref:`atlas_generate<class_BakedLightmap_property_atlas_generate>` set to ``false`` so that the resulting lightmap is visible in both GLES3 and GLES2.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_atlas_max_size:
- :ref:`int<class_int>` **atlas_max_size**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``4096`` |
+-----------+---------------------------+
| *Setter* | set_max_atlas_size(value) |
+-----------+---------------------------+
| *Getter* | get_max_atlas_size() |
+-----------+---------------------------+
:ref:`int<class_int>` **atlas_max_size** = ``4096``
.. rst-class:: classref-property-setget
- void **set_max_atlas_size** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_max_atlas_size** **(** **)**
Maximum size of each lightmap layer, only used when :ref:`atlas_generate<class_BakedLightmap_property_atlas_generate>` is enabled.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_bias:
- :ref:`float<class_float>` **bias**
.. rst-class:: classref-property
+-----------+-----------------+
| *Default* | ``0.005`` |
+-----------+-----------------+
| *Setter* | set_bias(value) |
+-----------+-----------------+
| *Getter* | get_bias() |
+-----------+-----------------+
:ref:`float<class_float>` **bias** = ``0.005``
.. rst-class:: classref-property-setget
- void **set_bias** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_bias** **(** **)**
Raycasting bias used during baking to avoid floating point precision issues.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_bounce_indirect_energy:
- :ref:`float<class_float>` **bounce_indirect_energy**
.. rst-class:: classref-property
+-----------+-----------------------------------+
| *Default* | ``1.0`` |
+-----------+-----------------------------------+
| *Setter* | set_bounce_indirect_energy(value) |
+-----------+-----------------------------------+
| *Getter* | get_bounce_indirect_energy() |
+-----------+-----------------------------------+
:ref:`float<class_float>` **bounce_indirect_energy** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_bounce_indirect_energy** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_bounce_indirect_energy** **(** **)**
The energy multiplier for each bounce. Higher values will make indirect lighting brighter. A value of ``1.0`` represents physically accurate behavior, but higher values can be used to make indirect lighting propagate more visibly when using a low number of bounces. This can be used to speed up bake times by lowering the number of :ref:`bounces<class_BakedLightmap_property_bounces>` then increasing :ref:`bounce_indirect_energy<class_BakedLightmap_property_bounce_indirect_energy>`. Unlike :ref:`BakedLightmapData.energy<class_BakedLightmapData_property_energy>`, this property does not affect direct lighting emitted by light nodes, emissive materials and the environment.
\ **Note:** :ref:`bounce_indirect_energy<class_BakedLightmap_property_bounce_indirect_energy>` only has an effect if :ref:`bounces<class_BakedLightmap_property_bounces>` is set to a value greater than or equal to ``1``.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_bounces:
- :ref:`int<class_int>` **bounces**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``3`` |
+-----------+--------------------+
| *Setter* | set_bounces(value) |
+-----------+--------------------+
| *Getter* | get_bounces() |
+-----------+--------------------+
:ref:`int<class_int>` **bounces** = ``3``
.. rst-class:: classref-property-setget
- void **set_bounces** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_bounces** **(** **)**
Number of light bounces that are taken into account during baking. See also :ref:`bounce_indirect_energy<class_BakedLightmap_property_bounce_indirect_energy>`.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_capture_cell_size:
- :ref:`float<class_float>` **capture_cell_size**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``0.5`` |
+-----------+------------------------------+
| *Setter* | set_capture_cell_size(value) |
+-----------+------------------------------+
| *Getter* | get_capture_cell_size() |
+-----------+------------------------------+
:ref:`float<class_float>` **capture_cell_size** = ``0.5``
.. rst-class:: classref-property-setget
- void **set_capture_cell_size** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_capture_cell_size** **(** **)**
Grid size used for real-time capture information on dynamic objects.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_capture_enabled:
- :ref:`bool<class_bool>` **capture_enabled**
.. rst-class:: classref-property
+-----------+----------------------------+
| *Default* | ``true`` |
+-----------+----------------------------+
| *Setter* | set_capture_enabled(value) |
+-----------+----------------------------+
| *Getter* | get_capture_enabled() |
+-----------+----------------------------+
:ref:`bool<class_bool>` **capture_enabled** = ``true``
.. rst-class:: classref-property-setget
- void **set_capture_enabled** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_capture_enabled** **(** **)**
When enabled, an octree containing the scene's lighting information will be computed. This octree will then be used to light dynamic objects in the scene.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_capture_propagation:
- :ref:`float<class_float>` **capture_propagation**
.. rst-class:: classref-property
+-----------+--------------------------------+
| *Default* | ``1.0`` |
+-----------+--------------------------------+
| *Setter* | set_capture_propagation(value) |
+-----------+--------------------------------+
| *Getter* | get_capture_propagation() |
+-----------+--------------------------------+
:ref:`float<class_float>` **capture_propagation** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_capture_propagation** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_capture_propagation** **(** **)**
Bias value to reduce the amount of light propagation in the captured octree.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_capture_quality:
- :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **capture_quality**
.. rst-class:: classref-property
+-----------+----------------------------+
| *Default* | ``1`` |
+-----------+----------------------------+
| *Setter* | set_capture_quality(value) |
+-----------+----------------------------+
| *Getter* | get_capture_quality() |
+-----------+----------------------------+
:ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **capture_quality** = ``1``
.. rst-class:: classref-property-setget
- void **set_capture_quality** **(** :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` value **)**
- :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **get_capture_quality** **(** **)**
Bake quality of the capture data.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_default_texels_per_unit:
- :ref:`float<class_float>` **default_texels_per_unit**
.. rst-class:: classref-property
+-----------+------------------------------------+
| *Default* | ``16.0`` |
+-----------+------------------------------------+
| *Setter* | set_default_texels_per_unit(value) |
+-----------+------------------------------------+
| *Getter* | get_default_texels_per_unit() |
+-----------+------------------------------------+
:ref:`float<class_float>` **default_texels_per_unit** = ``16.0``
.. rst-class:: classref-property-setget
- void **set_default_texels_per_unit** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_default_texels_per_unit** **(** **)**
If a baked mesh doesn't have a UV2 size hint, this value will be used to roughly compute a suitable lightmap size.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_environment_custom_color:
- :ref:`Color<class_Color>` **environment_custom_color**
.. rst-class:: classref-property
+----------+-------------------------------------+
| *Setter* | set_environment_custom_color(value) |
+----------+-------------------------------------+
| *Getter* | get_environment_custom_color() |
+----------+-------------------------------------+
:ref:`Color<class_Color>` **environment_custom_color**
.. rst-class:: classref-property-setget
- void **set_environment_custom_color** **(** :ref:`Color<class_Color>` value **)**
- :ref:`Color<class_Color>` **get_environment_custom_color** **(** **)**
The environment color when :ref:`environment_mode<class_BakedLightmap_property_environment_mode>` is set to :ref:`ENVIRONMENT_MODE_CUSTOM_COLOR<class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_COLOR>`.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_environment_custom_energy:
- :ref:`float<class_float>` **environment_custom_energy**
.. rst-class:: classref-property
+----------+--------------------------------------+
| *Setter* | set_environment_custom_energy(value) |
+----------+--------------------------------------+
| *Getter* | get_environment_custom_energy() |
+----------+--------------------------------------+
:ref:`float<class_float>` **environment_custom_energy**
.. rst-class:: classref-property-setget
- void **set_environment_custom_energy** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_environment_custom_energy** **(** **)**
The energy scaling factor when when :ref:`environment_mode<class_BakedLightmap_property_environment_mode>` is set to :ref:`ENVIRONMENT_MODE_CUSTOM_COLOR<class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_COLOR>` or :ref:`ENVIRONMENT_MODE_CUSTOM_SKY<class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_SKY>`.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_environment_custom_sky:
- :ref:`Sky<class_Sky>` **environment_custom_sky**
.. rst-class:: classref-property
+----------+-----------------------------------+
| *Setter* | set_environment_custom_sky(value) |
+----------+-----------------------------------+
| *Getter* | get_environment_custom_sky() |
+----------+-----------------------------------+
:ref:`Sky<class_Sky>` **environment_custom_sky**
.. rst-class:: classref-property-setget
- void **set_environment_custom_sky** **(** :ref:`Sky<class_Sky>` value **)**
- :ref:`Sky<class_Sky>` **get_environment_custom_sky** **(** **)**
The :ref:`Sky<class_Sky>` resource to use when :ref:`environment_mode<class_BakedLightmap_property_environment_mode>` is set o :ref:`ENVIRONMENT_MODE_CUSTOM_SKY<class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_SKY>`.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_environment_custom_sky_rotation_degrees:
- :ref:`Vector3<class_Vector3>` **environment_custom_sky_rotation_degrees**
.. rst-class:: classref-property
+----------+----------------------------------------------------+
| *Setter* | set_environment_custom_sky_rotation_degrees(value) |
+----------+----------------------------------------------------+
| *Getter* | get_environment_custom_sky_rotation_degrees() |
+----------+----------------------------------------------------+
:ref:`Vector3<class_Vector3>` **environment_custom_sky_rotation_degrees**
.. rst-class:: classref-property-setget
- void **set_environment_custom_sky_rotation_degrees** **(** :ref:`Vector3<class_Vector3>` value **)**
- :ref:`Vector3<class_Vector3>` **get_environment_custom_sky_rotation_degrees** **(** **)**
The rotation of the baked custom sky.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_environment_min_light:
- :ref:`Color<class_Color>` **environment_min_light**
.. rst-class:: classref-property
+-----------+----------------------------------+
| *Default* | ``Color( 0, 0, 0, 1 )`` |
+-----------+----------------------------------+
| *Setter* | set_environment_min_light(value) |
+-----------+----------------------------------+
| *Getter* | get_environment_min_light() |
+-----------+----------------------------------+
:ref:`Color<class_Color>` **environment_min_light** = ``Color( 0, 0, 0, 1 )``
.. rst-class:: classref-property-setget
- void **set_environment_min_light** **(** :ref:`Color<class_Color>` value **)**
- :ref:`Color<class_Color>` **get_environment_min_light** **(** **)**
Minimum ambient light for all the lightmap texels. This doesn't take into account any occlusion from the scene's geometry, it simply ensures a minimum amount of light on all the lightmap texels. Can be used for artistic control on shadow color.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_environment_mode:
- :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **environment_mode**
.. rst-class:: classref-property
+-----------+-----------------------------+
| *Default* | ``0`` |
+-----------+-----------------------------+
| *Setter* | set_environment_mode(value) |
+-----------+-----------------------------+
| *Getter* | get_environment_mode() |
+-----------+-----------------------------+
:ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **environment_mode** = ``0``
.. rst-class:: classref-property-setget
- void **set_environment_mode** **(** :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` value **)**
- :ref:`EnvironmentMode<enum_BakedLightmap_EnvironmentMode>` **get_environment_mode** **(** **)**
Decides which environment to use during baking.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_extents:
- :ref:`Vector3<class_Vector3>` **extents**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``Vector3( 10, 10, 10 )`` |
+-----------+---------------------------+
| *Setter* | set_extents(value) |
+-----------+---------------------------+
| *Getter* | get_extents() |
+-----------+---------------------------+
:ref:`Vector3<class_Vector3>` **extents** = ``Vector3( 10, 10, 10 )``
.. rst-class:: classref-property-setget
- void **set_extents** **(** :ref:`Vector3<class_Vector3>` value **)**
- :ref:`Vector3<class_Vector3>` **get_extents** **(** **)**
Size of the baked lightmap. Only meshes inside this region will be included in the baked lightmap, also used as the bounds of the captured region for dynamic lighting.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_image_path:
- :ref:`String<class_String>` **image_path**
.. rst-class:: classref-property
+----------+-----------------------+
| *Setter* | set_image_path(value) |
+----------+-----------------------+
| *Getter* | get_image_path() |
+----------+-----------------------+
:ref:`String<class_String>` **image_path**
.. rst-class:: classref-property-setget
- void **set_image_path** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_image_path** **(** **)**
Deprecated, in previous versions it determined the location where lightmaps were be saved.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_light_data:
- :ref:`BakedLightmapData<class_BakedLightmapData>` **light_data**
.. rst-class:: classref-property
+----------+-----------------------+
| *Setter* | set_light_data(value) |
+----------+-----------------------+
| *Getter* | get_light_data() |
+----------+-----------------------+
:ref:`BakedLightmapData<class_BakedLightmapData>` **light_data**
.. rst-class:: classref-property-setget
- void **set_light_data** **(** :ref:`BakedLightmapData<class_BakedLightmapData>` value **)**
- :ref:`BakedLightmapData<class_BakedLightmapData>` **get_light_data** **(** **)**
The calculated light data.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_quality:
- :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **quality**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``1`` |
+-----------+-------------------------+
| *Setter* | set_bake_quality(value) |
+-----------+-------------------------+
| *Getter* | get_bake_quality() |
+-----------+-------------------------+
:ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **quality** = ``1``
.. rst-class:: classref-property-setget
- void **set_bake_quality** **(** :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` value **)**
- :ref:`BakeQuality<enum_BakedLightmap_BakeQuality>` **get_bake_quality** **(** **)**
Determines the amount of samples per texel used in indirect light baking. The amount of samples for each quality level can be configured in the project settings.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_use_color:
- :ref:`bool<class_bool>` **use_color**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``true`` |
+-----------+----------------------+
| *Setter* | set_use_color(value) |
+-----------+----------------------+
| *Getter* | is_using_color() |
+-----------+----------------------+
:ref:`bool<class_bool>` **use_color** = ``true``
.. rst-class:: classref-property-setget
- void **set_use_color** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_using_color** **(** **)**
Store full color values in the lightmap textures. When disabled, lightmap textures will store a single brightness channel. Can be disabled to reduce disk usage if the scene contains only white lights or you don't mind losing color information in indirect lighting.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_use_denoiser:
- :ref:`bool<class_bool>` **use_denoiser**
.. rst-class:: classref-property
+-----------+-------------------------+
| *Default* | ``true`` |
+-----------+-------------------------+
| *Setter* | set_use_denoiser(value) |
+-----------+-------------------------+
| *Getter* | is_using_denoiser() |
+-----------+-------------------------+
:ref:`bool<class_bool>` **use_denoiser** = ``true``
.. rst-class:: classref-property-setget
- void **set_use_denoiser** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_using_denoiser** **(** **)**
When enabled, a lightmap denoiser will be used to reduce the noise inherent to Monte Carlo based global illumination.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmap_property_use_hdr:
- :ref:`bool<class_bool>` **use_hdr**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``true`` |
+-----------+--------------------+
| *Setter* | set_use_hdr(value) |
+-----------+--------------------+
| *Getter* | is_using_hdr() |
+-----------+--------------------+
:ref:`bool<class_bool>` **use_hdr** = ``true``
.. rst-class:: classref-property-setget
- void **set_use_hdr** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_using_hdr** **(** **)**
If ``true``, stores the lightmap textures in a high dynamic range format (EXR). If ``false``, stores the lightmap texture in a low dynamic range PNG image. This can be set to ``false`` to reduce disk usage, but light values over 1.0 will be clamped and you may see banding caused by the reduced precision.
\ **Note:** Setting :ref:`use_hdr<class_BakedLightmap_property_use_hdr>` to ``true`` will decrease lightmap banding even when using the GLES2 backend or if :ref:`ProjectSettings.rendering/quality/depth/hdr<class_ProjectSettings_property_rendering/quality/depth/hdr>` is ``false``.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_BakedLightmap_method_bake:
- :ref:`BakeError<enum_BakedLightmap_BakeError>` **bake** **(** :ref:`Node<class_Node>` from_node=null, :ref:`String<class_String>` data_save_path="" **)**
.. rst-class:: classref-method
:ref:`BakeError<enum_BakedLightmap_BakeError>` **bake** **(** :ref:`Node<class_Node>` from_node=null, :ref:`String<class_String>` data_save_path="" **)**
Bakes the lightmap, scanning from the given ``from_node`` root and saves the resulting :ref:`BakedLightmapData<class_BakedLightmapData>` in ``data_save_path``. If no root node is provided, parent of this node will be used as root instead. If no save path is provided it will try to match the path from the current :ref:`light_data<class_BakedLightmap_property_light_data>`.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -12,170 +12,261 @@ BakedLightmapData
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
.. container:: contribute
There is currently no description for this class. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`bounds<class_BakedLightmapData_property_bounds>` | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`cell_space_transform<class_BakedLightmapData_property_cell_space_transform>` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`int<class_int>` | :ref:`cell_subdiv<class_BakedLightmapData_property_cell_subdiv>` | ``1`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`float<class_float>` | :ref:`energy<class_BakedLightmapData_property_energy>` | ``1.0`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`interior<class_BakedLightmapData_property_interior>` | ``false`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`octree<class_BakedLightmapData_property_octree>` | ``PoolByteArray( )`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`bounds<class_BakedLightmapData_property_bounds>` | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`Transform<class_Transform>` | :ref:`cell_space_transform<class_BakedLightmapData_property_cell_space_transform>` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`int<class_int>` | :ref:`cell_subdiv<class_BakedLightmapData_property_cell_subdiv>` | ``1`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`float<class_float>` | :ref:`energy<class_BakedLightmapData_property_energy>` | ``1.0`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`interior<class_BakedLightmapData_property_interior>` | ``false`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`octree<class_BakedLightmapData_property_octree>` | ``PoolByteArray( )`` |
+-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_user<class_BakedLightmapData_method_add_user>` **(** :ref:`NodePath<class_NodePath>` path, :ref:`Resource<class_Resource>` lightmap, :ref:`int<class_int>` lightmap_slice, :ref:`Rect2<class_Rect2>` lightmap_uv_rect, :ref:`int<class_int>` instance **)** |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_data<class_BakedLightmapData_method_clear_data>` **(** **)** |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_users<class_BakedLightmapData_method_clear_users>` **(** **)** |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_user_count<class_BakedLightmapData_method_get_user_count>` **(** **)** |const| |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Resource<class_Resource>` | :ref:`get_user_lightmap<class_BakedLightmapData_method_get_user_lightmap>` **(** :ref:`int<class_int>` user_idx **)** |const| |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`get_user_path<class_BakedLightmapData_method_get_user_path>` **(** :ref:`int<class_int>` user_idx **)** |const| |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_user<class_BakedLightmapData_method_add_user>` **(** :ref:`NodePath<class_NodePath>` path, :ref:`Resource<class_Resource>` lightmap, :ref:`int<class_int>` lightmap_slice, :ref:`Rect2<class_Rect2>` lightmap_uv_rect, :ref:`int<class_int>` instance **)** |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_data<class_BakedLightmapData_method_clear_data>` **(** **)** |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_users<class_BakedLightmapData_method_clear_users>` **(** **)** |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_user_count<class_BakedLightmapData_method_get_user_count>` **(** **)** |const| |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Resource<class_Resource>` | :ref:`get_user_lightmap<class_BakedLightmapData_method_get_user_lightmap>` **(** :ref:`int<class_int>` user_idx **)** |const| |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`get_user_path<class_BakedLightmapData_method_get_user_path>` **(** :ref:`int<class_int>` user_idx **)** |const| |
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_BakedLightmapData_property_bounds:
- :ref:`AABB<class_AABB>` **bounds**
.. rst-class:: classref-property
+-----------+------------------------------+
| *Default* | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
+-----------+------------------------------+
| *Setter* | set_bounds(value) |
+-----------+------------------------------+
| *Getter* | get_bounds() |
+-----------+------------------------------+
:ref:`AABB<class_AABB>` **bounds** = ``AABB( 0, 0, 0, 0, 0, 0 )``
.. rst-class:: classref-property-setget
- void **set_bounds** **(** :ref:`AABB<class_AABB>` value **)**
- :ref:`AABB<class_AABB>` **get_bounds** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmapData_property_cell_space_transform:
- :ref:`Transform<class_Transform>` **cell_space_transform**
.. rst-class:: classref-property
+-----------+-----------------------------------------------------+
| *Default* | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` |
+-----------+-----------------------------------------------------+
| *Setter* | set_cell_space_transform(value) |
+-----------+-----------------------------------------------------+
| *Getter* | get_cell_space_transform() |
+-----------+-----------------------------------------------------+
:ref:`Transform<class_Transform>` **cell_space_transform** = ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )``
.. rst-class:: classref-property-setget
- void **set_cell_space_transform** **(** :ref:`Transform<class_Transform>` value **)**
- :ref:`Transform<class_Transform>` **get_cell_space_transform** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmapData_property_cell_subdiv:
- :ref:`int<class_int>` **cell_subdiv**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1`` |
+-----------+------------------------+
| *Setter* | set_cell_subdiv(value) |
+-----------+------------------------+
| *Getter* | get_cell_subdiv() |
+-----------+------------------------+
:ref:`int<class_int>` **cell_subdiv** = ``1``
.. rst-class:: classref-property-setget
- void **set_cell_subdiv** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_cell_subdiv** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmapData_property_energy:
- :ref:`float<class_float>` **energy**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``1.0`` |
+-----------+-------------------+
| *Setter* | set_energy(value) |
+-----------+-------------------+
| *Getter* | get_energy() |
+-----------+-------------------+
:ref:`float<class_float>` **energy** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_energy** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_energy** **(** **)**
Global energy multiplier for baked and dynamic capture objects. This can be changed at run-time without having to bake lightmaps again.
To adjust only the energy of indirect lighting (without affecting direct lighting or emissive materials), adjust :ref:`BakedLightmap.bounce_indirect_energy<class_BakedLightmap_property_bounce_indirect_energy>` and bake lightmaps again.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmapData_property_interior:
- :ref:`bool<class_bool>` **interior**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_interior(value) |
+-----------+---------------------+
| *Getter* | is_interior() |
+-----------+---------------------+
:ref:`bool<class_bool>` **interior** = ``false``
.. rst-class:: classref-property-setget
- void **set_interior** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_interior** **(** **)**
Controls whether dynamic capture objects receive environment lighting or not.
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmapData_property_octree:
- :ref:`PoolByteArray<class_PoolByteArray>` **octree**
.. rst-class:: classref-property
+-----------+-----------------------+
| *Default* | ``PoolByteArray( )`` |
+-----------+-----------------------+
| *Setter* | set_octree(value) |
+-----------+-----------------------+
| *Getter* | get_octree() |
+-----------+-----------------------+
:ref:`PoolByteArray<class_PoolByteArray>` **octree** = ``PoolByteArray( )``
.. rst-class:: classref-property-setget
- void **set_octree** **(** :ref:`PoolByteArray<class_PoolByteArray>` value **)**
- :ref:`PoolByteArray<class_PoolByteArray>` **get_octree** **(** **)**
.. container:: contribute
There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_BakedLightmapData_method_add_user:
- void **add_user** **(** :ref:`NodePath<class_NodePath>` path, :ref:`Resource<class_Resource>` lightmap, :ref:`int<class_int>` lightmap_slice, :ref:`Rect2<class_Rect2>` lightmap_uv_rect, :ref:`int<class_int>` instance **)**
.. rst-class:: classref-method
void **add_user** **(** :ref:`NodePath<class_NodePath>` path, :ref:`Resource<class_Resource>` lightmap, :ref:`int<class_int>` lightmap_slice, :ref:`Rect2<class_Rect2>` lightmap_uv_rect, :ref:`int<class_int>` instance **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmapData_method_clear_data:
- void **clear_data** **(** **)**
.. rst-class:: classref-method
void **clear_data** **(** **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmapData_method_clear_users:
- void **clear_users** **(** **)**
.. rst-class:: classref-method
void **clear_users** **(** **)**
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmapData_method_get_user_count:
- :ref:`int<class_int>` **get_user_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_user_count** **(** **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmapData_method_get_user_lightmap:
- :ref:`Resource<class_Resource>` **get_user_lightmap** **(** :ref:`int<class_int>` user_idx **)** |const|
.. rst-class:: classref-method
:ref:`Resource<class_Resource>` **get_user_lightmap** **(** :ref:`int<class_int>` user_idx **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_BakedLightmapData_method_get_user_path:
- :ref:`NodePath<class_NodePath>` **get_user_path** **(** :ref:`int<class_int>` user_idx **)** |const|
.. rst-class:: classref-method
:ref:`NodePath<class_NodePath>` **get_user_path** **(** :ref:`int<class_int>` user_idx **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,330 +16,444 @@ BaseButton
Base class for different kinds of buttons.
.. rst-class:: classref-introduction-group
Description
-----------
BaseButton is the abstract base class for buttons, so it shouldn't be used directly (it doesn't display anything). Other types of buttons inherit from it.
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`ActionMode<enum_BaseButton_ActionMode>` | :ref:`action_mode<class_BaseButton_property_action_mode>` | ``1`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`button_mask<class_BaseButton_property_button_mask>` | ``1`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`disabled<class_BaseButton_property_disabled>` | ``false`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`FocusMode<enum_Control_FocusMode>` | :ref:`enabled_focus_mode<class_BaseButton_property_enabled_focus_mode>` | ``2`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`ButtonGroup<class_ButtonGroup>` | :ref:`group<class_BaseButton_property_group>` | |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`keep_pressed_outside<class_BaseButton_property_keep_pressed_outside>` | ``false`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`pressed<class_BaseButton_property_pressed>` | ``false`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`ShortCut<class_ShortCut>` | :ref:`shortcut<class_BaseButton_property_shortcut>` | |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`shortcut_in_tooltip<class_BaseButton_property_shortcut_in_tooltip>` | ``true`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`toggle_mode<class_BaseButton_property_toggle_mode>` | ``false`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
.. table::
:widths: auto
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`ActionMode<enum_BaseButton_ActionMode>` | :ref:`action_mode<class_BaseButton_property_action_mode>` | ``1`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`button_mask<class_BaseButton_property_button_mask>` | ``1`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`disabled<class_BaseButton_property_disabled>` | ``false`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`FocusMode<enum_Control_FocusMode>` | :ref:`enabled_focus_mode<class_BaseButton_property_enabled_focus_mode>` | ``2`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`ButtonGroup<class_ButtonGroup>` | :ref:`group<class_BaseButton_property_group>` | |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`keep_pressed_outside<class_BaseButton_property_keep_pressed_outside>` | ``false`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`pressed<class_BaseButton_property_pressed>` | ``false`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`ShortCut<class_ShortCut>` | :ref:`shortcut<class_BaseButton_property_shortcut>` | |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`shortcut_in_tooltip<class_BaseButton_property_shortcut_in_tooltip>` | ``true`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`toggle_mode<class_BaseButton_property_toggle_mode>` | ``false`` |
+-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_pressed<class_BaseButton_method__pressed>` **(** **)** |virtual| |
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_toggled<class_BaseButton_method__toggled>` **(** :ref:`bool<class_bool>` button_pressed **)** |virtual| |
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`DrawMode<enum_BaseButton_DrawMode>` | :ref:`get_draw_mode<class_BaseButton_method_get_draw_mode>` **(** **)** |const| |
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_hovered<class_BaseButton_method_is_hovered>` **(** **)** |const| |
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_pressed_no_signal<class_BaseButton_method_set_pressed_no_signal>` **(** :ref:`bool<class_bool>` pressed **)** |
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_pressed<class_BaseButton_method__pressed>` **(** **)** |virtual| |
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`_toggled<class_BaseButton_method__toggled>` **(** :ref:`bool<class_bool>` button_pressed **)** |virtual| |
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`DrawMode<enum_BaseButton_DrawMode>` | :ref:`get_draw_mode<class_BaseButton_method_get_draw_mode>` **(** **)** |const| |
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_hovered<class_BaseButton_method_is_hovered>` **(** **)** |const| |
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_pressed_no_signal<class_BaseButton_method_set_pressed_no_signal>` **(** :ref:`bool<class_bool>` pressed **)** |
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_BaseButton_signal_button_down:
- **button_down** **(** **)**
.. rst-class:: classref-signal
**button_down** **(** **)**
Emitted when the button starts being held down.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_signal_button_up:
- **button_up** **(** **)**
.. rst-class:: classref-signal
**button_up** **(** **)**
Emitted when the button stops being held down.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_signal_pressed:
- **pressed** **(** **)**
.. rst-class:: classref-signal
**pressed** **(** **)**
Emitted when the button is toggled or pressed. This is on :ref:`button_down<class_BaseButton_signal_button_down>` if :ref:`action_mode<class_BaseButton_property_action_mode>` is :ref:`ACTION_MODE_BUTTON_PRESS<class_BaseButton_constant_ACTION_MODE_BUTTON_PRESS>` and on :ref:`button_up<class_BaseButton_signal_button_up>` otherwise.
If you need to know the button's pressed state (and :ref:`toggle_mode<class_BaseButton_property_toggle_mode>` is active), use :ref:`toggled<class_BaseButton_signal_toggled>` instead.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_signal_toggled:
- **toggled** **(** :ref:`bool<class_bool>` button_pressed **)**
.. rst-class:: classref-signal
**toggled** **(** :ref:`bool<class_bool>` button_pressed **)**
Emitted when the button was just toggled between pressed and normal states (only if :ref:`toggle_mode<class_BaseButton_property_toggle_mode>` is active). The new state is contained in the ``button_pressed`` argument.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_BaseButton_DrawMode:
.. _class_BaseButton_constant_DRAW_NORMAL:
.. _class_BaseButton_constant_DRAW_PRESSED:
.. _class_BaseButton_constant_DRAW_HOVER:
.. _class_BaseButton_constant_DRAW_DISABLED:
.. _class_BaseButton_constant_DRAW_HOVER_PRESSED:
.. rst-class:: classref-enumeration
enum **DrawMode**:
- **DRAW_NORMAL** = **0** --- The normal state (i.e. not pressed, not hovered, not toggled and enabled) of buttons.
.. _class_BaseButton_constant_DRAW_NORMAL:
- **DRAW_PRESSED** = **1** --- The state of buttons are pressed.
.. rst-class:: classref-enumeration-constant
- **DRAW_HOVER** = **2** --- The state of buttons are hovered.
:ref:`DrawMode<enum_BaseButton_DrawMode>` **DRAW_NORMAL** = ``0``
- **DRAW_DISABLED** = **3** --- The state of buttons are disabled.
The normal state (i.e. not pressed, not hovered, not toggled and enabled) of buttons.
- **DRAW_HOVER_PRESSED** = **4** --- The state of buttons are both hovered and pressed.
.. _class_BaseButton_constant_DRAW_PRESSED:
.. rst-class:: classref-enumeration-constant
:ref:`DrawMode<enum_BaseButton_DrawMode>` **DRAW_PRESSED** = ``1``
The state of buttons are pressed.
.. _class_BaseButton_constant_DRAW_HOVER:
.. rst-class:: classref-enumeration-constant
:ref:`DrawMode<enum_BaseButton_DrawMode>` **DRAW_HOVER** = ``2``
The state of buttons are hovered.
.. _class_BaseButton_constant_DRAW_DISABLED:
.. rst-class:: classref-enumeration-constant
:ref:`DrawMode<enum_BaseButton_DrawMode>` **DRAW_DISABLED** = ``3``
The state of buttons are disabled.
.. _class_BaseButton_constant_DRAW_HOVER_PRESSED:
.. rst-class:: classref-enumeration-constant
:ref:`DrawMode<enum_BaseButton_DrawMode>` **DRAW_HOVER_PRESSED** = ``4``
The state of buttons are both hovered and pressed.
.. rst-class:: classref-item-separator
----
.. _enum_BaseButton_ActionMode:
.. _class_BaseButton_constant_ACTION_MODE_BUTTON_PRESS:
.. _class_BaseButton_constant_ACTION_MODE_BUTTON_RELEASE:
.. rst-class:: classref-enumeration
enum **ActionMode**:
- **ACTION_MODE_BUTTON_PRESS** = **0** --- Require just a press to consider the button clicked.
.. _class_BaseButton_constant_ACTION_MODE_BUTTON_PRESS:
- **ACTION_MODE_BUTTON_RELEASE** = **1** --- Require a press and a subsequent release before considering the button clicked.
.. rst-class:: classref-enumeration-constant
:ref:`ActionMode<enum_BaseButton_ActionMode>` **ACTION_MODE_BUTTON_PRESS** = ``0``
Require just a press to consider the button clicked.
.. _class_BaseButton_constant_ACTION_MODE_BUTTON_RELEASE:
.. rst-class:: classref-enumeration-constant
:ref:`ActionMode<enum_BaseButton_ActionMode>` **ACTION_MODE_BUTTON_RELEASE** = ``1``
Require a press and a subsequent release before considering the button clicked.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_BaseButton_property_action_mode:
- :ref:`ActionMode<enum_BaseButton_ActionMode>` **action_mode**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1`` |
+-----------+------------------------+
| *Setter* | set_action_mode(value) |
+-----------+------------------------+
| *Getter* | get_action_mode() |
+-----------+------------------------+
:ref:`ActionMode<enum_BaseButton_ActionMode>` **action_mode** = ``1``
.. rst-class:: classref-property-setget
- void **set_action_mode** **(** :ref:`ActionMode<enum_BaseButton_ActionMode>` value **)**
- :ref:`ActionMode<enum_BaseButton_ActionMode>` **get_action_mode** **(** **)**
Determines when the button is considered clicked, one of the :ref:`ActionMode<enum_BaseButton_ActionMode>` constants.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_property_button_mask:
- :ref:`int<class_int>` **button_mask**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``1`` |
+-----------+------------------------+
| *Setter* | set_button_mask(value) |
+-----------+------------------------+
| *Getter* | get_button_mask() |
+-----------+------------------------+
:ref:`int<class_int>` **button_mask** = ``1``
.. rst-class:: classref-property-setget
- void **set_button_mask** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_button_mask** **(** **)**
Binary mask to choose which mouse buttons this button will respond to.
To allow both left-click and right-click, use ``BUTTON_MASK_LEFT | BUTTON_MASK_RIGHT``.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_property_disabled:
- :ref:`bool<class_bool>` **disabled**
.. rst-class:: classref-property
+-----------+---------------------+
| *Default* | ``false`` |
+-----------+---------------------+
| *Setter* | set_disabled(value) |
+-----------+---------------------+
| *Getter* | is_disabled() |
+-----------+---------------------+
:ref:`bool<class_bool>` **disabled** = ``false``
.. rst-class:: classref-property-setget
- void **set_disabled** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_disabled** **(** **)**
If ``true``, the button is in disabled state and can't be clicked or toggled.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_property_enabled_focus_mode:
- :ref:`FocusMode<enum_Control_FocusMode>` **enabled_focus_mode**
.. rst-class:: classref-property
+-----------+-------------------------------+
| *Default* | ``2`` |
+-----------+-------------------------------+
| *Setter* | set_enabled_focus_mode(value) |
+-----------+-------------------------------+
| *Getter* | get_enabled_focus_mode() |
+-----------+-------------------------------+
:ref:`FocusMode<enum_Control_FocusMode>` **enabled_focus_mode** = ``2``
.. rst-class:: classref-property-setget
- void **set_enabled_focus_mode** **(** :ref:`FocusMode<enum_Control_FocusMode>` value **)**
- :ref:`FocusMode<enum_Control_FocusMode>` **get_enabled_focus_mode** **(** **)**
*Deprecated.* This property has been deprecated due to redundancy and will be removed in Godot 4.0. This property no longer has any effect when set. Please use :ref:`Control.focus_mode<class_Control_property_focus_mode>` instead.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_property_group:
- :ref:`ButtonGroup<class_ButtonGroup>` **group**
.. rst-class:: classref-property
+----------+-------------------------+
| *Setter* | set_button_group(value) |
+----------+-------------------------+
| *Getter* | get_button_group() |
+----------+-------------------------+
:ref:`ButtonGroup<class_ButtonGroup>` **group**
.. rst-class:: classref-property-setget
- void **set_button_group** **(** :ref:`ButtonGroup<class_ButtonGroup>` value **)**
- :ref:`ButtonGroup<class_ButtonGroup>` **get_button_group** **(** **)**
:ref:`ButtonGroup<class_ButtonGroup>` associated to the button.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_property_keep_pressed_outside:
- :ref:`bool<class_bool>` **keep_pressed_outside**
.. rst-class:: classref-property
+-----------+---------------------------------+
| *Default* | ``false`` |
+-----------+---------------------------------+
| *Setter* | set_keep_pressed_outside(value) |
+-----------+---------------------------------+
| *Getter* | is_keep_pressed_outside() |
+-----------+---------------------------------+
:ref:`bool<class_bool>` **keep_pressed_outside** = ``false``
.. rst-class:: classref-property-setget
- void **set_keep_pressed_outside** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_keep_pressed_outside** **(** **)**
If ``true``, the button stays pressed when moving the cursor outside the button while pressing it.
\ **Note:** This property only affects the button's visual appearance. Signals will be emitted at the same moment regardless of this property's value.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_property_pressed:
- :ref:`bool<class_bool>` **pressed**
.. rst-class:: classref-property
+-----------+--------------------+
| *Default* | ``false`` |
+-----------+--------------------+
| *Setter* | set_pressed(value) |
+-----------+--------------------+
| *Getter* | is_pressed() |
+-----------+--------------------+
:ref:`bool<class_bool>` **pressed** = ``false``
.. rst-class:: classref-property-setget
- void **set_pressed** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_pressed** **(** **)**
If ``true``, the button's state is pressed. Means the button is pressed down or toggled (if :ref:`toggle_mode<class_BaseButton_property_toggle_mode>` is active). Only works if :ref:`toggle_mode<class_BaseButton_property_toggle_mode>` is ``true``.
\ **Note:** Setting :ref:`pressed<class_BaseButton_property_pressed>` will result in :ref:`toggled<class_BaseButton_signal_toggled>` to be emitted. If you want to change the pressed state without emitting that signal, use :ref:`set_pressed_no_signal<class_BaseButton_method_set_pressed_no_signal>`.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_property_shortcut:
- :ref:`ShortCut<class_ShortCut>` **shortcut**
.. rst-class:: classref-property
+----------+---------------------+
| *Setter* | set_shortcut(value) |
+----------+---------------------+
| *Getter* | get_shortcut() |
+----------+---------------------+
:ref:`ShortCut<class_ShortCut>` **shortcut**
.. rst-class:: classref-property-setget
- void **set_shortcut** **(** :ref:`ShortCut<class_ShortCut>` value **)**
- :ref:`ShortCut<class_ShortCut>` **get_shortcut** **(** **)**
:ref:`ShortCut<class_ShortCut>` associated to the button.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_property_shortcut_in_tooltip:
- :ref:`bool<class_bool>` **shortcut_in_tooltip**
.. rst-class:: classref-property
+-----------+----------------------------------+
| *Default* | ``true`` |
+-----------+----------------------------------+
| *Setter* | set_shortcut_in_tooltip(value) |
+-----------+----------------------------------+
| *Getter* | is_shortcut_in_tooltip_enabled() |
+-----------+----------------------------------+
:ref:`bool<class_bool>` **shortcut_in_tooltip** = ``true``
.. rst-class:: classref-property-setget
- void **set_shortcut_in_tooltip** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_shortcut_in_tooltip_enabled** **(** **)**
If ``true``, the button will add information about its shortcut in the tooltip.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_property_toggle_mode:
- :ref:`bool<class_bool>` **toggle_mode**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``false`` |
+-----------+------------------------+
| *Setter* | set_toggle_mode(value) |
+-----------+------------------------+
| *Getter* | is_toggle_mode() |
+-----------+------------------------+
:ref:`bool<class_bool>` **toggle_mode** = ``false``
.. rst-class:: classref-property-setget
- void **set_toggle_mode** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_toggle_mode** **(** **)**
If ``true``, the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_BaseButton_method__pressed:
- void **_pressed** **(** **)** |virtual|
.. rst-class:: classref-method
void **_pressed** **(** **)** |virtual|
Called when the button is pressed. If you need to know the button's pressed state (and :ref:`toggle_mode<class_BaseButton_property_toggle_mode>` is active), use :ref:`_toggled<class_BaseButton_method__toggled>` instead.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_method__toggled:
- void **_toggled** **(** :ref:`bool<class_bool>` button_pressed **)** |virtual|
.. rst-class:: classref-method
void **_toggled** **(** :ref:`bool<class_bool>` button_pressed **)** |virtual|
Called when the button is toggled (only if :ref:`toggle_mode<class_BaseButton_property_toggle_mode>` is active).
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_method_get_draw_mode:
- :ref:`DrawMode<enum_BaseButton_DrawMode>` **get_draw_mode** **(** **)** |const|
.. rst-class:: classref-method
:ref:`DrawMode<enum_BaseButton_DrawMode>` **get_draw_mode** **(** **)** |const|
Returns the visual state used to draw the button. This is useful mainly when implementing your own draw code by either overriding _draw() or connecting to "draw" signal. The visual state of the button is defined by the :ref:`DrawMode<enum_BaseButton_DrawMode>` enum.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_method_is_hovered:
- :ref:`bool<class_bool>` **is_hovered** **(** **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_hovered** **(** **)** |const|
Returns ``true`` if the mouse has entered the button and has not left it yet.
.. rst-class:: classref-item-separator
----
.. _class_BaseButton_method_set_pressed_no_signal:
- void **set_pressed_no_signal** **(** :ref:`bool<class_bool>` pressed **)**
.. rst-class:: classref-method
void **set_pressed_no_signal** **(** :ref:`bool<class_bool>` pressed **)**
Changes the :ref:`pressed<class_BaseButton_property_pressed>` state of the button, without emitting :ref:`toggled<class_BaseButton_signal_toggled>`. Use when you just want to change the state of the button without sending the pressed event (e.g. when initializing scene). Only works if :ref:`toggle_mode<class_BaseButton_property_toggle_mode>` is ``true``.
@@ -348,3 +462,4 @@ Changes the :ref:`pressed<class_BaseButton_property_pressed>` state of the butto
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -12,6 +12,8 @@ Basis
3×3 matrix datatype.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -23,6 +25,8 @@ Can also be accessed as array of 3D vectors. These vectors are normally orthogon
For more information, read the "Matrices and transforms" documentation article.
.. rst-class:: classref-introduction-group
Tutorials
---------
@@ -40,290 +44,414 @@ Tutorials
- `2.5D Demo <https://godotengine.org/asset-library/asset/583>`__
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------------+----------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`x<class_Basis_property_x>` | ``Vector3( 1, 0, 0 )`` |
+-------------------------------+----------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`y<class_Basis_property_y>` | ``Vector3( 0, 1, 0 )`` |
+-------------------------------+----------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`z<class_Basis_property_z>` | ``Vector3( 0, 0, 1 )`` |
+-------------------------------+----------------------------------+------------------------+
.. table::
:widths: auto
+-------------------------------+----------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`x<class_Basis_property_x>` | ``Vector3( 1, 0, 0 )`` |
+-------------------------------+----------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`y<class_Basis_property_y>` | ``Vector3( 0, 1, 0 )`` |
+-------------------------------+----------------------------------+------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`z<class_Basis_property_z>` | ``Vector3( 0, 0, 1 )`` |
+-------------------------------+----------------------------------+------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_method_Basis>` **(** :ref:`Quat<class_Quat>` from **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_method_Basis>` **(** :ref:`Vector3<class_Vector3>` from **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_method_Basis>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_method_Basis>` **(** :ref:`Vector3<class_Vector3>` x_axis, :ref:`Vector3<class_Vector3>` y_axis, :ref:`Vector3<class_Vector3>` z_axis **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`determinant<class_Basis_method_determinant>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_euler<class_Basis_method_get_euler>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_orthogonal_index<class_Basis_method_get_orthogonal_index>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Quat<class_Quat>` | :ref:`get_rotation_quat<class_Basis_method_get_rotation_quat>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_scale<class_Basis_method_get_scale>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`inverse<class_Basis_method_inverse>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_Basis_method_is_equal_approx>` **(** :ref:`Basis<class_Basis>` b, :ref:`float<class_float>` epsilon=1e-05 **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`orthonormalized<class_Basis_method_orthonormalized>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`rotated<class_Basis_method_rotated>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`scaled<class_Basis_method_scaled>` **(** :ref:`Vector3<class_Vector3>` scale **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`slerp<class_Basis_method_slerp>` **(** :ref:`Basis<class_Basis>` to, :ref:`float<class_float>` weight **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`tdotx<class_Basis_method_tdotx>` **(** :ref:`Vector3<class_Vector3>` with **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`tdoty<class_Basis_method_tdoty>` **(** :ref:`Vector3<class_Vector3>` with **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`tdotz<class_Basis_method_tdotz>` **(** :ref:`Vector3<class_Vector3>` with **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`transposed<class_Basis_method_transposed>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`xform<class_Basis_method_xform>` **(** :ref:`Vector3<class_Vector3>` v **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`xform_inv<class_Basis_method_xform_inv>` **(** :ref:`Vector3<class_Vector3>` v **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_method_Basis>` **(** :ref:`Quat<class_Quat>` from **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_method_Basis>` **(** :ref:`Vector3<class_Vector3>` from **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_method_Basis>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_method_Basis>` **(** :ref:`Vector3<class_Vector3>` x_axis, :ref:`Vector3<class_Vector3>` y_axis, :ref:`Vector3<class_Vector3>` z_axis **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`determinant<class_Basis_method_determinant>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_euler<class_Basis_method_get_euler>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_orthogonal_index<class_Basis_method_get_orthogonal_index>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Quat<class_Quat>` | :ref:`get_rotation_quat<class_Basis_method_get_rotation_quat>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_scale<class_Basis_method_get_scale>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`inverse<class_Basis_method_inverse>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_Basis_method_is_equal_approx>` **(** :ref:`Basis<class_Basis>` b, :ref:`float<class_float>` epsilon=1e-05 **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`orthonormalized<class_Basis_method_orthonormalized>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`rotated<class_Basis_method_rotated>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`scaled<class_Basis_method_scaled>` **(** :ref:`Vector3<class_Vector3>` scale **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`slerp<class_Basis_method_slerp>` **(** :ref:`Basis<class_Basis>` to, :ref:`float<class_float>` weight **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`tdotx<class_Basis_method_tdotx>` **(** :ref:`Vector3<class_Vector3>` with **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`tdoty<class_Basis_method_tdoty>` **(** :ref:`Vector3<class_Vector3>` with **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`tdotz<class_Basis_method_tdotz>` **(** :ref:`Vector3<class_Vector3>` with **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Basis<class_Basis>` | :ref:`transposed<class_Basis_method_transposed>` **(** **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`xform<class_Basis_method_xform>` **(** :ref:`Vector3<class_Vector3>` v **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`xform_inv<class_Basis_method_xform_inv>` **(** :ref:`Vector3<class_Vector3>` v **)** |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Constants
---------
.. _class_Basis_constant_IDENTITY:
.. _class_Basis_constant_FLIP_X:
.. rst-class:: classref-constant
.. _class_Basis_constant_FLIP_Y:
**IDENTITY** = ``Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )``
.. _class_Basis_constant_FLIP_Z:
- **IDENTITY** = **Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )** --- The identity basis, with no rotation or scaling applied.
The identity basis, with no rotation or scaling applied.
This is identical to calling ``Basis()`` without any parameters. This constant can be used to make your code clearer, and for consistency with C#.
- **FLIP_X** = **Basis( -1, 0, 0, 0, 1, 0, 0, 0, 1 )** --- The basis that will flip something along the X axis when used in a transformation.
.. _class_Basis_constant_FLIP_X:
- **FLIP_Y** = **Basis( 1, 0, 0, 0, -1, 0, 0, 0, 1 )** --- The basis that will flip something along the Y axis when used in a transformation.
.. rst-class:: classref-constant
- **FLIP_Z** = **Basis( 1, 0, 0, 0, 1, 0, 0, 0, -1 )** --- The basis that will flip something along the Z axis when used in a transformation.
**FLIP_X** = ``Basis( -1, 0, 0, 0, 1, 0, 0, 0, 1 )``
The basis that will flip something along the X axis when used in a transformation.
.. _class_Basis_constant_FLIP_Y:
.. rst-class:: classref-constant
**FLIP_Y** = ``Basis( 1, 0, 0, 0, -1, 0, 0, 0, 1 )``
The basis that will flip something along the Y axis when used in a transformation.
.. _class_Basis_constant_FLIP_Z:
.. rst-class:: classref-constant
**FLIP_Z** = ``Basis( 1, 0, 0, 0, 1, 0, 0, 0, -1 )``
The basis that will flip something along the Z axis when used in a transformation.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_Basis_property_x:
- :ref:`Vector3<class_Vector3>` **x**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``Vector3( 1, 0, 0 )`` |
+-----------+------------------------+
:ref:`Vector3<class_Vector3>` **x** = ``Vector3( 1, 0, 0 )``
The basis matrix's X vector (column 0). Equivalent to array index ``0``.
.. rst-class:: classref-item-separator
----
.. _class_Basis_property_y:
- :ref:`Vector3<class_Vector3>` **y**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``Vector3( 0, 1, 0 )`` |
+-----------+------------------------+
:ref:`Vector3<class_Vector3>` **y** = ``Vector3( 0, 1, 0 )``
The basis matrix's Y vector (column 1). Equivalent to array index ``1``.
.. rst-class:: classref-item-separator
----
.. _class_Basis_property_z:
- :ref:`Vector3<class_Vector3>` **z**
.. rst-class:: classref-property
+-----------+------------------------+
| *Default* | ``Vector3( 0, 0, 1 )`` |
+-----------+------------------------+
:ref:`Vector3<class_Vector3>` **z** = ``Vector3( 0, 0, 1 )``
The basis matrix's Z vector (column 2). Equivalent to array index ``2``.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_Basis_method_Basis:
- :ref:`Basis<class_Basis>` **Basis** **(** :ref:`Quat<class_Quat>` from **)**
.. rst-class:: classref-method
:ref:`Basis<class_Basis>` **Basis** **(** :ref:`Quat<class_Quat>` from **)**
Constructs a pure rotation basis matrix from the given quaternion.
.. rst-class:: classref-item-separator
----
- :ref:`Basis<class_Basis>` **Basis** **(** :ref:`Vector3<class_Vector3>` from **)**
.. rst-class:: classref-method
:ref:`Basis<class_Basis>` **Basis** **(** :ref:`Vector3<class_Vector3>` from **)**
Constructs a pure rotation basis matrix from the given Euler angles (in the YXZ convention: when \*composing\*, first Y, then X, and Z last), given in the vector format as (X angle, Y angle, Z angle).
Consider using the :ref:`Quat<class_Quat>` constructor instead, which uses a quaternion instead of Euler angles.
.. rst-class:: classref-item-separator
----
- :ref:`Basis<class_Basis>` **Basis** **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)**
.. rst-class:: classref-method
:ref:`Basis<class_Basis>` **Basis** **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)**
Constructs a pure rotation basis matrix, rotated around the given ``axis`` by ``angle`` (in radians). The axis must be a normalized vector.
.. rst-class:: classref-item-separator
----
- :ref:`Basis<class_Basis>` **Basis** **(** :ref:`Vector3<class_Vector3>` x_axis, :ref:`Vector3<class_Vector3>` y_axis, :ref:`Vector3<class_Vector3>` z_axis **)**
.. rst-class:: classref-method
:ref:`Basis<class_Basis>` **Basis** **(** :ref:`Vector3<class_Vector3>` x_axis, :ref:`Vector3<class_Vector3>` y_axis, :ref:`Vector3<class_Vector3>` z_axis **)**
Constructs a basis matrix from 3 axis vectors (matrix columns).
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_determinant:
- :ref:`float<class_float>` **determinant** **(** **)**
.. rst-class:: classref-method
:ref:`float<class_float>` **determinant** **(** **)**
Returns the determinant of the basis matrix. If the basis is uniformly scaled, its determinant is the square of the scale.
A negative determinant means the basis has a negative scale. A zero determinant means the basis isn't invertible, and is usually considered invalid.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_get_euler:
- :ref:`Vector3<class_Vector3>` **get_euler** **(** **)**
.. rst-class:: classref-method
:ref:`Vector3<class_Vector3>` **get_euler** **(** **)**
Returns the basis's rotation in the form of Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last). The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle).
Consider using the :ref:`get_rotation_quat<class_Basis_method_get_rotation_quat>` method instead, which returns a :ref:`Quat<class_Quat>` quaternion instead of Euler angles.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_get_orthogonal_index:
- :ref:`int<class_int>` **get_orthogonal_index** **(** **)**
.. rst-class:: classref-method
:ref:`int<class_int>` **get_orthogonal_index** **(** **)**
This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x,y,z) with each component being either -1, 0, or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the :ref:`GridMap<class_GridMap>` editor. For further details, refer to the Godot source code.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_get_rotation_quat:
- :ref:`Quat<class_Quat>` **get_rotation_quat** **(** **)**
.. rst-class:: classref-method
:ref:`Quat<class_Quat>` **get_rotation_quat** **(** **)**
Returns the basis's rotation in the form of a quaternion. See :ref:`get_euler<class_Basis_method_get_euler>` if you need Euler angles, but keep in mind quaternions should generally be preferred to Euler angles.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_get_scale:
- :ref:`Vector3<class_Vector3>` **get_scale** **(** **)**
.. rst-class:: classref-method
:ref:`Vector3<class_Vector3>` **get_scale** **(** **)**
Assuming that the matrix is the combination of a rotation and scaling, return the absolute value of scaling factors along each axis.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_inverse:
- :ref:`Basis<class_Basis>` **inverse** **(** **)**
.. rst-class:: classref-method
:ref:`Basis<class_Basis>` **inverse** **(** **)**
Returns the inverse of the matrix.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_is_equal_approx:
- :ref:`bool<class_bool>` **is_equal_approx** **(** :ref:`Basis<class_Basis>` b, :ref:`float<class_float>` epsilon=1e-05 **)**
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_equal_approx** **(** :ref:`Basis<class_Basis>` b, :ref:`float<class_float>` epsilon=1e-05 **)**
Returns ``true`` if this basis and ``b`` are approximately equal, by calling ``is_equal_approx`` on each component.
\ **Note:** For complicated reasons, the epsilon argument is always discarded. Don't use the epsilon argument, it does nothing.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_orthonormalized:
- :ref:`Basis<class_Basis>` **orthonormalized** **(** **)**
.. rst-class:: classref-method
:ref:`Basis<class_Basis>` **orthonormalized** **(** **)**
Returns the orthonormalized version of the matrix (useful to call from time to time to avoid rounding error for orthogonal matrices). This performs a Gram-Schmidt orthonormalization on the basis of the matrix.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_rotated:
- :ref:`Basis<class_Basis>` **rotated** **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)**
.. rst-class:: classref-method
:ref:`Basis<class_Basis>` **rotated** **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)**
Introduce an additional rotation around the given axis by ``angle`` (in radians). The axis must be a normalized vector.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_scaled:
- :ref:`Basis<class_Basis>` **scaled** **(** :ref:`Vector3<class_Vector3>` scale **)**
.. rst-class:: classref-method
:ref:`Basis<class_Basis>` **scaled** **(** :ref:`Vector3<class_Vector3>` scale **)**
Introduce an additional scaling specified by the given 3D scaling factor.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_slerp:
- :ref:`Basis<class_Basis>` **slerp** **(** :ref:`Basis<class_Basis>` to, :ref:`float<class_float>` weight **)**
.. rst-class:: classref-method
:ref:`Basis<class_Basis>` **slerp** **(** :ref:`Basis<class_Basis>` to, :ref:`float<class_float>` weight **)**
Assuming that the matrix is a proper rotation matrix, slerp performs a spherical-linear interpolation with another rotation matrix.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_tdotx:
- :ref:`float<class_float>` **tdotx** **(** :ref:`Vector3<class_Vector3>` with **)**
.. rst-class:: classref-method
:ref:`float<class_float>` **tdotx** **(** :ref:`Vector3<class_Vector3>` with **)**
Transposed dot product with the X axis of the matrix.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_tdoty:
- :ref:`float<class_float>` **tdoty** **(** :ref:`Vector3<class_Vector3>` with **)**
.. rst-class:: classref-method
:ref:`float<class_float>` **tdoty** **(** :ref:`Vector3<class_Vector3>` with **)**
Transposed dot product with the Y axis of the matrix.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_tdotz:
- :ref:`float<class_float>` **tdotz** **(** :ref:`Vector3<class_Vector3>` with **)**
.. rst-class:: classref-method
:ref:`float<class_float>` **tdotz** **(** :ref:`Vector3<class_Vector3>` with **)**
Transposed dot product with the Z axis of the matrix.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_transposed:
- :ref:`Basis<class_Basis>` **transposed** **(** **)**
.. rst-class:: classref-method
:ref:`Basis<class_Basis>` **transposed** **(** **)**
Returns the transposed version of the matrix.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_xform:
- :ref:`Vector3<class_Vector3>` **xform** **(** :ref:`Vector3<class_Vector3>` v **)**
.. rst-class:: classref-method
:ref:`Vector3<class_Vector3>` **xform** **(** :ref:`Vector3<class_Vector3>` v **)**
Returns a vector transformed (multiplied) by the matrix.
.. rst-class:: classref-item-separator
----
.. _class_Basis_method_xform_inv:
- :ref:`Vector3<class_Vector3>` **xform_inv** **(** :ref:`Vector3<class_Vector3>` v **)**
.. rst-class:: classref-method
:ref:`Vector3<class_Vector3>` **xform_inv** **(** :ref:`Vector3<class_Vector3>` v **)**
Returns a vector transformed (multiplied) by the transposed basis matrix.
@@ -332,3 +460,4 @@ Returns a vector transformed (multiplied) by the transposed basis matrix.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,125 +14,185 @@ BitMap
Boolean matrix.
.. rst-class:: classref-introduction-group
Description
-----------
A two-dimensional array of boolean values, can be used to efficiently store a binary matrix (every matrix element takes only one bit) and query the values using natural cartesian coordinates.
.. rst-class:: classref-reftable-group
Methods
-------
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Image<class_Image>` | :ref:`convert_to_image<class_BitMap_method_convert_to_image>` **(** **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`create<class_BitMap_method_create>` **(** :ref:`Vector2<class_Vector2>` size **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`create_from_image_alpha<class_BitMap_method_create_from_image_alpha>` **(** :ref:`Image<class_Image>` image, :ref:`float<class_float>` threshold=0.1 **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_bit<class_BitMap_method_get_bit>` **(** :ref:`Vector2<class_Vector2>` position **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_size<class_BitMap_method_get_size>` **(** **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_true_bit_count<class_BitMap_method_get_true_bit_count>` **(** **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`grow_mask<class_BitMap_method_grow_mask>` **(** :ref:`int<class_int>` pixels, :ref:`Rect2<class_Rect2>` rect **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`opaque_to_polygons<class_BitMap_method_opaque_to_polygons>` **(** :ref:`Rect2<class_Rect2>` rect, :ref:`float<class_float>` epsilon=2.0 **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`resize<class_BitMap_method_resize>` **(** :ref:`Vector2<class_Vector2>` new_size **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bit<class_BitMap_method_set_bit>` **(** :ref:`Vector2<class_Vector2>` position, :ref:`bool<class_bool>` bit **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bit_rect<class_BitMap_method_set_bit_rect>` **(** :ref:`Rect2<class_Rect2>` rect, :ref:`bool<class_bool>` bit **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Image<class_Image>` | :ref:`convert_to_image<class_BitMap_method_convert_to_image>` **(** **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`create<class_BitMap_method_create>` **(** :ref:`Vector2<class_Vector2>` size **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`create_from_image_alpha<class_BitMap_method_create_from_image_alpha>` **(** :ref:`Image<class_Image>` image, :ref:`float<class_float>` threshold=0.1 **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_bit<class_BitMap_method_get_bit>` **(** :ref:`Vector2<class_Vector2>` position **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_size<class_BitMap_method_get_size>` **(** **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_true_bit_count<class_BitMap_method_get_true_bit_count>` **(** **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`grow_mask<class_BitMap_method_grow_mask>` **(** :ref:`int<class_int>` pixels, :ref:`Rect2<class_Rect2>` rect **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`opaque_to_polygons<class_BitMap_method_opaque_to_polygons>` **(** :ref:`Rect2<class_Rect2>` rect, :ref:`float<class_float>` epsilon=2.0 **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`resize<class_BitMap_method_resize>` **(** :ref:`Vector2<class_Vector2>` new_size **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bit<class_BitMap_method_set_bit>` **(** :ref:`Vector2<class_Vector2>` position, :ref:`bool<class_bool>` bit **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_bit_rect<class_BitMap_method_set_bit_rect>` **(** :ref:`Rect2<class_Rect2>` rect, :ref:`bool<class_bool>` bit **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_BitMap_method_convert_to_image:
- :ref:`Image<class_Image>` **convert_to_image** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Image<class_Image>` **convert_to_image** **(** **)** |const|
Returns an image of the same size as the bitmap and with a :ref:`Format<enum_Image_Format>` of type ``FORMAT_L8``. ``true`` bits of the bitmap are being converted into white pixels, and ``false`` bits into black.
.. rst-class:: classref-item-separator
----
.. _class_BitMap_method_create:
- void **create** **(** :ref:`Vector2<class_Vector2>` size **)**
.. rst-class:: classref-method
void **create** **(** :ref:`Vector2<class_Vector2>` size **)**
Creates a bitmap with the specified size, filled with ``false``.
.. rst-class:: classref-item-separator
----
.. _class_BitMap_method_create_from_image_alpha:
- void **create_from_image_alpha** **(** :ref:`Image<class_Image>` image, :ref:`float<class_float>` threshold=0.1 **)**
.. rst-class:: classref-method
void **create_from_image_alpha** **(** :ref:`Image<class_Image>` image, :ref:`float<class_float>` threshold=0.1 **)**
Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to ``false`` if the alpha value of the image at that position is equal to ``threshold`` or less, and ``true`` in other case.
.. rst-class:: classref-item-separator
----
.. _class_BitMap_method_get_bit:
- :ref:`bool<class_bool>` **get_bit** **(** :ref:`Vector2<class_Vector2>` position **)** |const|
.. rst-class:: classref-method
:ref:`bool<class_bool>` **get_bit** **(** :ref:`Vector2<class_Vector2>` position **)** |const|
Returns bitmap's value at the specified position.
.. rst-class:: classref-item-separator
----
.. _class_BitMap_method_get_size:
- :ref:`Vector2<class_Vector2>` **get_size** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_size** **(** **)** |const|
Returns bitmap's dimensions.
.. rst-class:: classref-item-separator
----
.. _class_BitMap_method_get_true_bit_count:
- :ref:`int<class_int>` **get_true_bit_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_true_bit_count** **(** **)** |const|
Returns the amount of bitmap elements that are set to ``true``.
.. rst-class:: classref-item-separator
----
.. _class_BitMap_method_grow_mask:
- void **grow_mask** **(** :ref:`int<class_int>` pixels, :ref:`Rect2<class_Rect2>` rect **)**
.. rst-class:: classref-method
void **grow_mask** **(** :ref:`int<class_int>` pixels, :ref:`Rect2<class_Rect2>` rect **)**
Applies morphological dilation or erosion to the bitmap. If ``pixels`` is positive, dilation is applied to the bitmap. If ``pixels`` is negative, erosion is applied to the bitmap. ``rect`` defines the area where the morphological operation is applied. Pixels located outside the ``rect`` are unaffected by :ref:`grow_mask<class_BitMap_method_grow_mask>`.
.. rst-class:: classref-item-separator
----
.. _class_BitMap_method_opaque_to_polygons:
- :ref:`Array<class_Array>` **opaque_to_polygons** **(** :ref:`Rect2<class_Rect2>` rect, :ref:`float<class_float>` epsilon=2.0 **)** |const|
.. rst-class:: classref-method
:ref:`Array<class_Array>` **opaque_to_polygons** **(** :ref:`Rect2<class_Rect2>` rect, :ref:`float<class_float>` epsilon=2.0 **)** |const|
.. container:: contribute
There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
.. rst-class:: classref-item-separator
----
.. _class_BitMap_method_resize:
- void **resize** **(** :ref:`Vector2<class_Vector2>` new_size **)**
.. rst-class:: classref-method
void **resize** **(** :ref:`Vector2<class_Vector2>` new_size **)**
Resizes the image to ``new_size``.
.. rst-class:: classref-item-separator
----
.. _class_BitMap_method_set_bit:
- void **set_bit** **(** :ref:`Vector2<class_Vector2>` position, :ref:`bool<class_bool>` bit **)**
.. rst-class:: classref-method
void **set_bit** **(** :ref:`Vector2<class_Vector2>` position, :ref:`bool<class_bool>` bit **)**
Sets the bitmap's element at the specified position, to the specified value.
.. rst-class:: classref-item-separator
----
.. _class_BitMap_method_set_bit_rect:
- void **set_bit_rect** **(** :ref:`Rect2<class_Rect2>` rect, :ref:`bool<class_bool>` bit **)**
.. rst-class:: classref-method
void **set_bit_rect** **(** :ref:`Rect2<class_Rect2>` rect, :ref:`bool<class_bool>` bit **)**
Sets a rectangular portion of the bitmap to the specified value.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -16,173 +16,232 @@ Renders text using fonts under the `BMFont <https://www.angelcode.com/products/b
Handles files with the ``.fnt`` extension.
.. rst-class:: classref-introduction-group
Description
-----------
Renders text using ``*.fnt`` fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see :ref:`DynamicFont<class_DynamicFont>`.
.. rst-class:: classref-reftable-group
Properties
----------
+-------------------------------------+-----------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`ascent<class_BitmapFont_property_ascent>` | ``0.0`` |
+-------------------------------------+-----------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`distance_field<class_BitmapFont_property_distance_field>` | ``false`` |
+-------------------------------------+-----------------------------------------------------------------+-----------+
| :ref:`BitmapFont<class_BitmapFont>` | :ref:`fallback<class_BitmapFont_property_fallback>` | |
+-------------------------------------+-----------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`height<class_BitmapFont_property_height>` | ``1.0`` |
+-------------------------------------+-----------------------------------------------------------------+-----------+
.. table::
:widths: auto
+-------------------------------------+-----------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`ascent<class_BitmapFont_property_ascent>` | ``0.0`` |
+-------------------------------------+-----------------------------------------------------------------+-----------+
| :ref:`bool<class_bool>` | :ref:`distance_field<class_BitmapFont_property_distance_field>` | ``false`` |
+-------------------------------------+-----------------------------------------------------------------+-----------+
| :ref:`BitmapFont<class_BitmapFont>` | :ref:`fallback<class_BitmapFont_property_fallback>` | |
+-------------------------------------+-----------------------------------------------------------------+-----------+
| :ref:`float<class_float>` | :ref:`height<class_BitmapFont_property_height>` | ``1.0`` |
+-------------------------------------+-----------------------------------------------------------------+-----------+
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_char<class_BitmapFont_method_add_char>` **(** :ref:`int<class_int>` character, :ref:`int<class_int>` texture, :ref:`Rect2<class_Rect2>` rect, :ref:`Vector2<class_Vector2>` align=Vector2( 0, 0 ), :ref:`float<class_float>` advance=-1 **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_kerning_pair<class_BitmapFont_method_add_kerning_pair>` **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b, :ref:`int<class_int>` kerning **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_texture<class_BitmapFont_method_add_texture>` **(** :ref:`Texture<class_Texture>` texture **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_BitmapFont_method_clear>` **(** **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`create_from_fnt<class_BitmapFont_method_create_from_fnt>` **(** :ref:`String<class_String>` path **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_kerning_pair<class_BitmapFont_method_get_kerning_pair>` **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b **)** |const| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Texture<class_Texture>` | :ref:`get_texture<class_BitmapFont_method_get_texture>` **(** :ref:`int<class_int>` idx **)** |const| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_texture_count<class_BitmapFont_method_get_texture_count>` **(** **)** |const| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_char<class_BitmapFont_method_add_char>` **(** :ref:`int<class_int>` character, :ref:`int<class_int>` texture, :ref:`Rect2<class_Rect2>` rect, :ref:`Vector2<class_Vector2>` align=Vector2( 0, 0 ), :ref:`float<class_float>` advance=-1 **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_kerning_pair<class_BitmapFont_method_add_kerning_pair>` **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b, :ref:`int<class_int>` kerning **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_texture<class_BitmapFont_method_add_texture>` **(** :ref:`Texture<class_Texture>` texture **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_BitmapFont_method_clear>` **(** **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`create_from_fnt<class_BitmapFont_method_create_from_fnt>` **(** :ref:`String<class_String>` path **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_kerning_pair<class_BitmapFont_method_get_kerning_pair>` **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b **)** |const| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Texture<class_Texture>` | :ref:`get_texture<class_BitmapFont_method_get_texture>` **(** :ref:`int<class_int>` idx **)** |const| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_texture_count<class_BitmapFont_method_get_texture_count>` **(** **)** |const| |
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_BitmapFont_property_ascent:
- :ref:`float<class_float>` **ascent**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``0.0`` |
+-----------+-------------------+
| *Setter* | set_ascent(value) |
+-----------+-------------------+
| *Getter* | get_ascent() |
+-----------+-------------------+
:ref:`float<class_float>` **ascent** = ``0.0``
.. rst-class:: classref-property-setget
- void **set_ascent** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_ascent** **(** **)**
Ascent (number of pixels above the baseline).
.. rst-class:: classref-item-separator
----
.. _class_BitmapFont_property_distance_field:
- :ref:`bool<class_bool>` **distance_field**
.. rst-class:: classref-property
+-----------+--------------------------------+
| *Default* | ``false`` |
+-----------+--------------------------------+
| *Setter* | set_distance_field_hint(value) |
+-----------+--------------------------------+
| *Getter* | is_distance_field_hint() |
+-----------+--------------------------------+
:ref:`bool<class_bool>` **distance_field** = ``false``
.. rst-class:: classref-property-setget
- void **set_distance_field_hint** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_distance_field_hint** **(** **)**
If ``true``, distance field hint is enabled.
.. rst-class:: classref-item-separator
----
.. _class_BitmapFont_property_fallback:
- :ref:`BitmapFont<class_BitmapFont>` **fallback**
.. rst-class:: classref-property
+----------+---------------------+
| *Setter* | set_fallback(value) |
+----------+---------------------+
| *Getter* | get_fallback() |
+----------+---------------------+
:ref:`BitmapFont<class_BitmapFont>` **fallback**
.. rst-class:: classref-property-setget
- void **set_fallback** **(** :ref:`BitmapFont<class_BitmapFont>` value **)**
- :ref:`BitmapFont<class_BitmapFont>` **get_fallback** **(** **)**
The fallback font.
.. rst-class:: classref-item-separator
----
.. _class_BitmapFont_property_height:
- :ref:`float<class_float>` **height**
.. rst-class:: classref-property
+-----------+-------------------+
| *Default* | ``1.0`` |
+-----------+-------------------+
| *Setter* | set_height(value) |
+-----------+-------------------+
| *Getter* | get_height() |
+-----------+-------------------+
:ref:`float<class_float>` **height** = ``1.0``
.. rst-class:: classref-property-setget
- void **set_height** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_height** **(** **)**
Total font height (ascent plus descent) in pixels.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_BitmapFont_method_add_char:
- void **add_char** **(** :ref:`int<class_int>` character, :ref:`int<class_int>` texture, :ref:`Rect2<class_Rect2>` rect, :ref:`Vector2<class_Vector2>` align=Vector2( 0, 0 ), :ref:`float<class_float>` advance=-1 **)**
.. rst-class:: classref-method
void **add_char** **(** :ref:`int<class_int>` character, :ref:`int<class_int>` texture, :ref:`Rect2<class_Rect2>` rect, :ref:`Vector2<class_Vector2>` align=Vector2( 0, 0 ), :ref:`float<class_float>` advance=-1 **)**
Adds a character to the font, where ``character`` is the Unicode value, ``texture`` is the texture index, ``rect`` is the region in the texture (in pixels!), ``align`` is the (optional) alignment for the character and ``advance`` is the (optional) advance.
.. rst-class:: classref-item-separator
----
.. _class_BitmapFont_method_add_kerning_pair:
- void **add_kerning_pair** **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b, :ref:`int<class_int>` kerning **)**
.. rst-class:: classref-method
Adds a kerning pair to the ``BitmapFont`` as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
void **add_kerning_pair** **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b, :ref:`int<class_int>` kerning **)**
Adds a kerning pair to the **BitmapFont** as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
.. rst-class:: classref-item-separator
----
.. _class_BitmapFont_method_add_texture:
- void **add_texture** **(** :ref:`Texture<class_Texture>` texture **)**
.. rst-class:: classref-method
Adds a texture to the ``BitmapFont``.
void **add_texture** **(** :ref:`Texture<class_Texture>` texture **)**
Adds a texture to the **BitmapFont**.
.. rst-class:: classref-item-separator
----
.. _class_BitmapFont_method_clear:
- void **clear** **(** **)**
.. rst-class:: classref-method
void **clear** **(** **)**
Clears all the font data and settings.
.. rst-class:: classref-item-separator
----
.. _class_BitmapFont_method_create_from_fnt:
- :ref:`Error<enum_@GlobalScope_Error>` **create_from_fnt** **(** :ref:`String<class_String>` path **)**
.. rst-class:: classref-method
:ref:`Error<enum_@GlobalScope_Error>` **create_from_fnt** **(** :ref:`String<class_String>` path **)**
Creates a BitmapFont from the ``*.fnt`` file at ``path``.
.. rst-class:: classref-item-separator
----
.. _class_BitmapFont_method_get_kerning_pair:
- :ref:`int<class_int>` **get_kerning_pair** **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_kerning_pair** **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b **)** |const|
Returns a kerning pair as a difference.
.. rst-class:: classref-item-separator
----
.. _class_BitmapFont_method_get_texture:
- :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`int<class_int>` idx **)** |const|
.. rst-class:: classref-method
:ref:`Texture<class_Texture>` **get_texture** **(** :ref:`int<class_int>` idx **)** |const|
Returns the font atlas texture at index ``idx``.
.. rst-class:: classref-item-separator
----
.. _class_BitmapFont_method_get_texture_count:
- :ref:`int<class_int>` **get_texture_count** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_texture_count** **(** **)** |const|
Returns the number of textures in the BitmapFont atlas.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,6 +14,8 @@ Bone2D
Joint used with :ref:`Skeleton2D<class_Skeleton2D>` to control and animate other nodes.
.. rst-class:: classref-introduction-group
Description
-----------
@@ -25,84 +27,117 @@ Each bone has a :ref:`rest<class_Bone2D_property_rest>` transform that you can r
If in the editor, you can set the rest pose of an entire skeleton using a menu option, from the code, you need to iterate over the bones to set their individual rest poses.
.. rst-class:: classref-reftable-group
Properties
----------
+---------------------------------------+-------------------------------------------------------------+-------------------------------------+
| :ref:`float<class_float>` | :ref:`default_length<class_Bone2D_property_default_length>` | ``16.0`` |
+---------------------------------------+-------------------------------------------------------------+-------------------------------------+
| :ref:`Transform2D<class_Transform2D>` | :ref:`rest<class_Bone2D_property_rest>` | ``Transform2D( 0, 0, 0, 0, 0, 0 )`` |
+---------------------------------------+-------------------------------------------------------------+-------------------------------------+
.. table::
:widths: auto
+---------------------------------------+-------------------------------------------------------------+-------------------------------------+
| :ref:`float<class_float>` | :ref:`default_length<class_Bone2D_property_default_length>` | ``16.0`` |
+---------------------------------------+-------------------------------------------------------------+-------------------------------------+
| :ref:`Transform2D<class_Transform2D>` | :ref:`rest<class_Bone2D_property_rest>` | ``Transform2D( 0, 0, 0, 0, 0, 0 )`` |
+---------------------------------------+-------------------------------------------------------------+-------------------------------------+
.. rst-class:: classref-reftable-group
Methods
-------
+---------------------------------------+---------------------------------------------------------------------------------------------+
| void | :ref:`apply_rest<class_Bone2D_method_apply_rest>` **(** **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_index_in_skeleton<class_Bone2D_method_get_index_in_skeleton>` **(** **)** |const| |
+---------------------------------------+---------------------------------------------------------------------------------------------+
| :ref:`Transform2D<class_Transform2D>` | :ref:`get_skeleton_rest<class_Bone2D_method_get_skeleton_rest>` **(** **)** |const| |
+---------------------------------------+---------------------------------------------------------------------------------------------+
.. table::
:widths: auto
+---------------------------------------+---------------------------------------------------------------------------------------------+
| void | :ref:`apply_rest<class_Bone2D_method_apply_rest>` **(** **)** |
+---------------------------------------+---------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_index_in_skeleton<class_Bone2D_method_get_index_in_skeleton>` **(** **)** |const| |
+---------------------------------------+---------------------------------------------------------------------------------------------+
| :ref:`Transform2D<class_Transform2D>` | :ref:`get_skeleton_rest<class_Bone2D_method_get_skeleton_rest>` **(** **)** |const| |
+---------------------------------------+---------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_Bone2D_property_default_length:
- :ref:`float<class_float>` **default_length**
.. rst-class:: classref-property
+-----------+---------------------------+
| *Default* | ``16.0`` |
+-----------+---------------------------+
| *Setter* | set_default_length(value) |
+-----------+---------------------------+
| *Getter* | get_default_length() |
+-----------+---------------------------+
:ref:`float<class_float>` **default_length** = ``16.0``
.. rst-class:: classref-property-setget
- void **set_default_length** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_default_length** **(** **)**
Length of the bone's representation drawn in the editor's viewport in pixels.
.. rst-class:: classref-item-separator
----
.. _class_Bone2D_property_rest:
- :ref:`Transform2D<class_Transform2D>` **rest**
.. rst-class:: classref-property
+-----------+-------------------------------------+
| *Default* | ``Transform2D( 0, 0, 0, 0, 0, 0 )`` |
+-----------+-------------------------------------+
| *Setter* | set_rest(value) |
+-----------+-------------------------------------+
| *Getter* | get_rest() |
+-----------+-------------------------------------+
:ref:`Transform2D<class_Transform2D>` **rest** = ``Transform2D( 0, 0, 0, 0, 0, 0 )``
.. rst-class:: classref-property-setget
- void **set_rest** **(** :ref:`Transform2D<class_Transform2D>` value **)**
- :ref:`Transform2D<class_Transform2D>` **get_rest** **(** **)**
Rest transform of the bone. You can reset the node's transforms to this value using :ref:`apply_rest<class_Bone2D_method_apply_rest>`.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_Bone2D_method_apply_rest:
- void **apply_rest** **(** **)**
.. rst-class:: classref-method
void **apply_rest** **(** **)**
Stores the node's current transforms in :ref:`rest<class_Bone2D_property_rest>`.
.. rst-class:: classref-item-separator
----
.. _class_Bone2D_method_get_index_in_skeleton:
- :ref:`int<class_int>` **get_index_in_skeleton** **(** **)** |const|
.. rst-class:: classref-method
:ref:`int<class_int>` **get_index_in_skeleton** **(** **)** |const|
Returns the node's index as part of the entire skeleton. See :ref:`Skeleton2D<class_Skeleton2D>`.
.. rst-class:: classref-item-separator
----
.. _class_Bone2D_method_get_skeleton_rest:
- :ref:`Transform2D<class_Transform2D>` **get_skeleton_rest** **(** **)** |const|
.. rst-class:: classref-method
:ref:`Transform2D<class_Transform2D>` **get_skeleton_rest** **(** **)** |const|
Returns the node's :ref:`rest<class_Bone2D_property_rest>` ``Transform2D`` if it doesn't have a parent, or its rest pose relative to its parent.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

View File

@@ -14,35 +14,48 @@ BoneAttachment
A node that will attach to a bone.
.. rst-class:: classref-introduction-group
Description
-----------
This node must be the child of a :ref:`Skeleton<class_Skeleton>` node. You can then select a bone for this node to attach to. The BoneAttachment node will copy the transform of the selected bone.
.. rst-class:: classref-reftable-group
Properties
----------
+-----------------------------+-----------------------------------------------------------+--------+
| :ref:`String<class_String>` | :ref:`bone_name<class_BoneAttachment_property_bone_name>` | ``""`` |
+-----------------------------+-----------------------------------------------------------+--------+
.. table::
:widths: auto
+-----------------------------+-----------------------------------------------------------+--------+
| :ref:`String<class_String>` | :ref:`bone_name<class_BoneAttachment_property_bone_name>` | ``""`` |
+-----------------------------+-----------------------------------------------------------+--------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_BoneAttachment_property_bone_name:
- :ref:`String<class_String>` **bone_name**
.. rst-class:: classref-property
+-----------+----------------------+
| *Default* | ``""`` |
+-----------+----------------------+
| *Setter* | set_bone_name(value) |
+-----------+----------------------+
| *Getter* | get_bone_name() |
+-----------+----------------------+
:ref:`String<class_String>` **bone_name** = ``""``
.. rst-class:: classref-property-setget
- void **set_bone_name** **(** :ref:`String<class_String>` value **)**
- :ref:`String<class_String>` **get_bone_name** **(** **)**
The name of the attached bone.
.. |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.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`

Some files were not shown because too many files have changed in this diff Show More