mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
classref: Sync with current master branch (f87858a8f)
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
|
||||
Built-in GDScript functions.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -19,75 +21,110 @@ A list of GDScript-specific utility functions accessed in any script.
|
||||
|
||||
For the list of the global functions and constants see :ref:`@GlobalScope<class_@GlobalScope>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`GDScript exports <../tutorials/scripting/gdscript/gdscript_exports>`
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Color<class_Color>` | :ref:`Color8<class_@GDScript_method_Color8>` **(** :ref:`int<class_int>` r8, :ref:`int<class_int>` g8, :ref:`int<class_int>` b8, :ref:`int<class_int>` a8=255 **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`assert<class_@GDScript_method_assert>` **(** :ref:`bool<class_bool>` condition, :ref:`String<class_String>` message="" **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`char<class_@GDScript_method_char>` **(** :ref:`int<class_int>` char **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`convert<class_@GDScript_method_convert>` **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` type **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Object<class_Object>` | :ref:`dict_to_inst<class_@GDScript_method_dict_to_inst>` **(** :ref:`Dictionary<class_Dictionary>` dictionary **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`get_stack<class_@GDScript_method_get_stack>` **(** **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Dictionary<class_Dictionary>` | :ref:`inst_to_dict<class_@GDScript_method_inst_to_dict>` **(** :ref:`Object<class_Object>` instance **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`len<class_@GDScript_method_len>` **(** :ref:`Variant<class_Variant>` var **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Resource<class_Resource>` | :ref:`load<class_@GDScript_method_load>` **(** :ref:`String<class_String>` path **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Resource<class_Resource>` | :ref:`preload<class_@GDScript_method_preload>` **(** :ref:`String<class_String>` path **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`print_debug<class_@GDScript_method_print_debug>` **(** ... **)** |vararg| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`print_stack<class_@GDScript_method_print_stack>` **(** **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`range<class_@GDScript_method_range>` **(** ... **)** |vararg| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`str<class_@GDScript_method_str>` **(** ... **)** |vararg| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`type_exists<class_@GDScript_method_type_exists>` **(** :ref:`StringName<class_StringName>` type **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Color<class_Color>` | :ref:`Color8<class_@GDScript_method_Color8>` **(** :ref:`int<class_int>` r8, :ref:`int<class_int>` g8, :ref:`int<class_int>` b8, :ref:`int<class_int>` a8=255 **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`assert<class_@GDScript_method_assert>` **(** :ref:`bool<class_bool>` condition, :ref:`String<class_String>` message="" **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`char<class_@GDScript_method_char>` **(** :ref:`int<class_int>` char **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`convert<class_@GDScript_method_convert>` **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` type **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Object<class_Object>` | :ref:`dict_to_inst<class_@GDScript_method_dict_to_inst>` **(** :ref:`Dictionary<class_Dictionary>` dictionary **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`get_stack<class_@GDScript_method_get_stack>` **(** **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Dictionary<class_Dictionary>` | :ref:`inst_to_dict<class_@GDScript_method_inst_to_dict>` **(** :ref:`Object<class_Object>` instance **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`len<class_@GDScript_method_len>` **(** :ref:`Variant<class_Variant>` var **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Resource<class_Resource>` | :ref:`load<class_@GDScript_method_load>` **(** :ref:`String<class_String>` path **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Resource<class_Resource>` | :ref:`preload<class_@GDScript_method_preload>` **(** :ref:`String<class_String>` path **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`print_debug<class_@GDScript_method_print_debug>` **(** ... **)** |vararg| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`print_stack<class_@GDScript_method_print_stack>` **(** **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`range<class_@GDScript_method_range>` **(** ... **)** |vararg| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`str<class_@GDScript_method_str>` **(** ... **)** |vararg| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`type_exists<class_@GDScript_method_type_exists>` **(** :ref:`StringName<class_StringName>` type **)** |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Constants
|
||||
---------
|
||||
|
||||
.. _class_@GDScript_constant_PI:
|
||||
|
||||
.. rst-class:: classref-constant
|
||||
|
||||
**PI** = ``3.14159265358979``
|
||||
|
||||
Constant that represents how many times the diameter of a circle fits around its perimeter. This is equivalent to ``TAU / 2``, or 180 degrees in rotations.
|
||||
|
||||
.. _class_@GDScript_constant_TAU:
|
||||
|
||||
.. rst-class:: classref-constant
|
||||
|
||||
**TAU** = ``6.28318530717959``
|
||||
|
||||
The circle constant, the circumference of the unit circle in radians. This is equivalent to ``PI * 2``, or 360 degrees in rotations.
|
||||
|
||||
.. _class_@GDScript_constant_INF:
|
||||
|
||||
.. _class_@GDScript_constant_NAN:
|
||||
.. rst-class:: classref-constant
|
||||
|
||||
- **PI** = **3.14159265358979** --- Constant that represents how many times the diameter of a circle fits around its perimeter. This is equivalent to ``TAU / 2``, or 180 degrees in rotations.
|
||||
**INF** = ``inf``
|
||||
|
||||
- **TAU** = **6.28318530717959** --- The circle constant, the circumference of the unit circle in radians. This is equivalent to ``PI * 2``, or 360 degrees in rotations.
|
||||
|
||||
- **INF** = **inf** --- Positive floating-point infinity. This is the result of floating-point division when the divisor is ``0.0``. For negative infinity, use ``-INF``. Dividing by ``-0.0`` will result in negative infinity if the numerator is positive, so dividing by ``0.0`` is not the same as dividing by ``-0.0`` (despite ``0.0 == -0.0`` returning ``true``).
|
||||
Positive floating-point infinity. This is the result of floating-point division when the divisor is ``0.0``. For negative infinity, use ``-INF``. Dividing by ``-0.0`` will result in negative infinity if the numerator is positive, so dividing by ``0.0`` is not the same as dividing by ``-0.0`` (despite ``0.0 == -0.0`` returning ``true``).
|
||||
|
||||
\ **Warning:** Numeric infinity is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer number by ``0`` will not result in :ref:`INF<class_@GDScript_constant_INF>` and will result in a run-time error instead.
|
||||
|
||||
- **NAN** = **nan** --- "Not a Number", an invalid floating-point value. :ref:`NAN<class_@GDScript_constant_NAN>` has special properties, including that it is not equal to itself (``NAN == NAN`` returns ``false``). It is output by some invalid operations, such as dividing floating-point ``0.0`` by ``0.0``.
|
||||
.. _class_@GDScript_constant_NAN:
|
||||
|
||||
.. rst-class:: classref-constant
|
||||
|
||||
**NAN** = ``nan``
|
||||
|
||||
"Not a Number", an invalid floating-point value. :ref:`NAN<class_@GDScript_constant_NAN>` has special properties, including that it is not equal to itself (``NAN == NAN`` returns ``false``). It is output by some invalid operations, such as dividing floating-point ``0.0`` by ``0.0``.
|
||||
|
||||
\ **Warning:** "Not a Number" is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer ``0`` by ``0`` will not result in :ref:`NAN<class_@GDScript_constant_NAN>` and will result in a run-time error instead.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
Annotations
|
||||
-----------
|
||||
|
||||
.. _class_@GDScript_annotation_@export:
|
||||
|
||||
- **@export** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export** **(** **)**
|
||||
|
||||
Mark the following property as exported (editable in the Inspector dock and saved to disk). To control the type of the exported property use the type hint notation.
|
||||
|
||||
@@ -96,11 +133,15 @@ Mark the following property as exported (editable in the Inspector dock and save
|
||||
@export var int_number = 5
|
||||
@export var float_number: float = 5
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_category:
|
||||
|
||||
- **@export_category** **(** :ref:`String<class_String>` name **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_category** **(** :ref:`String<class_String>` name **)**
|
||||
|
||||
Define a new category for the following exported properties. This helps to organize properties in the Inspector dock.
|
||||
|
||||
@@ -114,11 +155,15 @@ See also :ref:`@GlobalScope.PROPERTY_USAGE_CATEGORY<class_@GlobalScope_constant_
|
||||
|
||||
\ **Note:** Categories in the property list are supposed to indicate different base types, so the use of this annotation is not encouraged. See :ref:`@export_group<class_@GDScript_annotation_@export_group>` and :ref:`@export_subgroup<class_@GDScript_annotation_@export_subgroup>` instead.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_color_no_alpha:
|
||||
|
||||
- **@export_color_no_alpha** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_color_no_alpha** **(** **)**
|
||||
|
||||
Export a :ref:`Color<class_Color>` property without transparency (its alpha fixed as ``1.0``).
|
||||
|
||||
@@ -128,11 +173,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_COLOR_NO_ALPHA<class_@GlobalScope_cons
|
||||
|
||||
@export_color_no_alpha var modulate_color: Color
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_dir:
|
||||
|
||||
- **@export_dir** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_dir** **(** **)**
|
||||
|
||||
Export a :ref:`String<class_String>` property as a path to a directory. The path will be limited to the project folder and its subfolders. See :ref:`@export_global_dir<class_@GDScript_annotation_@export_global_dir>` to allow picking from the entire filesystem.
|
||||
|
||||
@@ -142,11 +191,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_DIR<class_@GlobalScope_constant_PROPER
|
||||
|
||||
@export_dir var sprite_folder: String
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_enum:
|
||||
|
||||
- **@export_enum** **(** :ref:`String<class_String>` names, ... **)** |vararg|
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_enum** **(** :ref:`String<class_String>` names, ... **)** |vararg|
|
||||
|
||||
Export a :ref:`String<class_String>` or integer property as an enumerated list of options. If the property is an integer field, then the index of the value is stored, in the same order the values are provided. You can add specific identifiers for allowed values using a colon.
|
||||
|
||||
@@ -158,11 +211,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_ENUM<class_@GlobalScope_constant_PROPE
|
||||
@export_enum("Warrior", "Magician", "Thief") var character_class: int
|
||||
@export_enum("Slow:30", "Average:60", "Very Fast:200") var character_speed: int
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_exp_easing:
|
||||
|
||||
- **@export_exp_easing** **(** :ref:`String<class_String>` hints="", ... **)** |vararg|
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_exp_easing** **(** :ref:`String<class_String>` hints="", ... **)** |vararg|
|
||||
|
||||
Export a floating-point property with an easing editor widget. Additional hints can be provided to adjust the behavior of the widget. ``"attenuation"`` flips the curve, which makes it more intuitive for editing attenuation properties. ``"positive_only"`` limits values to only be greater than or equal to zero.
|
||||
|
||||
@@ -174,11 +231,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_EXP_EASING<class_@GlobalScope_constant
|
||||
@export_exp_easing("attenuation") var fading_attenuation
|
||||
@export_exp_easing("positive_only") var effect_power
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_file:
|
||||
|
||||
- **@export_file** **(** :ref:`String<class_String>` filter="", ... **)** |vararg|
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_file** **(** :ref:`String<class_String>` filter="", ... **)** |vararg|
|
||||
|
||||
Export a :ref:`String<class_String>` property as a path to a file. The path will be limited to the project folder and its subfolders. See :ref:`@export_global_file<class_@GDScript_annotation_@export_global_file>` to allow picking from the entire filesystem.
|
||||
|
||||
@@ -191,11 +252,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_FILE<class_@GlobalScope_constant_PROPE
|
||||
@export_file var sound_effect_file: String
|
||||
@export_file("*.txt") var notes_file: String
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_flags:
|
||||
|
||||
- **@export_flags** **(** :ref:`String<class_String>` names, ... **)** |vararg|
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags** **(** :ref:`String<class_String>` names, ... **)** |vararg|
|
||||
|
||||
Export an integer property as a bit flag field. This allows to store several "checked" or ``true`` values with one property, and comfortably select them from the Inspector dock.
|
||||
|
||||
@@ -205,11 +270,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_FLAGS<class_@GlobalScope_constant_PROP
|
||||
|
||||
@export_flags("Fire", "Water", "Earth", "Wind") var spell_elements = 0
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_flags_2d_navigation:
|
||||
|
||||
- **@export_flags_2d_navigation** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_2d_navigation** **(** **)**
|
||||
|
||||
Export an integer property as a bit flag field for 2D navigation layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/2d_navigation/layer_1<class_ProjectSettings_property_layer_names/2d_navigation/layer_1>`.
|
||||
|
||||
@@ -219,11 +288,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_2D_NAVIGATION<class_@GlobalScop
|
||||
|
||||
@export_flags_2d_navigation var navigation_layers: int
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_flags_2d_physics:
|
||||
|
||||
- **@export_flags_2d_physics** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_2d_physics** **(** **)**
|
||||
|
||||
Export an integer property as a bit flag field for 2D physics layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/2d_physics/layer_1<class_ProjectSettings_property_layer_names/2d_physics/layer_1>`.
|
||||
|
||||
@@ -233,11 +306,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_2D_PHYSICS<class_@GlobalScope_c
|
||||
|
||||
@export_flags_2d_physics var physics_layers: int
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_flags_2d_render:
|
||||
|
||||
- **@export_flags_2d_render** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_2d_render** **(** **)**
|
||||
|
||||
Export an integer property as a bit flag field for 2D render layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/2d_render/layer_1<class_ProjectSettings_property_layer_names/2d_render/layer_1>`.
|
||||
|
||||
@@ -247,11 +324,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_2D_RENDER<class_@GlobalScope_co
|
||||
|
||||
@export_flags_2d_render var render_layers: int
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_flags_3d_navigation:
|
||||
|
||||
- **@export_flags_3d_navigation** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_3d_navigation** **(** **)**
|
||||
|
||||
Export an integer property as a bit flag field for 3D navigation layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/3d_navigation/layer_1<class_ProjectSettings_property_layer_names/3d_navigation/layer_1>`.
|
||||
|
||||
@@ -261,11 +342,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_3D_NAVIGATION<class_@GlobalScop
|
||||
|
||||
@export_flags_3d_navigation var navigation_layers: int
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_flags_3d_physics:
|
||||
|
||||
- **@export_flags_3d_physics** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_3d_physics** **(** **)**
|
||||
|
||||
Export an integer property as a bit flag field for 3D physics layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/3d_physics/layer_1<class_ProjectSettings_property_layer_names/3d_physics/layer_1>`.
|
||||
|
||||
@@ -275,11 +360,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_3D_PHYSICS<class_@GlobalScope_c
|
||||
|
||||
@export_flags_3d_physics var physics_layers: int
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_flags_3d_render:
|
||||
|
||||
- **@export_flags_3d_render** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_flags_3d_render** **(** **)**
|
||||
|
||||
Export an integer property as a bit flag field for 3D render layers. The widget in the Inspector dock will use the layer names defined in :ref:`ProjectSettings.layer_names/3d_render/layer_1<class_ProjectSettings_property_layer_names/3d_render/layer_1>`.
|
||||
|
||||
@@ -289,11 +378,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_LAYERS_3D_RENDER<class_@GlobalScope_co
|
||||
|
||||
@export_flags_3d_render var render_layers: int
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_global_dir:
|
||||
|
||||
- **@export_global_dir** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_global_dir** **(** **)**
|
||||
|
||||
Export a :ref:`String<class_String>` property as a path to a directory. The path can be picked from the entire filesystem. See :ref:`@export_dir<class_@GDScript_annotation_@export_dir>` to limit it to the project folder and its subfolders.
|
||||
|
||||
@@ -303,11 +396,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_GLOBAL_DIR<class_@GlobalScope_constant
|
||||
|
||||
@export_global_dir var sprite_folder: String
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_global_file:
|
||||
|
||||
- **@export_global_file** **(** :ref:`String<class_String>` filter="", ... **)** |vararg|
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_global_file** **(** :ref:`String<class_String>` filter="", ... **)** |vararg|
|
||||
|
||||
Export a :ref:`String<class_String>` property as a path to a file. The path can be picked from the entire filesystem. See :ref:`@export_file<class_@GDScript_annotation_@export_file>` to limit it to the project folder and its subfolders.
|
||||
|
||||
@@ -320,11 +417,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_GLOBAL_FILE<class_@GlobalScope_constan
|
||||
@export_global_file var sound_effect_file: String
|
||||
@export_global_file("*.txt") var notes_file: String
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_group:
|
||||
|
||||
- **@export_group** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` prefix="" **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_group** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` prefix="" **)**
|
||||
|
||||
Define a new group for the following exported properties. This helps to organize properties in the Inspector dock. Groups can be added with an optional ``prefix``, which would make group to only consider properties that have this prefix. The grouping will break on the first property that doesn't have a prefix. The prefix is also removed from the property's name in the Inspector dock.
|
||||
|
||||
@@ -347,11 +448,15 @@ See also :ref:`@GlobalScope.PROPERTY_USAGE_GROUP<class_@GlobalScope_constant_PRO
|
||||
@export_group("", "")
|
||||
@export var ungrouped_number = 3
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_multiline:
|
||||
|
||||
- **@export_multiline** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_multiline** **(** **)**
|
||||
|
||||
Export a :ref:`String<class_String>` property with a large :ref:`TextEdit<class_TextEdit>` widget instead of a :ref:`LineEdit<class_LineEdit>`. This adds support for multiline content and makes it easier to edit large amount of text stored in the property.
|
||||
|
||||
@@ -361,11 +466,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_MULTILINE_TEXT<class_@GlobalScope_cons
|
||||
|
||||
@export_multiline var character_biography
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_node_path:
|
||||
|
||||
- **@export_node_path** **(** :ref:`String<class_String>` type="", ... **)** |vararg|
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_node_path** **(** :ref:`String<class_String>` type="", ... **)** |vararg|
|
||||
|
||||
Export a :ref:`NodePath<class_NodePath>` property with a filter for allowed node types.
|
||||
|
||||
@@ -375,11 +484,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_NODE_PATH_VALID_TYPES<class_@GlobalSco
|
||||
|
||||
@export_node_path(Button, TouchScreenButton) var some_button
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_placeholder:
|
||||
|
||||
- **@export_placeholder** **(** :ref:`String<class_String>` placeholder **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_placeholder** **(** :ref:`String<class_String>` placeholder **)**
|
||||
|
||||
Export a :ref:`String<class_String>` property with a placeholder text displayed in the editor widget when no value is present.
|
||||
|
||||
@@ -389,11 +502,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_PLACEHOLDER_TEXT<class_@GlobalScope_co
|
||||
|
||||
@export_placeholder("Name in lowercase") var character_id: String
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_range:
|
||||
|
||||
- **@export_range** **(** :ref:`float<class_float>` min, :ref:`float<class_float>` max, :ref:`float<class_float>` step=1.0, :ref:`String<class_String>` extra_hints="", ... **)** |vararg|
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_range** **(** :ref:`float<class_float>` min, :ref:`float<class_float>` max, :ref:`float<class_float>` step=1.0, :ref:`String<class_String>` extra_hints="", ... **)** |vararg|
|
||||
|
||||
Export a numeric property as a range value. The range must be defined by ``min`` and ``max``, as well as an optional ``step`` and a variety of extra hints. The ``step`` defaults to ``1`` for integer properties. For floating-point numbers this value depends on your ``EditorSettings.interface/inspector/default_float_step`` setting.
|
||||
|
||||
@@ -416,11 +533,15 @@ See also :ref:`@GlobalScope.PROPERTY_HINT_RANGE<class_@GlobalScope_constant_PROP
|
||||
@export_range(0, 360, 1, "degrees") var angle_degrees
|
||||
@export_range(-8, 8, 2, "suffix:px") var target_offset
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@export_subgroup:
|
||||
|
||||
- **@export_subgroup** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` prefix="" **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@export_subgroup** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` prefix="" **)**
|
||||
|
||||
Define a new subgroup for the following exported properties. This helps to organize properties in the Inspector dock. Subgroups work exactly like groups, except they need a parent group to exist. See :ref:`@export_group<class_@GDScript_annotation_@export_group>`.
|
||||
|
||||
@@ -438,13 +559,17 @@ See also :ref:`@GlobalScope.PROPERTY_USAGE_SUBGROUP<class_@GlobalScope_constant_
|
||||
|
||||
\ **Note:** Subgroups cannot be nested, they only provide one extra level of depth. Just like the next group ends the previous group, so do the subsequent subgroups.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@icon:
|
||||
|
||||
- **@icon** **(** :ref:`String<class_String>` icon_path **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
Add a custom icon to the current script. After loading an icon at ``icon_path``, the icon is displayed in the Scene dock for every node that the script is attached to. For named classes, the icon is also displayed in various editor dialogs.
|
||||
**@icon** **(** :ref:`String<class_String>` icon_path **)**
|
||||
|
||||
Add a custom icon to the current script. The script must be registered as a global class using the ``class_name`` keyword for this to have a visible effect. The icon specified at ``icon_path`` is displayed in the Scene dock for every node of that class, as well as in various editor dialogs.
|
||||
|
||||
::
|
||||
|
||||
@@ -452,11 +577,15 @@ Add a custom icon to the current script. After loading an icon at ``icon_path``,
|
||||
|
||||
\ **Note:** Only the script can have a custom icon. Inner classes are not supported.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@onready:
|
||||
|
||||
- **@onready** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@onready** **(** **)**
|
||||
|
||||
Mark the following property as assigned on :ref:`Node<class_Node>`'s ready state change. Values for these properties are not assigned immediately upon the node's creation, and instead are computed and stored right before :ref:`Node._ready<class_Node_method__ready>`.
|
||||
|
||||
@@ -464,11 +593,15 @@ Mark the following property as assigned on :ref:`Node<class_Node>`'s ready state
|
||||
|
||||
@onready var character_name: Label = $Label
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@rpc:
|
||||
|
||||
- **@rpc** **(** :ref:`String<class_String>` mode="", :ref:`String<class_String>` sync="", :ref:`String<class_String>` transfer_mode="", :ref:`int<class_int>` transfer_channel=0, ... **)** |vararg|
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@rpc** **(** :ref:`String<class_String>` mode="", :ref:`String<class_String>` sync="", :ref:`String<class_String>` transfer_mode="", :ref:`int<class_int>` transfer_channel=0, ... **)** |vararg|
|
||||
|
||||
Mark the following method for remote procedure calls. See :doc:`High-level multiplayer <../tutorials/networking/high_level_multiplayer>`.
|
||||
|
||||
@@ -476,11 +609,15 @@ Mark the following method for remote procedure calls. See :doc:`High-level multi
|
||||
|
||||
@rpc()
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@tool:
|
||||
|
||||
- **@tool** **(** **)**
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@tool** **(** **)**
|
||||
|
||||
Mark the current script as a tool script, allowing it to be loaded and executed by the editor. See :doc:`Running code in the editor <../tutorials/plugins/running_code_in_the_editor>`.
|
||||
|
||||
@@ -489,11 +626,15 @@ Mark the current script as a tool script, allowing it to be loaded and executed
|
||||
@tool
|
||||
extends Node
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_annotation_@warning_ignore:
|
||||
|
||||
- **@warning_ignore** **(** :ref:`String<class_String>` warning, ... **)** |vararg|
|
||||
.. rst-class:: classref-annotation
|
||||
|
||||
**@warning_ignore** **(** :ref:`String<class_String>` warning, ... **)** |vararg|
|
||||
|
||||
Mark the following statement to ignore the specified ``warning``. See :doc:`GDScript warning system <../tutorials/scripting/gdscript/warning_system>`.
|
||||
|
||||
@@ -505,12 +646,20 @@ Mark the following statement to ignore the specified ``warning``. See :doc:`GDSc
|
||||
@warning_ignore("unreachable_code")
|
||||
print("unreachable")
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_@GDScript_method_Color8:
|
||||
|
||||
- :ref:`Color<class_Color>` **Color8** **(** :ref:`int<class_int>` r8, :ref:`int<class_int>` g8, :ref:`int<class_int>` b8, :ref:`int<class_int>` a8=255 **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Color<class_Color>` **Color8** **(** :ref:`int<class_int>` r8, :ref:`int<class_int>` g8, :ref:`int<class_int>` b8, :ref:`int<class_int>` a8=255 **)**
|
||||
|
||||
Returns a :ref:`Color<class_Color>` constructed from red (``r8``), green (``g8``), blue (``b8``), and optionally alpha (``a8``) integer channels, each divided by ``255.0`` for their final value.
|
||||
|
||||
@@ -520,11 +669,15 @@ Returns a :ref:`Color<class_Color>` constructed from red (``r8``), green (``g8``
|
||||
var dark_blue = Color8(0, 0, 51) # Same as Color(0, 0, 0.2).
|
||||
var my_color = Color8(306, 255, 0, 102) # Same as Color(1.2, 1, 0, 0.4).
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_assert:
|
||||
|
||||
- void **assert** **(** :ref:`bool<class_bool>` condition, :ref:`String<class_String>` message="" **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **assert** **(** :ref:`bool<class_bool>` condition, :ref:`String<class_String>` message="" **)**
|
||||
|
||||
Asserts that the ``condition`` is ``true``. If the ``condition`` is ``false``, an error is generated. When running from the editor, the running project will also be paused until you resume it. This can be used as a stronger form of :ref:`@GlobalScope.push_error<class_@GlobalScope_method_push_error>` for reporting errors to project developers or add-on users.
|
||||
|
||||
@@ -541,11 +694,15 @@ An optional ``message`` can be shown in addition to the generic "Assertion faile
|
||||
assert(speed >= 0 and speed < 20) # You can also combine the two conditional statements in one check
|
||||
assert(speed < 20, "the speed limit is 20") # Show a message
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_char:
|
||||
|
||||
- :ref:`String<class_String>` **char** **(** :ref:`int<class_int>` char **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`String<class_String>` **char** **(** :ref:`int<class_int>` char **)**
|
||||
|
||||
Returns a single character (as a :ref:`String<class_String>`) of the given Unicode code point (which is compatible with ASCII code).
|
||||
|
||||
@@ -555,11 +712,15 @@ Returns a single character (as a :ref:`String<class_String>`) of the given Unico
|
||||
a = char(65 + 32) # a is "a"
|
||||
a = char(8364) # a is "€"
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_convert:
|
||||
|
||||
- :ref:`Variant<class_Variant>` **convert** **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` type **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Variant<class_Variant>` **convert** **(** :ref:`Variant<class_Variant>` what, :ref:`int<class_int>` type **)**
|
||||
|
||||
Converts ``what`` to ``type`` in the best way possible. The ``type`` uses the :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` values.
|
||||
|
||||
@@ -572,19 +733,27 @@ Converts ``what`` to ``type`` in the best way possible. The ``type`` uses the :r
|
||||
print(b) # Prints [4, 2, 1]
|
||||
print(b is Array) # Prints false
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_dict_to_inst:
|
||||
|
||||
- :ref:`Object<class_Object>` **dict_to_inst** **(** :ref:`Dictionary<class_Dictionary>` dictionary **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Object<class_Object>` **dict_to_inst** **(** :ref:`Dictionary<class_Dictionary>` dictionary **)**
|
||||
|
||||
Converts a ``dictionary`` (created with :ref:`inst_to_dict<class_@GDScript_method_inst_to_dict>`) back to an Object instance. Can be useful for deserializing.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_get_stack:
|
||||
|
||||
- :ref:`Array<class_Array>` **get_stack** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Array<class_Array>` **get_stack** **(** **)**
|
||||
|
||||
Returns an array of dictionaries representing the current call stack. See also :ref:`print_stack<class_@GDScript_method_print_stack>`.
|
||||
|
||||
@@ -609,11 +778,15 @@ Starting from ``_ready()``, ``bar()`` would print:
|
||||
|
||||
\ **Note:** Calling this function from a :ref:`Thread<class_Thread>` is not supported. Doing so will return an empty array.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_inst_to_dict:
|
||||
|
||||
- :ref:`Dictionary<class_Dictionary>` **inst_to_dict** **(** :ref:`Object<class_Object>` instance **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Dictionary<class_Dictionary>` **inst_to_dict** **(** :ref:`Object<class_Object>` instance **)**
|
||||
|
||||
Returns the passed ``instance`` converted to a Dictionary. Can be useful for serializing.
|
||||
|
||||
@@ -632,11 +805,15 @@ Prints out:
|
||||
[@subpath, @path, foo]
|
||||
[, res://test.gd, bar]
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_len:
|
||||
|
||||
- :ref:`int<class_int>` **len** **(** :ref:`Variant<class_Variant>` var **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **len** **(** :ref:`Variant<class_Variant>` var **)**
|
||||
|
||||
Returns the length of the given Variant ``var``. The length can be the character count of a :ref:`String<class_String>`, the element count of any array type or the size of a :ref:`Dictionary<class_Dictionary>`. For every other Variant type, a run-time error is generated and execution is stopped.
|
||||
|
||||
@@ -648,11 +825,15 @@ Returns the length of the given Variant ``var``. The length can be the character
|
||||
b = "Hello!"
|
||||
len(b) # Returns 6
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_load:
|
||||
|
||||
- :ref:`Resource<class_Resource>` **load** **(** :ref:`String<class_String>` path **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Resource<class_Resource>` **load** **(** :ref:`String<class_String>` path **)**
|
||||
|
||||
Returns a :ref:`Resource<class_Resource>` from the filesystem located at the absolute ``path``. Unless it's already referenced elsewhere (such as in another script or in the scene), the resource is loaded from disk on function call, which might cause a slight delay, especially when loading large scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use :ref:`preload<class_@GDScript_method_preload>`.
|
||||
|
||||
@@ -669,11 +850,15 @@ This function is a simplified version of :ref:`ResourceLoader.load<class_Resourc
|
||||
|
||||
\ **Note:** Files have to be imported into the engine first to load them using this function. If you want to load :ref:`Image<class_Image>`\ s at run-time, you may use :ref:`Image.load<class_Image_method_load>`. If you want to import audio files, you can use the snippet described in :ref:`AudioStreamMP3.data<class_AudioStreamMP3_property_data>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_preload:
|
||||
|
||||
- :ref:`Resource<class_Resource>` **preload** **(** :ref:`String<class_String>` path **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Resource<class_Resource>` **preload** **(** :ref:`String<class_String>` path **)**
|
||||
|
||||
Returns a :ref:`Resource<class_Resource>` from the filesystem located at ``path``. During run-time, the resource is loaded when the script is being parsed. This function effectively acts as a reference to that resource. Note that this function requires ``path`` to be a constant :ref:`String<class_String>`. If you want to load a resource from a dynamic/variable path, use :ref:`load<class_@GDScript_method_load>`.
|
||||
|
||||
@@ -684,11 +869,15 @@ Returns a :ref:`Resource<class_Resource>` from the filesystem located at ``path`
|
||||
# Create instance of a scene.
|
||||
var diamond = preload("res://diamond.tscn").instantiate()
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_print_debug:
|
||||
|
||||
- void **print_debug** **(** ... **)** |vararg|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **print_debug** **(** ... **)** |vararg|
|
||||
|
||||
Like :ref:`@GlobalScope.print<class_@GlobalScope_method_print>`, but includes the current stack frame when running with the debugger turned on.
|
||||
|
||||
@@ -701,11 +890,15 @@ The output in the console may look like the following:
|
||||
|
||||
\ **Note:** Calling this function from a :ref:`Thread<class_Thread>` is not supported. Doing so will instead print the thread ID.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_print_stack:
|
||||
|
||||
- void **print_stack** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **print_stack** **(** **)**
|
||||
|
||||
Prints a stack trace at the current code location. See also :ref:`get_stack<class_@GDScript_method_get_stack>`.
|
||||
|
||||
@@ -719,11 +912,15 @@ The output in the console may look like the following:
|
||||
|
||||
\ **Note:** Calling this function from a :ref:`Thread<class_Thread>` is not supported. Doing so will instead print the thread ID.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_range:
|
||||
|
||||
- :ref:`Array<class_Array>` **range** **(** ... **)** |vararg|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Array<class_Array>` **range** **(** ... **)** |vararg|
|
||||
|
||||
Returns an array with the given range. :ref:`range<class_@GDScript_method_range>` can be called in three ways:
|
||||
|
||||
@@ -777,11 +974,15 @@ Output:
|
||||
0.2
|
||||
0.1
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_str:
|
||||
|
||||
- :ref:`String<class_String>` **str** **(** ... **)** |vararg|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`String<class_String>` **str** **(** ... **)** |vararg|
|
||||
|
||||
Converts one or more arguments to a :ref:`String<class_String>` in the best way possible.
|
||||
|
||||
@@ -792,11 +993,15 @@ Converts one or more arguments to a :ref:`String<class_String>` in the best way
|
||||
len(a) # Returns 3
|
||||
len(b) # Returns 12
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_@GDScript_method_type_exists:
|
||||
|
||||
- :ref:`bool<class_bool>` **type_exists** **(** :ref:`StringName<class_StringName>` type **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **type_exists** **(** :ref:`StringName<class_StringName>` type **)**
|
||||
|
||||
Returns ``true`` if the given :ref:`Object<class_Object>`-derived class exists in :ref:`ClassDB<class_ClassDB>`. Note that :ref:`Variant<class_Variant>` data types are not registered in :ref:`ClassDB<class_ClassDB>`.
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,16 +12,20 @@ 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>`.
|
||||
|
||||
Negative values for :ref:`size<class_AABB_property_size>` are not supported and will not work for most methods. Use :ref:`abs<class_AABB_method_abs>` to get an AABB with a positive size.
|
||||
|
||||
\ **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
|
||||
---------
|
||||
@@ -32,178 +36,234 @@ 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
|
||||
|
||||
Constructors
|
||||
------------
|
||||
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`AABB<class_AABB_constructor_AABB>` **(** **)** |
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`AABB<class_AABB_constructor_AABB>` **(** :ref:`AABB<class_AABB>` from **)** |
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`AABB<class_AABB_constructor_AABB>` **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` size **)** |
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`AABB<class_AABB_constructor_AABB>` **(** **)** |
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`AABB<class_AABB_constructor_AABB>` **(** :ref:`AABB<class_AABB>` from **)** |
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`AABB<class_AABB_constructor_AABB>` **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` size **)** |
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`abs<class_AABB_method_abs>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`encloses<class_AABB_method_encloses>` **(** :ref:`AABB<class_AABB>` with **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`expand<class_AABB_method_expand>` **(** :ref:`Vector3<class_Vector3>` to_point **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_center<class_AABB_method_get_center>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_endpoint<class_AABB_method_get_endpoint>` **(** :ref:`int<class_int>` idx **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_longest_axis<class_AABB_method_get_longest_axis>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_longest_axis_index<class_AABB_method_get_longest_axis_index>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_longest_axis_size<class_AABB_method_get_longest_axis_size>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_shortest_axis<class_AABB_method_get_shortest_axis>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_shortest_axis_index<class_AABB_method_get_shortest_axis_index>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_shortest_axis_size<class_AABB_method_get_shortest_axis_size>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_support<class_AABB_method_get_support>` **(** :ref:`Vector3<class_Vector3>` dir **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_volume<class_AABB_method_get_volume>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`grow<class_AABB_method_grow>` **(** :ref:`float<class_float>` by **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_point<class_AABB_method_has_point>` **(** :ref:`Vector3<class_Vector3>` point **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_surface<class_AABB_method_has_surface>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_volume<class_AABB_method_has_volume>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`intersection<class_AABB_method_intersection>` **(** :ref:`AABB<class_AABB>` with **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`intersects<class_AABB_method_intersects>` **(** :ref:`AABB<class_AABB>` with **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`intersects_plane<class_AABB_method_intersects_plane>` **(** :ref:`Plane<class_Plane>` plane **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`intersects_ray<class_AABB_method_intersects_ray>` **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` dir **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`intersects_segment<class_AABB_method_intersects_segment>` **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_AABB_method_is_equal_approx>` **(** :ref:`AABB<class_AABB>` aabb **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_finite<class_AABB_method_is_finite>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`merge<class_AABB_method_merge>` **(** :ref:`AABB<class_AABB>` with **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`abs<class_AABB_method_abs>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`encloses<class_AABB_method_encloses>` **(** :ref:`AABB<class_AABB>` with **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`expand<class_AABB_method_expand>` **(** :ref:`Vector3<class_Vector3>` to_point **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_center<class_AABB_method_get_center>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_endpoint<class_AABB_method_get_endpoint>` **(** :ref:`int<class_int>` idx **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_longest_axis<class_AABB_method_get_longest_axis>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_longest_axis_index<class_AABB_method_get_longest_axis_index>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_longest_axis_size<class_AABB_method_get_longest_axis_size>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_shortest_axis<class_AABB_method_get_shortest_axis>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_shortest_axis_index<class_AABB_method_get_shortest_axis_index>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_shortest_axis_size<class_AABB_method_get_shortest_axis_size>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_support<class_AABB_method_get_support>` **(** :ref:`Vector3<class_Vector3>` dir **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_volume<class_AABB_method_get_volume>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`grow<class_AABB_method_grow>` **(** :ref:`float<class_float>` by **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_point<class_AABB_method_has_point>` **(** :ref:`Vector3<class_Vector3>` point **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_surface<class_AABB_method_has_surface>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_volume<class_AABB_method_has_volume>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`intersection<class_AABB_method_intersection>` **(** :ref:`AABB<class_AABB>` with **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`intersects<class_AABB_method_intersects>` **(** :ref:`AABB<class_AABB>` with **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`intersects_plane<class_AABB_method_intersects_plane>` **(** :ref:`Plane<class_Plane>` plane **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`intersects_ray<class_AABB_method_intersects_ray>` **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` dir **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`intersects_segment<class_AABB_method_intersects_segment>` **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_AABB_method_is_equal_approx>` **(** :ref:`AABB<class_AABB>` aabb **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_finite<class_AABB_method_is_finite>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`merge<class_AABB_method_merge>` **(** :ref:`AABB<class_AABB>` with **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Operators
|
||||
---------
|
||||
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator !=<class_AABB_operator_neq_bool>` **(** :ref:`AABB<class_AABB>` right **)** |
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`operator *<class_AABB_operator_mul_AABB>` **(** :ref:`Transform3D<class_Transform3D>` right **)** |
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator ==<class_AABB_operator_eq_bool>` **(** :ref:`AABB<class_AABB>` right **)** |
|
||||
+-------------------------+---------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+----------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator !=<class_AABB_operator_neq_AABB>` **(** :ref:`AABB<class_AABB>` right **)** |
|
||||
+-------------------------+----------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AABB<class_AABB>` | :ref:`operator *<class_AABB_operator_mul_Transform3D>` **(** :ref:`Transform3D<class_Transform3D>` right **)** |
|
||||
+-------------------------+----------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator ==<class_AABB_operator_eq_AABB>` **(** :ref:`AABB<class_AABB>` right **)** |
|
||||
+-------------------------+----------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. 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
|
||||
|
||||
Constructor Descriptions
|
||||
------------------------
|
||||
|
||||
.. _class_AABB_constructor_AABB:
|
||||
|
||||
- :ref:`AABB<class_AABB>` **AABB** **(** **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
Constructs a default-initialized ``AABB`` with default (zero) values of :ref:`position<class_AABB_property_position>` and :ref:`size<class_AABB_property_size>`.
|
||||
:ref:`AABB<class_AABB>` **AABB** **(** **)**
|
||||
|
||||
Constructs a default-initialized **AABB** with default (zero) values of :ref:`position<class_AABB_property_position>` and :ref:`size<class_AABB_property_size>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
- :ref:`AABB<class_AABB>` **AABB** **(** :ref:`AABB<class_AABB>` from **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
Constructs an ``AABB`` as a copy of the given ``AABB``.
|
||||
:ref:`AABB<class_AABB>` **AABB** **(** :ref:`AABB<class_AABB>` from **)**
|
||||
|
||||
Constructs an **AABB** as a copy of the given **AABB**.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
- :ref:`AABB<class_AABB>` **AABB** **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` size **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
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-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AABB_method_abs:
|
||||
|
||||
- :ref:`AABB<class_AABB>` **abs** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`AABB<class_AABB>` **abs** **(** **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns ``true`` if this ``AABB`` completely encloses another one.
|
||||
:ref:`bool<class_bool>` **encloses** **(** :ref:`AABB<class_AABB>` with **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. 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 **)** |const|
|
||||
|
||||
Returns a copy of this **AABB** expanded to include a given point.
|
||||
|
||||
\ **Example:**\
|
||||
|
||||
@@ -226,208 +286,312 @@ Returns a copy of this ``AABB`` expanded to include a given point.
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_method_get_center:
|
||||
|
||||
- :ref:`Vector3<class_Vector3>` **get_center** **(** **)** |const|
|
||||
.. 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** **(** **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. 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 **)** |const|
|
||||
|
||||
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** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns the normalized longest axis of the ``AABB``.
|
||||
:ref:`Vector3<class_Vector3>` **get_longest_axis** **(** **)** |const|
|
||||
|
||||
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** **(** **)** |const|
|
||||
.. 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** **(** **)** |const|
|
||||
|
||||
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** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns the scalar length of the longest axis of the ``AABB``.
|
||||
:ref:`float<class_float>` **get_longest_axis_size** **(** **)** |const|
|
||||
|
||||
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** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns the normalized shortest axis of the ``AABB``.
|
||||
:ref:`Vector3<class_Vector3>` **get_shortest_axis** **(** **)** |const|
|
||||
|
||||
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** **(** **)** |const|
|
||||
.. 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** **(** **)** |const|
|
||||
|
||||
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** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns the scalar length of the shortest axis of the ``AABB``.
|
||||
:ref:`float<class_float>` **get_shortest_axis_size** **(** **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Vector3<class_Vector3>` **get_support** **(** :ref:`Vector3<class_Vector3>` dir **)** |const|
|
||||
|
||||
Returns the support point in a given direction. This is useful for collision detection algorithms.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_method_get_volume:
|
||||
|
||||
- :ref:`float<class_float>` **get_volume** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns the volume of the ``AABB``.
|
||||
:ref:`float<class_float>` **get_volume** **(** **)** |const|
|
||||
|
||||
Returns the volume of the **AABB**.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_method_grow:
|
||||
|
||||
- :ref:`AABB<class_AABB>` **grow** **(** :ref:`float<class_float>` by **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns a copy of the ``AABB`` grown a given number of units towards all the sides.
|
||||
:ref:`AABB<class_AABB>` **grow** **(** :ref:`float<class_float>` by **)** |const|
|
||||
|
||||
Returns a copy of the **AABB** grown a given number of units towards all the sides.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_method_has_point:
|
||||
|
||||
- :ref:`bool<class_bool>` **has_point** **(** :ref:`Vector3<class_Vector3>` point **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns ``true`` if the ``AABB`` contains a point. Points on the faces of the AABB are considered included, though float-point precision errors may impact the accuracy of such checks.
|
||||
:ref:`bool<class_bool>` **has_point** **(** :ref:`Vector3<class_Vector3>` point **)** |const|
|
||||
|
||||
\ **Note:** This method is not reliable for ``AABB`` with a *negative size*. Use :ref:`abs<class_AABB_method_abs>` to get a positive sized equivalent ``AABB`` to check for contained points.
|
||||
Returns ``true`` if the **AABB** contains a point. Points on the faces of the AABB are considered included, though float-point precision errors may impact the accuracy of such checks.
|
||||
|
||||
\ **Note:** This method is not reliable for **AABB** with a *negative size*. Use :ref:`abs<class_AABB_method_abs>` to get a positive sized equivalent **AABB** to check for contained points.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_method_has_surface:
|
||||
|
||||
- :ref:`bool<class_bool>` **has_surface** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns ``true`` if the ``AABB`` has a surface or a length, and ``false`` if the ``AABB`` is empty (all components of :ref:`size<class_AABB_property_size>` are zero or negative).
|
||||
:ref:`bool<class_bool>` **has_surface** **(** **)** |const|
|
||||
|
||||
Returns ``true`` if the **AABB** has a surface or a length, and ``false`` if the **AABB** is empty (all components of :ref:`size<class_AABB_property_size>` are zero or negative).
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_method_has_volume:
|
||||
|
||||
- :ref:`bool<class_bool>` **has_volume** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns ``true`` if the ``AABB`` has a volume, and ``false`` if the ``AABB`` is flat, empty, or has a negative :ref:`size<class_AABB_property_size>`.
|
||||
:ref:`bool<class_bool>` **has_volume** **(** **)** |const|
|
||||
|
||||
Returns ``true`` if the **AABB** has a volume, and ``false`` if the **AABB** is flat, empty, or has a negative :ref:`size<class_AABB_property_size>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_method_intersection:
|
||||
|
||||
- :ref:`AABB<class_AABB>` **intersection** **(** :ref:`AABB<class_AABB>` with **)** |const|
|
||||
.. 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 **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns ``true`` if the ``AABB`` overlaps with another.
|
||||
:ref:`bool<class_bool>` **intersects** **(** :ref:`AABB<class_AABB>` with **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. 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 **)** |const|
|
||||
|
||||
Returns ``true`` if the **AABB** is on both sides of a plane.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_method_intersects_ray:
|
||||
|
||||
- :ref:`Variant<class_Variant>` **intersects_ray** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` dir **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns ``true`` if the given ray intersects with this ``AABB``. Ray length is infinite.
|
||||
:ref:`Variant<class_Variant>` **intersects_ray** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` dir **)** |const|
|
||||
|
||||
Returns ``true`` if the given ray intersects with this **AABB**. Ray length is infinite.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_method_intersects_segment:
|
||||
|
||||
- :ref:`Variant<class_Variant>` **intersects_segment** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns ``true`` if the ``AABB`` intersects the line segment between ``from`` and ``to``.
|
||||
:ref:`Variant<class_Variant>` **intersects_segment** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns ``true`` if this ``AABB`` and ``aabb`` are approximately equal, by calling :ref:`@GlobalScope.is_equal_approx<class_@GlobalScope_method_is_equal_approx>` on each component.
|
||||
:ref:`bool<class_bool>` **is_equal_approx** **(** :ref:`AABB<class_AABB>` aabb **)** |const|
|
||||
|
||||
Returns ``true`` if this **AABB** and ``aabb`` are approximately equal, by calling :ref:`@GlobalScope.is_equal_approx<class_@GlobalScope_method_is_equal_approx>` on each component.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_method_is_finite:
|
||||
|
||||
- :ref:`bool<class_bool>` **is_finite** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns ``true`` if this ``AABB`` is finite, by calling :ref:`@GlobalScope.is_finite<class_@GlobalScope_method_is_finite>` on each component.
|
||||
:ref:`bool<class_bool>` **is_finite** **(** **)** |const|
|
||||
|
||||
Returns ``true`` if this **AABB** is finite, by calling :ref:`@GlobalScope.is_finite<class_@GlobalScope_method_is_finite>` on each component.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_method_merge:
|
||||
|
||||
- :ref:`AABB<class_AABB>` **merge** **(** :ref:`AABB<class_AABB>` with **)** |const|
|
||||
.. 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 **)** |const|
|
||||
|
||||
Returns a larger **AABB** that contains both this **AABB** and ``with``.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Operator Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AABB_operator_neq_bool:
|
||||
.. _class_AABB_operator_neq_AABB:
|
||||
|
||||
- :ref:`bool<class_bool>` **operator !=** **(** :ref:`AABB<class_AABB>` right **)**
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`bool<class_bool>` **operator !=** **(** :ref:`AABB<class_AABB>` right **)**
|
||||
|
||||
Returns ``true`` if the vectors are not equal.
|
||||
|
||||
\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx<class_AABB_method_is_equal_approx>` instead, which is more reliable.
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_operator_mul_AABB:
|
||||
|
||||
- :ref:`AABB<class_AABB>` **operator *** **(** :ref:`Transform3D<class_Transform3D>` right **)**
|
||||
|
||||
Inversely transforms (multiplies) the ``AABB`` by the given :ref:`Transform3D<class_Transform3D>` transformation matrix.
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_operator_eq_bool:
|
||||
.. _class_AABB_operator_mul_Transform3D:
|
||||
|
||||
- :ref:`bool<class_bool>` **operator ==** **(** :ref:`AABB<class_AABB>` right **)**
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`AABB<class_AABB>` **operator *** **(** :ref:`Transform3D<class_Transform3D>` right **)**
|
||||
|
||||
Inversely transforms (multiplies) the **AABB** by the given :ref:`Transform3D<class_Transform3D>` transformation matrix.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AABB_operator_eq_AABB:
|
||||
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`bool<class_bool>` **operator ==** **(** :ref:`AABB<class_AABB>` right **)**
|
||||
|
||||
Returns ``true`` if the AABBs are exactly equal.
|
||||
|
||||
|
||||
@@ -16,176 +16,226 @@ 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_close_on_escape<class_AcceptDialog_property_dialog_close_on_escape>` | ``true`` |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :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:`bool<class_bool>` | exclusive | ``true`` (overrides :ref:`Window<class_Window_property_exclusive>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`ok_button_text<class_AcceptDialog_property_ok_button_text>` | ``"OK"`` |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | title | ``"Alert!"`` (overrides :ref:`Window<class_Window_property_title>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | transient | ``true`` (overrides :ref:`Window<class_Window_property_transient>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | visible | ``false`` (overrides :ref:`Window<class_Window_property_visible>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | wrap_controls | ``true`` (overrides :ref:`Window<class_Window_property_wrap_controls>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`dialog_autowrap<class_AcceptDialog_property_dialog_autowrap>` | ``false`` |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`dialog_close_on_escape<class_AcceptDialog_property_dialog_close_on_escape>` | ``true`` |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :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:`bool<class_bool>` | exclusive | ``true`` (overrides :ref:`Window<class_Window_property_exclusive>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`ok_button_text<class_AcceptDialog_property_ok_button_text>` | ``"OK"`` |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | title | ``"Alert!"`` (overrides :ref:`Window<class_Window_property_title>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | transient | ``true`` (overrides :ref:`Window<class_Window_property_transient>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | visible | ``false`` (overrides :ref:`Window<class_Window_property_visible>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | wrap_controls | ``true`` (overrides :ref:`Window<class_Window_property_wrap_controls>`) |
|
||||
+-----------------------------+-----------------------------------------------------------------------------------+-------------------------------------------------------------------------+
|
||||
|
||||
.. 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_button<class_AcceptDialog_method_add_cancel_button>` **(** :ref:`String<class_String>` name **)** |
|
||||
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Label<class_Label>` | :ref:`get_label<class_AcceptDialog_method_get_label>` **(** **)** |
|
||||
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Button<class_Button>` | :ref:`get_ok_button<class_AcceptDialog_method_get_ok_button>` **(** **)** |
|
||||
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`register_text_enter<class_AcceptDialog_method_register_text_enter>` **(** :ref:`Control<class_Control>` 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_button<class_AcceptDialog_method_add_cancel_button>` **(** :ref:`String<class_String>` name **)** |
|
||||
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Label<class_Label>` | :ref:`get_label<class_AcceptDialog_method_get_label>` **(** **)** |
|
||||
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Button<class_Button>` | :ref:`get_ok_button<class_AcceptDialog_method_get_ok_button>` **(** **)** |
|
||||
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`register_text_enter<class_AcceptDialog_method_register_text_enter>` **(** :ref:`Control<class_Control>` line_edit **)** |
|
||||
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_button<class_AcceptDialog_method_remove_button>` **(** :ref:`Control<class_Control>` button **)** |
|
||||
+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Theme Properties
|
||||
----------------
|
||||
|
||||
+---------------------------------+---------------------------------------------------------------------------------+--------+
|
||||
| :ref:`int<class_int>` | :ref:`buttons_separation<class_AcceptDialog_theme_constant_buttons_separation>` | ``10`` |
|
||||
+---------------------------------+---------------------------------------------------------------------------------+--------+
|
||||
| :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_AcceptDialog_theme_style_panel>` | |
|
||||
+---------------------------------+---------------------------------------------------------------------------------+--------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------+---------------------------------------------------------------------------------+--------+
|
||||
| :ref:`int<class_int>` | :ref:`buttons_separation<class_AcceptDialog_theme_constant_buttons_separation>` | ``10`` |
|
||||
+---------------------------------+---------------------------------------------------------------------------------+--------+
|
||||
| :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_AcceptDialog_theme_style_panel>` | |
|
||||
+---------------------------------+---------------------------------------------------------------------------------+--------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Signals
|
||||
-------
|
||||
|
||||
.. _class_AcceptDialog_signal_cancelled:
|
||||
|
||||
- **cancelled** **(** **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**cancelled** **(** **)**
|
||||
|
||||
Emitted when the dialog is closed or the button created with :ref:`add_cancel_button<class_AcceptDialog_method_add_cancel_button>` is pressed.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _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:`StringName<class_StringName>` action **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**custom_action** **(** :ref:`StringName<class_StringName>` 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_close_on_escape:
|
||||
|
||||
- :ref:`bool<class_bool>` **dialog_close_on_escape**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------------+
|
||||
| *Default* | ``true`` |
|
||||
+-----------+----------------------------+
|
||||
| *Setter* | set_close_on_escape(value) |
|
||||
+-----------+----------------------------+
|
||||
| *Getter* | get_close_on_escape() |
|
||||
+-----------+----------------------------+
|
||||
:ref:`bool<class_bool>` **dialog_close_on_escape** = ``true``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_close_on_escape** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **get_close_on_escape** **(** **)**
|
||||
|
||||
If ``true``, the dialog will be hidden when the escape key (:ref:`@GlobalScope.KEY_ESCAPE<class_@GlobalScope_constant_KEY_ESCAPE>`) is pressed.
|
||||
|
||||
.. 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-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AcceptDialog_property_ok_button_text:
|
||||
|
||||
- :ref:`String<class_String>` **ok_button_text**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------------+
|
||||
| *Default* | ``"OK"`` |
|
||||
+-----------+---------------------------+
|
||||
| *Setter* | set_ok_button_text(value) |
|
||||
+-----------+---------------------------+
|
||||
| *Getter* | get_ok_button_text() |
|
||||
+-----------+---------------------------+
|
||||
:ref:`String<class_String>` **ok_button_text** = ``"OK"``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_ok_button_text** **(** :ref:`String<class_String>` value **)**
|
||||
- :ref:`String<class_String>` **get_ok_button_text** **(** **)**
|
||||
|
||||
The text displayed by the OK button (see :ref:`get_ok_button<class_AcceptDialog_method_get_ok_button>`).
|
||||
|
||||
.. 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.
|
||||
|
||||
@@ -193,70 +243,98 @@ 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_button:
|
||||
|
||||
- :ref:`Button<class_Button>` **add_cancel_button** **(** :ref:`String<class_String>` name **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Button<class_Button>` **add_cancel_button** **(** :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_button:
|
||||
|
||||
- :ref:`Button<class_Button>` **get_ok_button** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Button<class_Button>` **get_ok_button** **(** **)**
|
||||
|
||||
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:`Control<class_Control>` line_edit **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **register_text_enter** **(** :ref:`Control<class_Control>` 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_button<class_AcceptDialog_method_add_cancel_button>` method. After removal, pressing the ``button`` will no longer emit this dialog's :ref:`custom_action<class_AcceptDialog_signal_custom_action>` or :ref:`cancelled<class_AcceptDialog_signal_cancelled>` signals.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Theme Property Descriptions
|
||||
---------------------------
|
||||
|
||||
.. _class_AcceptDialog_theme_constant_buttons_separation:
|
||||
|
||||
- :ref:`int<class_int>` **buttons_separation**
|
||||
.. rst-class:: classref-themeproperty
|
||||
|
||||
+-----------+--------+
|
||||
| *Default* | ``10`` |
|
||||
+-----------+--------+
|
||||
:ref:`int<class_int>` **buttons_separation** = ``10``
|
||||
|
||||
The size of the vertical space between the dialog's content and the button row.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AcceptDialog_theme_style_panel:
|
||||
|
||||
- :ref:`StyleBox<class_StyleBox>` **panel**
|
||||
.. rst-class:: classref-themeproperty
|
||||
|
||||
:ref:`StyleBox<class_StyleBox>` **panel**
|
||||
|
||||
The panel that fills the background of the window.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AESContext
|
||||
|
||||
Interface to low level AES encryption features.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -95,78 +97,131 @@ This class provides access to AES encryption/decryption of raw data. Both AES-EC
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`finish<class_AESContext_method_finish>` **(** **)** |
|
||||
+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedByteArray<class_PackedByteArray>` | :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:`PackedByteArray<class_PackedByteArray>` key, :ref:`PackedByteArray<class_PackedByteArray>` iv=PackedByteArray() **)** |
|
||||
+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`update<class_AESContext_method_update>` **(** :ref:`PackedByteArray<class_PackedByteArray>` src **)** |
|
||||
+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`finish<class_AESContext_method_finish>` **(** **)** |
|
||||
+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedByteArray<class_PackedByteArray>` | :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:`PackedByteArray<class_PackedByteArray>` key, :ref:`PackedByteArray<class_PackedByteArray>` iv=PackedByteArray() **)** |
|
||||
+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`update<class_AESContext_method_update>` **(** :ref:`PackedByteArray<class_PackedByteArray>` 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:`PackedByteArray<class_PackedByteArray>` **get_iv_state** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedByteArray<class_PackedByteArray>` **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:`PackedByteArray<class_PackedByteArray>` key, :ref:`PackedByteArray<class_PackedByteArray>` iv=PackedByteArray() **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Error<enum_@GlobalScope_Error>` **start** **(** :ref:`Mode<enum_AESContext_Mode>` mode, :ref:`PackedByteArray<class_PackedByteArray>` key, :ref:`PackedByteArray<class_PackedByteArray>` iv=PackedByteArray() **)**
|
||||
|
||||
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:`PackedByteArray<class_PackedByteArray>` **update** **(** :ref:`PackedByteArray<class_PackedByteArray>` src **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedByteArray<class_PackedByteArray>` **update** **(** :ref:`PackedByteArray<class_PackedByteArray>` src **)**
|
||||
|
||||
Run the desired operation for this AES context. Will return a :ref:`PackedByteArray<class_PackedByteArray>` containing the result of encrypting (or decrypting) the given ``src``. See :ref:`start<class_AESContext_method_start>` for mode of operation.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AnimatableBody2D
|
||||
|
||||
Physics body for 2D physics which moves only by script or animation. Useful for moving platforms and doors.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -23,27 +25,37 @@ An animatable body can't be moved by external forces or contacts, but can be mov
|
||||
|
||||
When the body is moved manually, either from code or from an :ref:`AnimationPlayer<class_AnimationPlayer>` (with :ref:`AnimationPlayer.playback_process_mode<class_AnimationPlayer_property_playback_process_mode>` set to ``physics``), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-------------------------+-------------------------------------------------------------------------+----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`sync_to_physics<class_AnimatableBody2D_property_sync_to_physics>` | ``true`` |
|
||||
+-------------------------+-------------------------------------------------------------------------+----------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+-------------------------------------------------------------------------+----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`sync_to_physics<class_AnimatableBody2D_property_sync_to_physics>` | ``true`` |
|
||||
+-------------------------+-------------------------------------------------------------------------+----------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AnimatableBody2D_property_sync_to_physics:
|
||||
|
||||
- :ref:`bool<class_bool>` **sync_to_physics**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------------------+
|
||||
| *Default* | ``true`` |
|
||||
+-----------+------------------------------+
|
||||
| *Setter* | set_sync_to_physics(value) |
|
||||
+-----------+------------------------------+
|
||||
| *Getter* | is_sync_to_physics_enabled() |
|
||||
+-----------+------------------------------+
|
||||
:ref:`bool<class_bool>` **sync_to_physics** = ``true``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_sync_to_physics** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **is_sync_to_physics_enabled** **(** **)**
|
||||
|
||||
If ``true``, the body's movement will be synchronized to the physics frame. This is useful when animating movement via :ref:`AnimationPlayer<class_AnimationPlayer>`, for example on moving platforms. Do **not** use together with :ref:`PhysicsBody2D.move_and_collide<class_PhysicsBody2D_method_move_and_collide>`.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AnimatableBody3D
|
||||
|
||||
Physics body for 3D physics which moves only by script or animation. Useful for moving platforms and doors.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -23,6 +25,8 @@ An animatable body can't be moved by external forces or contacts, but can be mov
|
||||
|
||||
When the body is moved manually, either from code or from an :ref:`AnimationPlayer<class_AnimationPlayer>` (with :ref:`AnimationPlayer.playback_process_mode<class_AnimationPlayer_property_playback_process_mode>` set to ``physics``), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc).
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
@@ -32,27 +36,37 @@ Tutorials
|
||||
|
||||
- `3D Voxel Demo <https://godotengine.org/asset-library/asset/676>`__
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-------------------------+-------------------------------------------------------------------------+----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`sync_to_physics<class_AnimatableBody3D_property_sync_to_physics>` | ``true`` |
|
||||
+-------------------------+-------------------------------------------------------------------------+----------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+-------------------------------------------------------------------------+----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`sync_to_physics<class_AnimatableBody3D_property_sync_to_physics>` | ``true`` |
|
||||
+-------------------------+-------------------------------------------------------------------------+----------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AnimatableBody3D_property_sync_to_physics:
|
||||
|
||||
- :ref:`bool<class_bool>` **sync_to_physics**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------------------+
|
||||
| *Default* | ``true`` |
|
||||
+-----------+------------------------------+
|
||||
| *Setter* | set_sync_to_physics(value) |
|
||||
+-----------+------------------------------+
|
||||
| *Getter* | is_sync_to_physics_enabled() |
|
||||
+-----------+------------------------------+
|
||||
:ref:`bool<class_bool>` **sync_to_physics** = ``true``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_sync_to_physics** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **is_sync_to_physics_enabled** **(** **)**
|
||||
|
||||
If ``true``, the body's movement will be synchronized to the physics frame. This is useful when animating movement via :ref:`AnimationPlayer<class_AnimationPlayer>`, for example on moving platforms. Do **not** use together with :ref:`PhysicsBody3D.move_and_collide<class_PhysicsBody3D_method_move_and_collide>`.
|
||||
|
||||
|
||||
@@ -14,10 +14,12 @@ AnimatedSprite2D
|
||||
|
||||
Sprite node that contains multiple textures as frames to play for animation.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
``AnimatedSprite2D`` is similar to the :ref:`Sprite2D<class_Sprite2D>` 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.
|
||||
**AnimatedSprite2D** is similar to the :ref:`Sprite2D<class_Sprite2D>` 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.
|
||||
|
||||
After setting up :ref:`frames<class_AnimatedSprite2D_property_frames>`, :ref:`play<class_AnimatedSprite2D_method_play>` may be called. It's also possible to select an :ref:`animation<class_AnimatedSprite2D_property_animation>` and toggle :ref:`playing<class_AnimatedSprite2D_property_playing>`, even within the editor.
|
||||
|
||||
@@ -25,6 +27,8 @@ To pause the current animation, call :ref:`stop<class_AnimatedSprite2D_method_st
|
||||
|
||||
\ **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.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
@@ -32,212 +36,261 @@ Tutorials
|
||||
|
||||
- `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`animation<class_AnimatedSprite2D_property_animation>` | ``&"default"`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`centered<class_AnimatedSprite2D_property_centered>` | ``true`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`flip_h<class_AnimatedSprite2D_property_flip_h>` | ``false`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`flip_v<class_AnimatedSprite2D_property_flip_v>` | ``false`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite2D_property_frame>` | ``0`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite2D_property_frames>` | |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`offset<class_AnimatedSprite2D_property_offset>` | ``Vector2(0, 0)`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite2D_property_playing>` | ``false`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimatedSprite2D_property_speed_scale>` | ``1.0`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`animation<class_AnimatedSprite2D_property_animation>` | ``&"default"`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`centered<class_AnimatedSprite2D_property_centered>` | ``true`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`flip_h<class_AnimatedSprite2D_property_flip_h>` | ``false`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`flip_v<class_AnimatedSprite2D_property_flip_v>` | ``false`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`int<class_int>` | :ref:`frame<class_AnimatedSprite2D_property_frame>` | ``0`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`SpriteFrames<class_SpriteFrames>` | :ref:`frames<class_AnimatedSprite2D_property_frames>` | |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`offset<class_AnimatedSprite2D_property_offset>` | ``Vector2(0, 0)`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`playing<class_AnimatedSprite2D_property_playing>` | ``false`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimatedSprite2D_property_speed_scale>` | ``1.0`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+-------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+------+---------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`play<class_AnimatedSprite2D_method_play>` **(** :ref:`StringName<class_StringName>` anim=&"", :ref:`bool<class_bool>` backwards=false **)** |
|
||||
+------+---------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`stop<class_AnimatedSprite2D_method_stop>` **(** **)** |
|
||||
+------+---------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+------+---------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`play<class_AnimatedSprite2D_method_play>` **(** :ref:`StringName<class_StringName>` anim=&"", :ref:`bool<class_bool>` backwards=false **)** |
|
||||
+------+---------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`stop<class_AnimatedSprite2D_method_stop>` **(** **)** |
|
||||
+------+---------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Signals
|
||||
-------
|
||||
|
||||
.. _class_AnimatedSprite2D_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_AnimatedSprite2D_signal_frame_changed:
|
||||
|
||||
- **frame_changed** **(** **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**frame_changed** **(** **)**
|
||||
|
||||
Emitted when :ref:`frame<class_AnimatedSprite2D_property_frame>` changed.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AnimatedSprite2D_property_animation:
|
||||
|
||||
- :ref:`StringName<class_StringName>` **animation**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``&"default"`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_animation(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_animation() |
|
||||
+-----------+----------------------+
|
||||
:ref:`StringName<class_StringName>` **animation** = ``&"default"``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_animation** **(** :ref:`StringName<class_StringName>` value **)**
|
||||
- :ref:`StringName<class_StringName>` **get_animation** **(** **)**
|
||||
|
||||
The current animation from the :ref:`frames<class_AnimatedSprite2D_property_frames>` resource. If this value changes, the ``frame`` counter is reset.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimatedSprite2D_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_AnimatedSprite2D_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_AnimatedSprite2D_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_AnimatedSprite2D_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_AnimatedSprite2D_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_AnimatedSprite2D_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_AnimatedSprite2D_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_AnimatedSprite2D_property_animation>` is currently playing. Setting this property to ``false`` is the equivalent of calling :ref:`stop<class_AnimatedSprite2D_method_stop>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimatedSprite2D_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. If set to a negative value, the animation is played in reverse. If set to ``0``, the animation is paused, preserving the current frame's elapsed time.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AnimatedSprite2D_method_play:
|
||||
|
||||
- void **play** **(** :ref:`StringName<class_StringName>` anim=&"", :ref:`bool<class_bool>` backwards=false **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **play** **(** :ref:`StringName<class_StringName>` 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 is played in reverse.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimatedSprite2D_method_stop:
|
||||
|
||||
- void **stop** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **stop** **(** **)**
|
||||
|
||||
Stops the current :ref:`animation<class_AnimatedSprite2D_property_animation>` at the current :ref:`frame<class_AnimatedSprite2D_property_frame>`.
|
||||
|
||||
|
||||
@@ -14,154 +14,203 @@ AnimatedSprite3D
|
||||
|
||||
2D sprite node in 3D world, that can use multiple 2D textures for animation.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
``AnimatedSprite3D`` is similar to the :ref:`Sprite3D<class_Sprite3D>` node, except it carries multiple textures as animation :ref:`frames<class_AnimatedSprite3D_property_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.
|
||||
**AnimatedSprite3D** is similar to the :ref:`Sprite3D<class_Sprite3D>` node, except it carries multiple textures as animation :ref:`frames<class_AnimatedSprite3D_property_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.
|
||||
|
||||
After setting up :ref:`frames<class_AnimatedSprite3D_property_frames>`, :ref:`play<class_AnimatedSprite3D_method_play>` may be called. It's also possible to select an :ref:`animation<class_AnimatedSprite3D_property_animation>` and toggle :ref:`playing<class_AnimatedSprite3D_property_playing>`, even within the editor.
|
||||
|
||||
To pause the current animation, call :ref:`stop<class_AnimatedSprite3D_method_stop>` or set :ref:`playing<class_AnimatedSprite3D_property_playing>` to ``false``. Alternatively, setting :ref:`speed_scale<class_AnimatedSprite3D_property_speed_scale>` to ``0`` also preserves the current frame's elapsed time.
|
||||
|
||||
.. 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:`StringName<class_StringName>` | :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`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+----------------+
|
||||
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimatedSprite3D_property_speed_scale>` | ``1.0`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+----------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------------------+-----------------------------------------------------------------+----------------+
|
||||
| :ref:`StringName<class_StringName>` | :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`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+----------------+
|
||||
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimatedSprite3D_property_speed_scale>` | ``1.0`` |
|
||||
+-----------------------------------------+-----------------------------------------------------------------+----------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+------+---------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`play<class_AnimatedSprite3D_method_play>` **(** :ref:`StringName<class_StringName>` anim=&"", :ref:`bool<class_bool>` backwards=false **)** |
|
||||
+------+---------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`stop<class_AnimatedSprite3D_method_stop>` **(** **)** |
|
||||
+------+---------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+------+---------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`play<class_AnimatedSprite3D_method_play>` **(** :ref:`StringName<class_StringName>` anim=&"", :ref:`bool<class_bool>` backwards=false **)** |
|
||||
+------+---------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`StringName<class_StringName>` **animation**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``&"default"`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_animation(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_animation() |
|
||||
+-----------+----------------------+
|
||||
:ref:`StringName<class_StringName>` **animation** = ``&"default"``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_animation** **(** :ref:`StringName<class_StringName>` value **)**
|
||||
- :ref:`StringName<class_StringName>` **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`` |
|
||||
+-----------+--------------------+
|
||||
| *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_AnimatedSprite3D_property_animation>` is currently playing. Setting this property to ``false`` is the equivalent of calling :ref:`stop<class_AnimatedSprite3D_method_stop>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimatedSprite3D_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. If set to a negative value, the animation is played in reverse. If set to ``0``, the animation is paused, preserving the current frame's elapsed time.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AnimatedSprite3D_method_play:
|
||||
|
||||
- void **play** **(** :ref:`StringName<class_StringName>` anim=&"", :ref:`bool<class_bool>` backwards=false **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **play** **(** :ref:`StringName<class_StringName>` 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 is played in reverse.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimatedSprite3D_method_stop:
|
||||
|
||||
- void **stop** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **stop** **(** **)**
|
||||
|
||||
Stops the current :ref:`animation<class_AnimatedSprite3D_property_animation>` at the current :ref:`frame<class_AnimatedSprite3D_property_frame>`.
|
||||
|
||||
|
||||
@@ -14,163 +14,216 @@ 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:`AnimatedSprite2D<class_AnimatedSprite2D>`, it isn't a :ref:`Node<class_Node>`, but has the advantage of being usable anywhere a :ref:`Texture2D<class_Texture2D>` 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:`AnimatedSprite2D<class_AnimatedSprite2D>`, it isn't a :ref:`Node<class_Node>`, but has the advantage of being usable anywhere a :ref:`Texture2D<class_Texture2D>` resource can be used, e.g. in a :ref:`TileSet<class_TileSet>`.
|
||||
|
||||
The playback of the animation is controlled by the :ref:`speed_scale<class_AnimatedTexture_property_speed_scale>` property, as well as each frame's duration (see :ref:`set_frame_duration<class_AnimatedTexture_method_set_frame_duration>`). 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:`Texture2D<class_Texture2D>`.
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`current_frame<class_AnimatedTexture_property_current_frame>` | |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`frames<class_AnimatedTexture_property_frames>` | ``1`` |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`one_shot<class_AnimatedTexture_property_one_shot>` | ``false`` |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`pause<class_AnimatedTexture_property_pause>` | ``false`` |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | resource_local_to_scene | ``false`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimatedTexture_property_speed_scale>` | ``1.0`` |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`current_frame<class_AnimatedTexture_property_current_frame>` | |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`frames<class_AnimatedTexture_property_frames>` | ``1`` |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`one_shot<class_AnimatedTexture_property_one_shot>` | ``false`` |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`pause<class_AnimatedTexture_property_pause>` | ``false`` |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | resource_local_to_scene | ``false`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`speed_scale<class_AnimatedTexture_property_speed_scale>` | ``1.0`` |
|
||||
+---------------------------+--------------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_frame_duration<class_AnimatedTexture_method_get_frame_duration>` **(** :ref:`int<class_int>` frame **)** |const| |
|
||||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Texture2D<class_Texture2D>` | :ref:`get_frame_texture<class_AnimatedTexture_method_get_frame_texture>` **(** :ref:`int<class_int>` frame **)** |const| |
|
||||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_frame_duration<class_AnimatedTexture_method_set_frame_duration>` **(** :ref:`int<class_int>` frame, :ref:`float<class_float>` duration **)** |
|
||||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_frame_texture<class_AnimatedTexture_method_set_frame_texture>` **(** :ref:`int<class_int>` frame, :ref:`Texture2D<class_Texture2D>` texture **)** |
|
||||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_frame_duration<class_AnimatedTexture_method_get_frame_duration>` **(** :ref:`int<class_int>` frame **)** |const| |
|
||||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Texture2D<class_Texture2D>` | :ref:`get_frame_texture<class_AnimatedTexture_method_get_frame_texture>` **(** :ref:`int<class_int>` frame **)** |const| |
|
||||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_frame_duration<class_AnimatedTexture_method_set_frame_duration>` **(** :ref:`int<class_int>` frame, :ref:`float<class_float>` duration **)** |
|
||||
+-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_frame_texture<class_AnimatedTexture_method_set_frame_texture>` **(** :ref:`int<class_int>` frame, :ref:`Texture2D<class_Texture2D>` 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:`AnimatedSprite2D<class_AnimatedSprite2D>`.
|
||||
.. 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:`AnimatedSprite2D<class_AnimatedSprite2D>`.
|
||||
|
||||
.. 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_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_one_shot:
|
||||
|
||||
- :ref:`bool<class_bool>` **one_shot**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------+
|
||||
| *Default* | ``false`` |
|
||||
+-----------+---------------------+
|
||||
| *Setter* | set_one_shot(value) |
|
||||
+-----------+---------------------+
|
||||
| *Getter* | get_one_shot() |
|
||||
+-----------+---------------------+
|
||||
:ref:`bool<class_bool>` **one_shot** = ``false``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_one_shot** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **get_one_shot** **(** **)**
|
||||
|
||||
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-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimatedTexture_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. If set to a negative value, the animation is played in reverse.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AnimatedTexture_method_get_frame_duration:
|
||||
|
||||
- :ref:`float<class_float>` **get_frame_duration** **(** :ref:`int<class_int>` frame **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **get_frame_duration** **(** :ref:`int<class_int>` frame **)** |const|
|
||||
|
||||
Returns the given ``frame``'s duration, in seconds.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimatedTexture_method_get_frame_texture:
|
||||
|
||||
- :ref:`Texture2D<class_Texture2D>` **get_frame_texture** **(** :ref:`int<class_int>` frame **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Texture2D<class_Texture2D>` **get_frame_texture** **(** :ref:`int<class_int>` frame **)** |const|
|
||||
|
||||
Returns the given frame's :ref:`Texture2D<class_Texture2D>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimatedTexture_method_set_frame_duration:
|
||||
|
||||
- void **set_frame_duration** **(** :ref:`int<class_int>` frame, :ref:`float<class_float>` duration **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_frame_duration** **(** :ref:`int<class_int>` frame, :ref:`float<class_float>` duration **)**
|
||||
|
||||
Sets the duration of any given ``frame``. The final duration is affected by the :ref:`speed_scale<class_AnimatedTexture_property_speed_scale>`. If set to ``0``, the frame is skipped during playback.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimatedTexture_method_set_frame_texture:
|
||||
|
||||
- void **set_frame_texture** **(** :ref:`int<class_int>` frame, :ref:`Texture2D<class_Texture2D>` texture **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_frame_texture** **(** :ref:`int<class_int>` frame, :ref:`Texture2D<class_Texture2D>` texture **)**
|
||||
|
||||
Assigns a :ref:`Texture2D<class_Texture2D>` 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.
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,126 +14,202 @@ AnimationLibrary
|
||||
|
||||
Container for :ref:`Animation<class_Animation>` resources.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
An animation library stores a set of animations accessible through :ref:`StringName<class_StringName>` keys, for use with :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Animation tutorial index <../tutorials/animation/index>`
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-------------------------------------+-----------------------------------------------------+--------+
|
||||
| :ref:`Dictionary<class_Dictionary>` | :ref:`_data<class_AnimationLibrary_property__data>` | ``{}`` |
|
||||
+-------------------------------------+-----------------------------------------------------+--------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------+-----------------------------------------------------+--------+
|
||||
| :ref:`Dictionary<class_Dictionary>` | :ref:`_data<class_AnimationLibrary_property__data>` | ``{}`` |
|
||||
+-------------------------------------+-----------------------------------------------------+--------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`add_animation<class_AnimationLibrary_method_add_animation>` **(** :ref:`StringName<class_StringName>` name, :ref:`Animation<class_Animation>` animation **)** |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Animation<class_Animation>` | :ref:`get_animation<class_AnimationLibrary_method_get_animation>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName[]<class_StringName>` | :ref:`get_animation_list<class_AnimationLibrary_method_get_animation_list>` **(** **)** |const| |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_animation<class_AnimationLibrary_method_has_animation>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_animation<class_AnimationLibrary_method_remove_animation>` **(** :ref:`StringName<class_StringName>` name **)** |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`rename_animation<class_AnimationLibrary_method_rename_animation>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` newname **)** |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`add_animation<class_AnimationLibrary_method_add_animation>` **(** :ref:`StringName<class_StringName>` name, :ref:`Animation<class_Animation>` animation **)** |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Animation<class_Animation>` | :ref:`get_animation<class_AnimationLibrary_method_get_animation>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName[]<class_StringName>` | :ref:`get_animation_list<class_AnimationLibrary_method_get_animation_list>` **(** **)** |const| |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_animation<class_AnimationLibrary_method_has_animation>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_animation<class_AnimationLibrary_method_remove_animation>` **(** :ref:`StringName<class_StringName>` name **)** |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`rename_animation<class_AnimationLibrary_method_rename_animation>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` newname **)** |
|
||||
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Signals
|
||||
-------
|
||||
|
||||
.. _class_AnimationLibrary_signal_animation_added:
|
||||
|
||||
- **animation_added** **(** :ref:`StringName<class_StringName>` name **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**animation_added** **(** :ref:`StringName<class_StringName>` name **)**
|
||||
|
||||
Emitted when an :ref:`Animation<class_Animation>` is added, under the key ``name``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationLibrary_signal_animation_changed:
|
||||
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**animation_changed** **(** :ref:`StringName<class_StringName>` name **)**
|
||||
|
||||
Emitted when there's a change in one of the animations, e.g. tracks are added, moved or have changed paths. ``name`` is the key of the animation that was changed.
|
||||
|
||||
See also :ref:`Resource.changed<class_Resource_signal_changed>`, which this acts as a relay for.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationLibrary_signal_animation_removed:
|
||||
|
||||
- **animation_removed** **(** :ref:`StringName<class_StringName>` name **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**animation_removed** **(** :ref:`StringName<class_StringName>` name **)**
|
||||
|
||||
Emitted when an :ref:`Animation<class_Animation>` stored with the key ``name`` is removed.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationLibrary_signal_animation_renamed:
|
||||
|
||||
- **animation_renamed** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` to_name **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**animation_renamed** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` to_name **)**
|
||||
|
||||
Emitted when the key for an :ref:`Animation<class_Animation>` is changed, from ``name`` to ``to_name``.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AnimationLibrary_property__data:
|
||||
|
||||
- :ref:`Dictionary<class_Dictionary>` **_data**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+--------+
|
||||
| *Default* | ``{}`` |
|
||||
+-----------+--------+
|
||||
:ref:`Dictionary<class_Dictionary>` **_data** = ``{}``
|
||||
|
||||
.. 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_AnimationLibrary_method_add_animation:
|
||||
|
||||
- :ref:`Error<enum_@GlobalScope_Error>` **add_animation** **(** :ref:`StringName<class_StringName>` name, :ref:`Animation<class_Animation>` animation **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Error<enum_@GlobalScope_Error>` **add_animation** **(** :ref:`StringName<class_StringName>` name, :ref:`Animation<class_Animation>` animation **)**
|
||||
|
||||
Adds the ``animation`` to the library, accessible by the key ``name``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationLibrary_method_get_animation:
|
||||
|
||||
- :ref:`Animation<class_Animation>` **get_animation** **(** :ref:`StringName<class_StringName>` name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Animation<class_Animation>` **get_animation** **(** :ref:`StringName<class_StringName>` 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_AnimationLibrary_method_get_animation_list:
|
||||
|
||||
- :ref:`StringName[]<class_StringName>` **get_animation_list** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`StringName[]<class_StringName>` **get_animation_list** **(** **)** |const|
|
||||
|
||||
Returns the keys for the :ref:`Animation<class_Animation>`\ s stored in the library.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationLibrary_method_has_animation:
|
||||
|
||||
- :ref:`bool<class_bool>` **has_animation** **(** :ref:`StringName<class_StringName>` name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **has_animation** **(** :ref:`StringName<class_StringName>` name **)** |const|
|
||||
|
||||
Returns ``true`` if the library stores an :ref:`Animation<class_Animation>` with ``name`` as the key.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationLibrary_method_remove_animation:
|
||||
|
||||
- void **remove_animation** **(** :ref:`StringName<class_StringName>` name **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **remove_animation** **(** :ref:`StringName<class_StringName>` name **)**
|
||||
|
||||
Removes the :ref:`Animation<class_Animation>` with the key ``name``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationLibrary_method_rename_animation:
|
||||
|
||||
- void **rename_animation** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` newname **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **rename_animation** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` newname **)**
|
||||
|
||||
Changes the key of the :ref:`Animation<class_Animation>` associated with the key ``name`` to ``newname``.
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ AnimationNode
|
||||
|
||||
Base resource for :ref:`AnimationTree<class_AnimationTree>` nodes.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -23,168 +25,255 @@ 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:`AnimationTree <../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
|
||||
-------
|
||||
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`_get_caption<class_AnimationNode_method__get_caption>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`_get_child_by_name<class_AnimationNode_method__get_child_by_name>` **(** :ref:`StringName<class_StringName>` name **)** |virtual| |const| |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Dictionary<class_Dictionary>` | :ref:`_get_child_nodes<class_AnimationNode_method__get_child_nodes>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`_get_parameter_default_value<class_AnimationNode_method__get_parameter_default_value>` **(** :ref:`StringName<class_StringName>` parameter **)** |virtual| |const| |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`_get_parameter_list<class_AnimationNode_method__get_parameter_list>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_has_filter<class_AnimationNode_method__has_filter>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_process<class_AnimationNode_method__process>` **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`bool<class_bool>` seek_root **)** |virtual| |const| |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_input<class_AnimationNode_method_add_input>` **(** :ref:`String<class_String>` name **)** |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`blend_animation<class_AnimationNode_method_blend_animation>` **(** :ref:`StringName<class_StringName>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`bool<class_bool>` seek_root, :ref:`float<class_float>` blend, :ref:`int<class_int>` pingponged=0 **)** |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :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:`bool<class_bool>` seek_root, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` sync=true **)** |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`blend_node<class_AnimationNode_method_blend_node>` **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`bool<class_bool>` seek_root, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` sync=true **)** |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :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:`StringName<class_StringName>` name **)** |const| |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_path_filtered<class_AnimationNode_method_is_path_filtered>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`StringName<class_StringName>` name, :ref:`Variant<class_Variant>` value **)** |
|
||||
+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`_get_caption<class_AnimationNode_method__get_caption>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`_get_child_by_name<class_AnimationNode_method__get_child_by_name>` **(** :ref:`StringName<class_StringName>` name **)** |virtual| |const| |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Dictionary<class_Dictionary>` | :ref:`_get_child_nodes<class_AnimationNode_method__get_child_nodes>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Variant<class_Variant>` | :ref:`_get_parameter_default_value<class_AnimationNode_method__get_parameter_default_value>` **(** :ref:`StringName<class_StringName>` parameter **)** |virtual| |const| |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Array<class_Array>` | :ref:`_get_parameter_list<class_AnimationNode_method__get_parameter_list>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_has_filter<class_AnimationNode_method__has_filter>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_process<class_AnimationNode_method__process>` **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`bool<class_bool>` is_external_seeking **)** |virtual| |const| |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_input<class_AnimationNode_method_add_input>` **(** :ref:`String<class_String>` name **)** |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`blend_animation<class_AnimationNode_method_blend_animation>` **(** :ref:`StringName<class_StringName>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`bool<class_bool>` is_external_seeking, :ref:`float<class_float>` blend, :ref:`LoopedFlag<enum_Animation_LoopedFlag>` looped_flag=0 **)** |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :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:`bool<class_bool>` is_external_seeking, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` sync=true **)** |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`blend_node<class_AnimationNode_method_blend_node>` **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`bool<class_bool>` is_external_seeking, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` sync=true **)** |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :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:`StringName<class_StringName>` name **)** |const| |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_path_filtered<class_AnimationNode_method_is_path_filtered>` **(** :ref:`NodePath<class_NodePath>` path **)** |const| |
|
||||
+-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`StringName<class_StringName>` 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__get_caption:
|
||||
|
||||
- :ref:`String<class_String>` **_get_caption** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`String<class_String>` **_get_caption** **(** **)** |virtual| |const|
|
||||
|
||||
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:`AnimationNode<class_AnimationNode>` **_get_child_by_name** **(** :ref:`StringName<class_StringName>` name **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`AnimationNode<class_AnimationNode>` **_get_child_by_name** **(** :ref:`StringName<class_StringName>` name **)** |virtual| |const|
|
||||
|
||||
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| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Dictionary<class_Dictionary>` **_get_child_nodes** **(** **)** |virtual| |const|
|
||||
|
||||
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_parameter_default_value:
|
||||
|
||||
- :ref:`Variant<class_Variant>` **_get_parameter_default_value** **(** :ref:`StringName<class_StringName>` parameter **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Variant<class_Variant>` **_get_parameter_default_value** **(** :ref:`StringName<class_StringName>` parameter **)** |virtual| |const|
|
||||
|
||||
When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to return the default 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_list:
|
||||
|
||||
- :ref:`Array<class_Array>` **_get_parameter_list** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Array<class_Array>` **_get_parameter_list** **(** **)** |virtual| |const|
|
||||
|
||||
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| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **_has_filter** **(** **)** |virtual| |const|
|
||||
|
||||
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__process:
|
||||
|
||||
- :ref:`float<class_float>` **_process** **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`bool<class_bool>` seek_root **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_process** **(** :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`bool<class_bool>` is_external_seeking **)** |virtual| |const|
|
||||
|
||||
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.
|
||||
|
||||
@@ -192,91 +281,137 @@ 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_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:`StringName<class_StringName>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`bool<class_bool>` seek_root, :ref:`float<class_float>` blend, :ref:`int<class_int>` pingponged=0 **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **blend_animation** **(** :ref:`StringName<class_StringName>` animation, :ref:`float<class_float>` time, :ref:`float<class_float>` delta, :ref:`bool<class_bool>` seeked, :ref:`bool<class_bool>` is_external_seeking, :ref:`float<class_float>` blend, :ref:`LoopedFlag<enum_Animation_LoopedFlag>` looped_flag=0 **)**
|
||||
|
||||
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 ``seeked`` happened.
|
||||
|
||||
A ``looped_flag`` is used by internal processing immediately after the loop. See also :ref:`LoopedFlag<enum_Animation_LoopedFlag>`.
|
||||
|
||||
.. 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:`bool<class_bool>` seek_root, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` sync=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:`bool<class_bool>` is_external_seeking, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` sync=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:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`bool<class_bool>` seek_root, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` sync=true **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **blend_node** **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`float<class_float>` time, :ref:`bool<class_bool>` seek, :ref:`bool<class_bool>` is_external_seeking, :ref:`float<class_float>` blend, :ref:`FilterAction<enum_AnimationNode_FilterAction>` filter=0, :ref:`bool<class_bool>` sync=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_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:`StringName<class_StringName>` name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Variant<class_Variant>` **get_parameter** **(** :ref:`StringName<class_StringName>` 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_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_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:`StringName<class_StringName>` name, :ref:`Variant<class_Variant>` value **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_parameter** **(** :ref:`StringName<class_StringName>` 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.
|
||||
|
||||
|
||||
@@ -14,11 +14,15 @@ 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
|
||||
---------
|
||||
|
||||
|
||||
@@ -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
|
||||
---------
|
||||
|
||||
|
||||
@@ -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,60 +32,87 @@ Tutorials
|
||||
|
||||
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-------------------------------------------------------+-------------------------------------------------------------------+---------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`animation<class_AnimationNodeAnimation_property_animation>` | ``&""`` |
|
||||
+-------------------------------------------------------+-------------------------------------------------------------------+---------+
|
||||
| :ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` | :ref:`play_mode<class_AnimationNodeAnimation_property_play_mode>` | ``0`` |
|
||||
+-------------------------------------------------------+-------------------------------------------------------------------+---------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------------------+-------------------------------------------------------------------+---------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`animation<class_AnimationNodeAnimation_property_animation>` | ``&""`` |
|
||||
+-------------------------------------------------------+-------------------------------------------------------------------+---------+
|
||||
| :ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` | :ref:`play_mode<class_AnimationNodeAnimation_property_play_mode>` | ``0`` |
|
||||
+-------------------------------------------------------+-------------------------------------------------------------------+---------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Enumerations
|
||||
------------
|
||||
|
||||
.. _enum_AnimationNodeAnimation_PlayMode:
|
||||
|
||||
.. _class_AnimationNodeAnimation_constant_PLAY_MODE_FORWARD:
|
||||
|
||||
.. _class_AnimationNodeAnimation_constant_PLAY_MODE_BACKWARD:
|
||||
.. rst-class:: classref-enumeration
|
||||
|
||||
enum **PlayMode**:
|
||||
|
||||
- **PLAY_MODE_FORWARD** = **0**
|
||||
.. _class_AnimationNodeAnimation_constant_PLAY_MODE_FORWARD:
|
||||
|
||||
- **PLAY_MODE_BACKWARD** = **1**
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` **PLAY_MODE_FORWARD** = ``0``
|
||||
|
||||
|
||||
|
||||
.. _class_AnimationNodeAnimation_constant_PLAY_MODE_BACKWARD:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` **PLAY_MODE_BACKWARD** = ``1``
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AnimationNodeAnimation_property_animation:
|
||||
|
||||
- :ref:`StringName<class_StringName>` **animation**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``&""`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_animation(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_animation() |
|
||||
+-----------+----------------------+
|
||||
:ref:`StringName<class_StringName>` **animation** = ``&""``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_animation** **(** :ref:`StringName<class_StringName>` value **)**
|
||||
- :ref:`StringName<class_StringName>` **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>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeAnimation_property_play_mode:
|
||||
|
||||
- :ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` **play_mode**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_play_mode(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_play_mode() |
|
||||
+-----------+----------------------+
|
||||
:ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` **play_mode** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_play_mode** **(** :ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` value **)**
|
||||
- :ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` **get_play_mode** **(** **)**
|
||||
|
||||
Determines the playback direction of the animation.
|
||||
|
||||
|
||||
@@ -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
|
||||
---------
|
||||
|
||||
|
||||
@@ -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,6 +29,8 @@ 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
|
||||
---------
|
||||
|
||||
|
||||
@@ -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,182 +27,235 @@ 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:`AnimationTree <../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:`bool<class_bool>` | :ref:`sync<class_AnimationNodeBlendSpace1D_property_sync>` | ``false`` |
|
||||
+-----------------------------+--------------------------------------------------------------------------+-------------+
|
||||
| :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:`bool<class_bool>` | :ref:`sync<class_AnimationNodeBlendSpace1D_property_sync>` | ``false`` |
|
||||
+-----------------------------+--------------------------------------------------------------------------+-------------+
|
||||
| :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_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 ``false``, the blended animations' frame are stopped when the blend value is ``0``.
|
||||
|
||||
If ``true``, forcing the blended animations to advance frame.
|
||||
|
||||
.. 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.
|
||||
|
||||
|
||||
@@ -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,299 +34,397 @@ 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:`bool<class_bool>` | :ref:`sync<class_AnimationNodeBlendSpace2D_property_sync>` | ``false`` |
|
||||
+------------------------------------------------------------+--------------------------------------------------------------------------------+-----------------------+
|
||||
| :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:`bool<class_bool>` | :ref:`sync<class_AnimationNodeBlendSpace2D_property_sync>` | ``false`` |
|
||||
+------------------------------------------------------------+--------------------------------------------------------------------------------+-----------------------+
|
||||
| :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_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 ``false``, the blended animations' frame are stopped when the blend value is ``0``.
|
||||
|
||||
If ``true``, forcing the blended animations to advance frame.
|
||||
|
||||
.. 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.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AnimationNodeBlendTree
|
||||
|
||||
:ref:`AnimationTree<class_AnimationTree>` node resource that contains many blend type nodes.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -21,164 +23,259 @@ 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:`AnimationTree <../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:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2(0, 0) **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`connect_node<class_AnimationNodeBlendTree_method_connect_node>` **(** :ref:`StringName<class_StringName>` input_node, :ref:`int<class_int>` input_index, :ref:`StringName<class_StringName>` output_node **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`disconnect_node<class_AnimationNodeBlendTree_method_disconnect_node>` **(** :ref:`StringName<class_StringName>` input_node, :ref:`int<class_int>` input_index **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`get_node<class_AnimationNodeBlendTree_method_get_node>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_AnimationNodeBlendTree_method_get_node_position>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_node<class_AnimationNodeBlendTree_method_has_node>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_node<class_AnimationNodeBlendTree_method_remove_node>` **(** :ref:`StringName<class_StringName>` name **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`rename_node<class_AnimationNodeBlendTree_method_rename_node>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` new_name **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_node_position<class_AnimationNodeBlendTree_method_set_node_position>` **(** :ref:`StringName<class_StringName>` name, :ref:`Vector2<class_Vector2>` position **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_node<class_AnimationNodeBlendTree_method_add_node>` **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2(0, 0) **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`connect_node<class_AnimationNodeBlendTree_method_connect_node>` **(** :ref:`StringName<class_StringName>` input_node, :ref:`int<class_int>` input_index, :ref:`StringName<class_StringName>` output_node **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`disconnect_node<class_AnimationNodeBlendTree_method_disconnect_node>` **(** :ref:`StringName<class_StringName>` input_node, :ref:`int<class_int>` input_index **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AnimationNode<class_AnimationNode>` | :ref:`get_node<class_AnimationNodeBlendTree_method_get_node>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`get_node_position<class_AnimationNodeBlendTree_method_get_node_position>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_node<class_AnimationNodeBlendTree_method_has_node>` **(** :ref:`StringName<class_StringName>` name **)** |const| |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_node<class_AnimationNodeBlendTree_method_remove_node>` **(** :ref:`StringName<class_StringName>` name **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`rename_node<class_AnimationNodeBlendTree_method_rename_node>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` new_name **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_node_position<class_AnimationNodeBlendTree_method_set_node_position>` **(** :ref:`StringName<class_StringName>` name, :ref:`Vector2<class_Vector2>` position **)** |
|
||||
+-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Signals
|
||||
-------
|
||||
|
||||
.. _class_AnimationNodeBlendTree_signal_node_changed:
|
||||
|
||||
- **node_changed** **(** :ref:`StringName<class_StringName>` node_name **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**node_changed** **(** :ref:`StringName<class_StringName>` node_name **)**
|
||||
|
||||
Emitted when the input port information is changed.
|
||||
|
||||
.. 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:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2(0, 0) **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **add_node** **(** :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` input_node, :ref:`int<class_int>` input_index, :ref:`StringName<class_StringName>` output_node **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **connect_node** **(** :ref:`StringName<class_StringName>` input_node, :ref:`int<class_int>` input_index, :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` input_node, :ref:`int<class_int>` input_index **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **disconnect_node** **(** :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`AnimationNode<class_AnimationNode>` **get_node** **(** :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Vector2<class_Vector2>` **get_node_position** **(** :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **has_node** **(** :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` name **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **remove_node** **(** :ref:`StringName<class_StringName>` name **)**
|
||||
|
||||
Removes a sub-node.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeBlendTree_method_rename_node:
|
||||
|
||||
- void **rename_node** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` new_name **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **rename_node** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` name, :ref:`Vector2<class_Vector2>` position **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_node_position** **(** :ref:`StringName<class_StringName>` name, :ref:`Vector2<class_Vector2>` position **)**
|
||||
|
||||
Modifies the position of a sub-node.
|
||||
|
||||
|
||||
@@ -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,136 +30,167 @@ 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.0`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
||||
| :ref:`float<class_float>` | :ref:`fadeout_time<class_AnimationNodeOneShot_property_fadeout_time>` | ``0.0`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
||||
| :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` | :ref:`mix_mode<class_AnimationNodeOneShot_property_mix_mode>` | ``0`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
||||
.. 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.0`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
||||
| :ref:`float<class_float>` | :ref:`fadeout_time<class_AnimationNodeOneShot_property_fadeout_time>` | ``0.0`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
||||
| :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` | :ref:`mix_mode<class_AnimationNodeOneShot_property_mix_mode>` | ``0`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
||||
|
||||
.. 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.0`` |
|
||||
+-----------+------------------------+
|
||||
| *Setter* | set_fadein_time(value) |
|
||||
+-----------+------------------------+
|
||||
| *Getter* | get_fadein_time() |
|
||||
+-----------+------------------------+
|
||||
:ref:`float<class_float>` **fadein_time** = ``0.0``
|
||||
|
||||
.. 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.0`` |
|
||||
+-----------+-------------------------+
|
||||
| *Setter* | set_fadeout_time(value) |
|
||||
+-----------+-------------------------+
|
||||
| *Getter* | get_fadeout_time() |
|
||||
+-----------+-------------------------+
|
||||
:ref:`float<class_float>` **fadeout_time** = ``0.0``
|
||||
|
||||
.. 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
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AnimationNodeOutput
|
||||
|
||||
Generic output node to be added to :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AnimationNodeStateMachine
|
||||
|
||||
State machine for control of animations.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -36,206 +38,293 @@ Contains multiple nodes representing animation states, connected in a graph. Nod
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`AnimationTree <../tutorials/animation/animation_tree>`
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_node<class_AnimationNodeStateMachine_method_add_node>` **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2(0, 0) **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_transition<class_AnimationNodeStateMachine_method_add_transition>` **(** :ref:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` to, :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` transition **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :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:`StringName<class_StringName>` name **)** |const| |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :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:`StringName<class_StringName>` name **)** |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:`StringName<class_StringName>` | :ref:`get_transition_from<class_AnimationNodeStateMachine_method_get_transition_from>` **(** :ref:`int<class_int>` idx **)** |const| |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :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:`StringName<class_StringName>` name **)** |const| |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_transition<class_AnimationNodeStateMachine_method_has_transition>` **(** :ref:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` to **)** |const| |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_node<class_AnimationNodeStateMachine_method_remove_node>` **(** :ref:`StringName<class_StringName>` name **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_transition<class_AnimationNodeStateMachine_method_remove_transition>` **(** :ref:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` new_name **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`replace_node<class_AnimationNodeStateMachine_method_replace_node>` **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`StringName<class_StringName>` name, :ref:`Vector2<class_Vector2>` position **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_node<class_AnimationNodeStateMachine_method_add_node>` **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2(0, 0) **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_transition<class_AnimationNodeStateMachine_method_add_transition>` **(** :ref:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` to, :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` transition **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :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:`StringName<class_StringName>` name **)** |const| |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :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:`StringName<class_StringName>` name **)** |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:`StringName<class_StringName>` | :ref:`get_transition_from<class_AnimationNodeStateMachine_method_get_transition_from>` **(** :ref:`int<class_int>` idx **)** |const| |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :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:`StringName<class_StringName>` name **)** |const| |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_transition<class_AnimationNodeStateMachine_method_has_transition>` **(** :ref:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` to **)** |const| |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_node<class_AnimationNodeStateMachine_method_remove_node>` **(** :ref:`StringName<class_StringName>` name **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_transition<class_AnimationNodeStateMachine_method_remove_transition>` **(** :ref:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` new_name **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`replace_node<class_AnimationNodeStateMachine_method_replace_node>` **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`StringName<class_StringName>` name, :ref:`Vector2<class_Vector2>` position **)** |
|
||||
+---------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AnimationNodeStateMachine_method_add_node:
|
||||
|
||||
- void **add_node** **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node, :ref:`Vector2<class_Vector2>` position=Vector2(0, 0) **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **add_node** **(** :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` to, :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` transition **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **add_transition** **(** :ref:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` to, :ref:`AnimationNodeStateMachineTransition<class_AnimationNodeStateMachineTransition>` transition **)**
|
||||
|
||||
Adds a transition between the given nodes.
|
||||
|
||||
.. 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:`StringName<class_StringName>` name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`AnimationNode<class_AnimationNode>` **get_node** **(** :ref:`StringName<class_StringName>` name **)** |const|
|
||||
|
||||
Returns the animation node with the given name.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeStateMachine_method_get_node_name:
|
||||
|
||||
- :ref:`StringName<class_StringName>` **get_node_name** **(** :ref:`AnimationNode<class_AnimationNode>` node **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`StringName<class_StringName>` **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:`StringName<class_StringName>` name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Vector2<class_Vector2>` **get_node_position** **(** :ref:`StringName<class_StringName>` name **)** |const|
|
||||
|
||||
Returns the given node's coordinates. Used for display in the editor.
|
||||
|
||||
.. 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:`StringName<class_StringName>` **get_transition_from** **(** :ref:`int<class_int>` idx **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`StringName<class_StringName>` **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:`StringName<class_StringName>` **get_transition_to** **(** :ref:`int<class_int>` idx **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`StringName<class_StringName>` **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:`StringName<class_StringName>` name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **has_node** **(** :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` to **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **has_transition** **(** :ref:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` name **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **remove_node** **(** :ref:`StringName<class_StringName>` name **)**
|
||||
|
||||
Deletes the given node from the graph.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeStateMachine_method_remove_transition:
|
||||
|
||||
- void **remove_transition** **(** :ref:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` to **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **remove_transition** **(** :ref:`StringName<class_StringName>` from, :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` new_name **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **rename_node** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` new_name **)**
|
||||
|
||||
Renames the given node.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeStateMachine_method_replace_node:
|
||||
|
||||
- void **replace_node** **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **replace_node** **(** :ref:`StringName<class_StringName>` name, :ref:`AnimationNode<class_AnimationNode>` node **)**
|
||||
|
||||
.. 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_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:`StringName<class_StringName>` name, :ref:`Vector2<class_Vector2>` position **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_node_position** **(** :ref:`StringName<class_StringName>` name, :ref:`Vector2<class_Vector2>` position **)**
|
||||
|
||||
Sets the node's coordinates. Used for display in the editor.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AnimationNodeStateMachinePlayback
|
||||
|
||||
Playback control for :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -36,103 +38,151 @@ Allows control of :ref:`AnimationTree<class_AnimationTree>` state machines creat
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`AnimationTree <../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:`StringName<class_StringName>` | :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:`PackedStringArray<class_PackedStringArray>` | :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:`StringName<class_StringName>` node **)** |
|
||||
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`stop<class_AnimationNodeStateMachinePlayback_method_stop>` **(** **)** |
|
||||
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`travel<class_AnimationNodeStateMachinePlayback_method_travel>` **(** :ref:`StringName<class_StringName>` to_node **)** |
|
||||
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_current_length<class_AnimationNodeStateMachinePlayback_method_get_current_length>` **(** **)** |const| |
|
||||
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :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:`PackedStringArray<class_PackedStringArray>` | :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:`StringName<class_StringName>` node **)** |
|
||||
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`stop<class_AnimationNodeStateMachinePlayback_method_stop>` **(** **)** |
|
||||
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`travel<class_AnimationNodeStateMachinePlayback_method_travel>` **(** :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` **get_current_node** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`StringName<class_StringName>` **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:`PackedStringArray<class_PackedStringArray>` **get_travel_path** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedStringArray<class_PackedStringArray>` **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:`StringName<class_StringName>` node **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **start** **(** :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` to_node **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **travel** **(** :ref:`StringName<class_StringName>` to_node **)**
|
||||
|
||||
Transitions from the current state to another one, following the shortest path.
|
||||
|
||||
|
||||
@@ -16,74 +16,114 @@ AnimationNodeStateMachineTransition
|
||||
|
||||
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:`AnimationTree <../tutorials/animation/animation_tree>`
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` | ``&""`` |
|
||||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||||
| :ref:`String<class_String>` | :ref:`advance_expression<class_AnimationNodeStateMachineTransition_property_advance_expression>` | ``""`` |
|
||||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||||
| :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:`Curve<class_Curve>` | :ref:`xfade_curve<class_AnimationNodeStateMachineTransition_property_xfade_curve>` | |
|
||||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||||
| :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeStateMachineTransition_property_xfade_time>` | ``0.0`` |
|
||||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` | ``&""`` |
|
||||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||||
| :ref:`String<class_String>` | :ref:`advance_expression<class_AnimationNodeStateMachineTransition_property_advance_expression>` | ``""`` |
|
||||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||||
| :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:`Curve<class_Curve>` | :ref:`xfade_curve<class_AnimationNodeStateMachineTransition_property_xfade_curve>` | |
|
||||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||||
| :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:`StringName<class_StringName>` **advance_condition**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------------------+
|
||||
| *Default* | ``&""`` |
|
||||
+-----------+------------------------------+
|
||||
| *Setter* | set_advance_condition(value) |
|
||||
+-----------+------------------------------+
|
||||
| *Getter* | get_advance_condition() |
|
||||
+-----------+------------------------------+
|
||||
:ref:`StringName<class_StringName>` **advance_condition** = ``&""``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_advance_condition** **(** :ref:`StringName<class_StringName>` value **)**
|
||||
- :ref:`StringName<class_StringName>` **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"``:
|
||||
|
||||
@@ -100,113 +140,122 @@ Turn on auto advance when this condition is set. The provided name will become a
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeStateMachineTransition_property_advance_expression:
|
||||
|
||||
- :ref:`String<class_String>` **advance_expression**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-------------------------------+
|
||||
| *Default* | ``""`` |
|
||||
+-----------+-------------------------------+
|
||||
| *Setter* | set_advance_expression(value) |
|
||||
+-----------+-------------------------------+
|
||||
| *Getter* | get_advance_expression() |
|
||||
+-----------+-------------------------------+
|
||||
:ref:`String<class_String>` **advance_expression** = ``""``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_advance_expression** **(** :ref:`String<class_String>` value **)**
|
||||
- :ref:`String<class_String>` **get_advance_expression** **(** **)**
|
||||
|
||||
Use an expression as a condition for state machine transitions. It is possible to create complex animation advance conditions for switching between states and gives much greater flexibility for creating complex state machines by directly interfacing with the script code.
|
||||
|
||||
.. 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_curve:
|
||||
|
||||
- :ref:`Curve<class_Curve>` **xfade_curve**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+----------+------------------------+
|
||||
| *Setter* | set_xfade_curve(value) |
|
||||
+----------+------------------------+
|
||||
| *Getter* | get_xfade_curve() |
|
||||
+----------+------------------------+
|
||||
:ref:`Curve<class_Curve>` **xfade_curve**
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_xfade_curve** **(** :ref:`Curve<class_Curve>` value **)**
|
||||
- :ref:`Curve<class_Curve>` **get_xfade_curve** **(** **)**
|
||||
|
||||
Ease curve for better control over cross-fade between this state and the next.
|
||||
|
||||
.. 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.
|
||||
|
||||
|
||||
@@ -18,27 +18,37 @@ AnimationNodeSync
|
||||
|
||||
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:`bool<class_bool>` | :ref:`sync<class_AnimationNodeSync_property_sync>` | ``false`` |
|
||||
+-------------------------+----------------------------------------------------+-----------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+----------------------------------------------------+-----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`sync<class_AnimationNodeSync_property_sync>` | ``false`` |
|
||||
+-------------------------+----------------------------------------------------+-----------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AnimationNodeSync_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 ``false``, the blended animations' frame are stopped when the blend value is ``0``.
|
||||
|
||||
|
||||
@@ -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
|
||||
---------
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AnimationNodeTimeSeek
|
||||
|
||||
A time-seeking animation node to be used with :ref:`AnimationTree<class_AnimationTree>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -44,6 +46,8 @@ This node can be used to cause a seek command to happen to any sub-children of t
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -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,133 +32,173 @@ Tutorials
|
||||
|
||||
- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+---------------------------+------------------------------------------------------------------------------+----------+
|
||||
| :ref:`int<class_int>` | :ref:`enabled_inputs<class_AnimationNodeTransition_property_enabled_inputs>` | ``0`` |
|
||||
+---------------------------+------------------------------------------------------------------------------+----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`from_start<class_AnimationNodeTransition_property_from_start>` | ``true`` |
|
||||
+---------------------------+------------------------------------------------------------------------------+----------+
|
||||
| :ref:`Curve<class_Curve>` | :ref:`xfade_curve<class_AnimationNodeTransition_property_xfade_curve>` | |
|
||||
+---------------------------+------------------------------------------------------------------------------+----------+
|
||||
| :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeTransition_property_xfade_time>` | ``0.0`` |
|
||||
+---------------------------+------------------------------------------------------------------------------+----------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------+------------------------------------------------------------------------------+----------+
|
||||
| :ref:`int<class_int>` | :ref:`enabled_inputs<class_AnimationNodeTransition_property_enabled_inputs>` | ``0`` |
|
||||
+---------------------------+------------------------------------------------------------------------------+----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`from_start<class_AnimationNodeTransition_property_from_start>` | ``true`` |
|
||||
+---------------------------+------------------------------------------------------------------------------+----------+
|
||||
| :ref:`Curve<class_Curve>` | :ref:`xfade_curve<class_AnimationNodeTransition_property_xfade_curve>` | |
|
||||
+---------------------------+------------------------------------------------------------------------------+----------+
|
||||
| :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_enabled_inputs:
|
||||
|
||||
- :ref:`int<class_int>` **enabled_inputs**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+---------------------------+
|
||||
| *Setter* | set_enabled_inputs(value) |
|
||||
+-----------+---------------------------+
|
||||
| *Getter* | get_enabled_inputs() |
|
||||
+-----------+---------------------------+
|
||||
:ref:`int<class_int>` **enabled_inputs** = ``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 enabled input ports for this node.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeTransition_property_from_start:
|
||||
|
||||
- :ref:`bool<class_bool>` **from_start**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-----------------------+
|
||||
| *Default* | ``true`` |
|
||||
+-----------+-----------------------+
|
||||
| *Setter* | set_from_start(value) |
|
||||
+-----------+-----------------------+
|
||||
| *Getter* | is_from_start() |
|
||||
+-----------+-----------------------+
|
||||
:ref:`bool<class_bool>` **from_start** = ``true``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_from_start** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **is_from_start** **(** **)**
|
||||
|
||||
If ``true``, the destination animation is played back from the beginning when switched.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationNodeTransition_property_xfade_curve:
|
||||
|
||||
- :ref:`Curve<class_Curve>` **xfade_curve**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+----------+------------------------+
|
||||
| *Setter* | set_xfade_curve(value) |
|
||||
+----------+------------------------+
|
||||
| *Getter* | get_xfade_curve() |
|
||||
+----------+------------------------+
|
||||
:ref:`Curve<class_Curve>` **xfade_curve**
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_xfade_curve** **(** :ref:`Curve<class_Curve>` value **)**
|
||||
- :ref:`Curve<class_Curve>` **get_xfade_curve** **(** **)**
|
||||
|
||||
.. 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_AnimationNodeTransition_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** **(** **)**
|
||||
|
||||
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
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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,181 +32,340 @@ 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:`advance_expression_base_node<class_AnimationTree_property_advance_expression_base_node>` | ``NodePath(".")`` |
|
||||
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`NodePath<class_NodePath>` | :ref:`anim_player<class_AnimationTree_property_anim_player>` | ``NodePath("")`` |
|
||||
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` | :ref:`process_callback<class_AnimationTree_property_process_callback>` | ``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:`advance_expression_base_node<class_AnimationTree_property_advance_expression_base_node>` | ``NodePath(".")`` |
|
||||
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`NodePath<class_NodePath>` | :ref:`anim_player<class_AnimationTree_property_anim_player>` | ``NodePath("")`` |
|
||||
+------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` | :ref:`process_callback<class_AnimationTree_property_process_callback>` | ``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:`Transform3D<class_Transform3D>` | :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:`Vector3<class_Vector3>` | :ref:`get_root_motion_position<class_AnimationTree_method_get_root_motion_position>` **(** **)** |const| |
|
||||
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Quaternion<class_Quaternion>` | :ref:`get_root_motion_rotation<class_AnimationTree_method_get_root_motion_rotation>` **(** **)** |const| |
|
||||
+-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_root_motion_scale<class_AnimationTree_method_get_root_motion_scale>` **(** **)** |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
|
||||
|
||||
Signals
|
||||
-------
|
||||
|
||||
.. _class_AnimationTree_signal_animation_player_changed:
|
||||
|
||||
- **animation_player_changed** **(** **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**animation_player_changed** **(** **)**
|
||||
|
||||
Emitted when the :ref:`anim_player<class_AnimationTree_property_anim_player>` is changed.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Enumerations
|
||||
------------
|
||||
|
||||
.. _enum_AnimationTree_AnimationProcessCallback:
|
||||
|
||||
.. _class_AnimationTree_constant_ANIMATION_PROCESS_PHYSICS:
|
||||
|
||||
.. _class_AnimationTree_constant_ANIMATION_PROCESS_IDLE:
|
||||
|
||||
.. _class_AnimationTree_constant_ANIMATION_PROCESS_MANUAL:
|
||||
.. rst-class:: classref-enumeration
|
||||
|
||||
enum **AnimationProcessCallback**:
|
||||
|
||||
- **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:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` **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:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` **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:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` **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_advance_expression_base_node:
|
||||
|
||||
- :ref:`NodePath<class_NodePath>` **advance_expression_base_node**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-----------------------------------------+
|
||||
| *Default* | ``NodePath(".")`` |
|
||||
+-----------+-----------------------------------------+
|
||||
| *Setter* | set_advance_expression_base_node(value) |
|
||||
+-----------+-----------------------------------------+
|
||||
| *Getter* | get_advance_expression_base_node() |
|
||||
+-----------+-----------------------------------------+
|
||||
:ref:`NodePath<class_NodePath>` **advance_expression_base_node** = ``NodePath(".")``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_advance_expression_base_node** **(** :ref:`NodePath<class_NodePath>` value **)**
|
||||
- :ref:`NodePath<class_NodePath>` **get_advance_expression_base_node** **(** **)**
|
||||
|
||||
The path to the :ref:`Node<class_Node>` used to evaluate the AnimationNode :ref:`Expression<class_Expression>` if one is not explicitly specified internally.
|
||||
|
||||
.. 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_callback:
|
||||
|
||||
- :ref:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` **process_callback**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-----------------------------+
|
||||
| *Default* | ``1`` |
|
||||
+-----------+-----------------------------+
|
||||
| *Setter* | set_process_callback(value) |
|
||||
+-----------+-----------------------------+
|
||||
| *Getter* | get_process_callback() |
|
||||
+-----------+-----------------------------+
|
||||
:ref:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` **process_callback** = ``1``
|
||||
|
||||
The process mode of this ``AnimationTree``. See :ref:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` for available modes.
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_process_callback** **(** :ref:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` value **)**
|
||||
- :ref:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` **get_process_callback** **(** **)**
|
||||
|
||||
The process mode of this **AnimationTree**. See :ref:`AnimationProcessCallback<enum_AnimationTree_AnimationProcessCallback>` 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_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`Animation.TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>` or :ref:`Animation.TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` 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>`.
|
||||
If the track has type :ref:`Animation.TYPE_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`Animation.TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>` or :ref:`Animation.TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` the transformation will be cancelled visually, and the animation will appear to stay in place. See also :ref:`get_root_motion_position<class_AnimationTree_method_get_root_motion_position>`, :ref:`get_root_motion_rotation<class_AnimationTree_method_get_root_motion_rotation>`, :ref:`get_root_motion_scale<class_AnimationTree_method_get_root_motion_scale>` 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:
|
||||
.. _class_AnimationTree_method_get_root_motion_position:
|
||||
|
||||
- :ref:`Transform3D<class_Transform3D>` **get_root_motion_transform** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Retrieve the motion of the :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` as a :ref:`Transform3D<class_Transform3D>` 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_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`Animation.TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` or :ref:`Animation.TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>`, returns an identity transformation. See also :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` and :ref:`RootMotionView<class_RootMotionView>`.
|
||||
:ref:`Vector3<class_Vector3>` **get_root_motion_position** **(** **)** |const|
|
||||
|
||||
Retrieve the motion of position with the :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` as a :ref:`Vector3<class_Vector3>` 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_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, returns ``Vector3(0, 0, 0)``.
|
||||
|
||||
See also :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` and :ref:`RootMotionView<class_RootMotionView>`.
|
||||
|
||||
The most basic example is applying position to :ref:`CharacterBody3D<class_CharacterBody3D>`:
|
||||
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var current_rotation: Quaternion
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("animate"):
|
||||
current_rotation = get_quaternion()
|
||||
state_machine.travel("Animate")
|
||||
var velocity: Vector3 = current_rotation * animation_tree.get_root_motion_position() / delta
|
||||
set_velocity(velocity)
|
||||
move_and_slide()
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationTree_method_get_root_motion_rotation:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Quaternion<class_Quaternion>` **get_root_motion_rotation** **(** **)** |const|
|
||||
|
||||
Retrieve the motion of rotation with the :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` as a :ref:`Quaternion<class_Quaternion>` 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_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>`, returns ``Quaternion(0, 0, 0, 1)``.
|
||||
|
||||
See also :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` and :ref:`RootMotionView<class_RootMotionView>`.
|
||||
|
||||
The most basic example is applying rotation to :ref:`CharacterBody3D<class_CharacterBody3D>`:
|
||||
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. code-tab:: gdscript
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("animate"):
|
||||
state_machine.travel("Animate")
|
||||
set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation())
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AnimationTree_method_get_root_motion_scale:
|
||||
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Vector3<class_Vector3>` **get_root_motion_scale** **(** **)** |const|
|
||||
|
||||
Retrieve the motion of scale with the :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` as a :ref:`Vector3<class_Vector3>` 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_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>`, returns ``Vector3(0, 0, 0)``.
|
||||
|
||||
See also :ref:`root_motion_track<class_AnimationTree_property_root_motion_track>` and :ref:`RootMotionView<class_RootMotionView>`.
|
||||
|
||||
The most basic example is applying scale to :ref:`CharacterBody3D<class_CharacterBody3D>`:
|
||||
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. code-tab:: gdscript
|
||||
|
||||
var current_scale: Vector3 = Vector3(1, 1, 1)
|
||||
var scale_accum: Vector3 = Vector3(1, 1, 1)
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_just_pressed("animate"):
|
||||
current_scale = get_scale()
|
||||
scale_accum = Vector3(1, 1, 1)
|
||||
state_machine.travel("Animate")
|
||||
scale_accum += animation_tree.get_root_motion_scale()
|
||||
set_scale(current_scale * scale_accum)
|
||||
|
||||
|
||||
|
||||
.. 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
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ Area2D
|
||||
|
||||
2D area for detection and physics and audio influence.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -23,6 +25,8 @@ To give the area its shape, add a :ref:`CollisionShape2D<class_CollisionShape2D>
|
||||
|
||||
\ **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
|
||||
---------
|
||||
|
||||
@@ -34,84 +38,110 @@ 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:`SpaceOverride<enum_Area2D_SpaceOverride>` | :ref:`angular_damp_space_override<class_Area2D_property_angular_damp_space_override>` | ``0`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`StringName<class_StringName>` | :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>` | ``980.0`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`gravity_direction<class_Area2D_property_gravity_direction>` | ``Vector2(0, 1)`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`gravity_point<class_Area2D_property_gravity_point>` | ``false`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`gravity_point_center<class_Area2D_property_gravity_point_center>` | ``Vector2(0, 1)`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`float<class_float>` | :ref:`gravity_point_distance_scale<class_Area2D_property_gravity_point_distance_scale>` | ``0.0`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` | :ref:`gravity_space_override<class_Area2D_property_gravity_space_override>` | ``0`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`float<class_float>` | :ref:`linear_damp<class_Area2D_property_linear_damp>` | ``0.1`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` | :ref:`linear_damp_space_override<class_Area2D_property_linear_damp_space_override>` | ``0`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :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`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`float<class_float>` | :ref:`angular_damp<class_Area2D_property_angular_damp>` | ``1.0`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` | :ref:`angular_damp_space_override<class_Area2D_property_angular_damp_space_override>` | ``0`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`StringName<class_StringName>` | :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>` | ``980.0`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`gravity_direction<class_Area2D_property_gravity_direction>` | ``Vector2(0, 1)`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`gravity_point<class_Area2D_property_gravity_point>` | ``false`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`gravity_point_center<class_Area2D_property_gravity_point_center>` | ``Vector2(0, 1)`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`float<class_float>` | :ref:`gravity_point_distance_scale<class_Area2D_property_gravity_point_distance_scale>` | ``0.0`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` | :ref:`gravity_space_override<class_Area2D_property_gravity_space_override>` | ``0`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`float<class_float>` | :ref:`linear_damp<class_Area2D_property_linear_damp>` | ``0.1`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` | :ref:`linear_damp_space_override<class_Area2D_property_linear_damp_space_override>` | ``0`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
| :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`` |
|
||||
+-------------------------------------------------+-----------------------------------------------------------------------------------------+-------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Area2D[]<class_Area2D>` | :ref:`get_overlapping_areas<class_Area2D_method_get_overlapping_areas>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Node2D[]<class_Node2D>` | :ref:`get_overlapping_bodies<class_Area2D_method_get_overlapping_bodies>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_overlapping_areas<class_Area2D_method_has_overlapping_areas>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_overlapping_bodies<class_Area2D_method_has_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:`Area2D[]<class_Area2D>` | :ref:`get_overlapping_areas<class_Area2D_method_get_overlapping_areas>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Node2D[]<class_Node2D>` | :ref:`get_overlapping_bodies<class_Area2D_method_get_overlapping_bodies>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_overlapping_areas<class_Area2D_method_has_overlapping_areas>` **(** **)** |const| |
|
||||
+-------------------------------+----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_overlapping_bodies<class_Area2D_method_has_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``.
|
||||
|
||||
@@ -123,11 +153,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:`PhysicsServer2D<class_PhysicsServer2D>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(self.shape_find_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``.
|
||||
|
||||
@@ -139,31 +173,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:`PhysicsServer2D<class_PhysicsServer2D>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Area2D_signal_body_entered:
|
||||
|
||||
- **body_entered** **(** :ref:`Node2D<class_Node2D>` body **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**body_entered** **(** :ref:`Node2D<class_Node2D>` 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:`Node2D<class_Node2D>` body **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
**body_exited** **(** :ref:`Node2D<class_Node2D>` 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:`Node2D<class_Node2D>` 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:`Node2D<class_Node2D>` 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.
|
||||
|
||||
@@ -175,11 +221,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:`PhysicsServer2D<class_PhysicsServer2D>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(self.shape_find_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:`Node2D<class_Node2D>` 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:`Node2D<class_Node2D>` 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.
|
||||
|
||||
@@ -191,336 +241,411 @@ 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:`PhysicsServer2D<class_PhysicsServer2D>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(self.shape_find_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_angular_damp_space_override:
|
||||
|
||||
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **angular_damp_space_override**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+---------------------------------------------+
|
||||
| *Setter* | set_angular_damp_space_override_mode(value) |
|
||||
+-----------+---------------------------------------------+
|
||||
| *Getter* | get_angular_damp_space_override_mode() |
|
||||
+-----------+---------------------------------------------+
|
||||
:ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **angular_damp_space_override** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_angular_damp_space_override_mode** **(** :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` value **)**
|
||||
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **get_angular_damp_space_override_mode** **(** **)**
|
||||
|
||||
Override mode for angular damping calculations within this area. See :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` for possible values.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Area2D_property_audio_bus_name:
|
||||
|
||||
- :ref:`StringName<class_StringName>` **audio_bus_name**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------------+
|
||||
| *Default* | ``&"Master"`` |
|
||||
+-----------+---------------------------+
|
||||
| *Setter* | set_audio_bus_name(value) |
|
||||
+-----------+---------------------------+
|
||||
| *Getter* | get_audio_bus_name() |
|
||||
+-----------+---------------------------+
|
||||
:ref:`StringName<class_StringName>` **audio_bus_name** = ``&"Master"``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_audio_bus_name** **(** :ref:`StringName<class_StringName>` value **)**
|
||||
- :ref:`StringName<class_StringName>` **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* | ``980.0`` |
|
||||
+-----------+--------------------+
|
||||
| *Setter* | set_gravity(value) |
|
||||
+-----------+--------------------+
|
||||
| *Getter* | get_gravity() |
|
||||
+-----------+--------------------+
|
||||
:ref:`float<class_float>` **gravity** = ``980.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 direction. This is useful to alter the force of gravity without altering its direction.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Area2D_property_gravity_direction:
|
||||
|
||||
- :ref:`Vector2<class_Vector2>` **gravity_direction**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------------------+
|
||||
| *Default* | ``Vector2(0, 1)`` |
|
||||
+-----------+------------------------------+
|
||||
| *Setter* | set_gravity_direction(value) |
|
||||
+-----------+------------------------------+
|
||||
| *Getter* | get_gravity_direction() |
|
||||
+-----------+------------------------------+
|
||||
:ref:`Vector2<class_Vector2>` **gravity_direction** = ``Vector2(0, 1)``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_gravity_direction** **(** :ref:`Vector2<class_Vector2>` value **)**
|
||||
- :ref:`Vector2<class_Vector2>` **get_gravity_direction** **(** **)**
|
||||
|
||||
The area's gravity vector (not normalized).
|
||||
|
||||
.. 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_point_center<class_Area2D_property_gravity_point_center>`). See also :ref:`gravity_space_override<class_Area2D_property_gravity_space_override>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Area2D_property_gravity_point_center:
|
||||
|
||||
- :ref:`Vector2<class_Vector2>` **gravity_point_center**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------------------+
|
||||
| *Default* | ``Vector2(0, 1)`` |
|
||||
+-----------+---------------------------------+
|
||||
| *Setter* | set_gravity_point_center(value) |
|
||||
+-----------+---------------------------------+
|
||||
| *Getter* | get_gravity_point_center() |
|
||||
+-----------+---------------------------------+
|
||||
:ref:`Vector2<class_Vector2>` **gravity_point_center** = ``Vector2(0, 1)``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_gravity_point_center** **(** :ref:`Vector2<class_Vector2>` value **)**
|
||||
- :ref:`Vector2<class_Vector2>` **get_gravity_point_center** **(** **)**
|
||||
|
||||
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_gravity_point_distance_scale:
|
||||
|
||||
- :ref:`float<class_float>` **gravity_point_distance_scale**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-----------------------------------------+
|
||||
| *Default* | ``0.0`` |
|
||||
+-----------+-----------------------------------------+
|
||||
| *Setter* | set_gravity_point_distance_scale(value) |
|
||||
+-----------+-----------------------------------------+
|
||||
| *Getter* | get_gravity_point_distance_scale() |
|
||||
+-----------+-----------------------------------------+
|
||||
:ref:`float<class_float>` **gravity_point_distance_scale** = ``0.0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_gravity_point_distance_scale** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_gravity_point_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_space_override:
|
||||
|
||||
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **gravity_space_override**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+----------------------------------------+
|
||||
| *Setter* | set_gravity_space_override_mode(value) |
|
||||
+-----------+----------------------------------------+
|
||||
| *Getter* | get_gravity_space_override_mode() |
|
||||
+-----------+----------------------------------------+
|
||||
:ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **gravity_space_override** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_gravity_space_override_mode** **(** :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` value **)**
|
||||
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **get_gravity_space_override_mode** **(** **)**
|
||||
|
||||
Override mode for gravity calculations within this area. See :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` for possible values.
|
||||
|
||||
.. 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_linear_damp_space_override:
|
||||
|
||||
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **linear_damp_space_override**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+--------------------------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+--------------------------------------------+
|
||||
| *Setter* | set_linear_damp_space_override_mode(value) |
|
||||
+-----------+--------------------------------------------+
|
||||
| *Getter* | get_linear_damp_space_override_mode() |
|
||||
+-----------+--------------------------------------------+
|
||||
:ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **linear_damp_space_override** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_linear_damp_space_override_mode** **(** :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` value **)**
|
||||
- :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` **get_linear_damp_space_override_mode** **(** **)**
|
||||
|
||||
Override mode for linear damping calculations within this area. See :ref:`SpaceOverride<enum_Area2D_SpaceOverride>` for possible values.
|
||||
|
||||
.. 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-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_Area2D_method_get_overlapping_areas:
|
||||
|
||||
- :ref:`Area2D[]<class_Area2D>` **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:`Area2D[]<class_Area2D>` **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:`Node2D[]<class_Node2D>` **get_overlapping_bodies** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Node2D[]<class_Node2D>` **get_overlapping_bodies** **(** **)** |const|
|
||||
|
||||
Returns a list of intersecting :ref:`PhysicsBody2D<class_PhysicsBody2D>`\ s and :ref:`TileMap<class_TileMap>`\ 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_has_overlapping_areas:
|
||||
|
||||
- :ref:`bool<class_bool>` **has_overlapping_areas** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns ``true`` if intersecting any ``Area2D``\ s, otherwise returns ``false``. 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:`bool<class_bool>` **has_overlapping_areas** **(** **)** |const|
|
||||
|
||||
Returns ``true`` if intersecting any **Area2D**\ s, otherwise returns ``false``. 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) the list of overlapping areas 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_has_overlapping_bodies:
|
||||
|
||||
- :ref:`bool<class_bool>` **has_overlapping_bodies** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **has_overlapping_bodies** **(** **)** |const|
|
||||
|
||||
Returns ``true`` if intersecting any :ref:`PhysicsBody2D<class_PhysicsBody2D>`\ s or :ref:`TileMap<class_TileMap>`\ s, otherwise returns ``false``. 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) the list of overlapping bodies 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
|
||||
|
||||
Returns ``true`` if the given ``Area2D`` intersects or overlaps this ``Area2D``, ``false`` otherwise.
|
||||
:ref:`bool<class_bool>` **overlaps_area** **(** :ref:`Node<class_Node>` area **)** |const|
|
||||
|
||||
Returns ``true`` if the given **Area2D** intersects or overlaps this **Area2D**, ``false`` otherwise.
|
||||
|
||||
\ **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
|
||||
|
||||
Returns ``true`` if the given physics body intersects or overlaps this ``Area2D``, ``false`` otherwise.
|
||||
:ref:`bool<class_bool>` **overlaps_body** **(** :ref:`Node<class_Node>` body **)** |const|
|
||||
|
||||
Returns ``true`` if the given physics body intersects or overlaps this **Area2D**, ``false`` otherwise.
|
||||
|
||||
\ **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.
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -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:
|
||||
|
||||
@@ -70,128 +72,161 @@ See also :ref:`ImmediateMesh<class_ImmediateMesh>`, :ref:`MeshDataTool<class_Mes
|
||||
|
||||
\ **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:`Procedural geometry using the ArrayMesh <../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)`` |
|
||||
+-------------------------------------------------+--------------------------------------------------------------------+----------------------------+
|
||||
| :ref:`ArrayMesh<class_ArrayMesh>` | :ref:`shadow_mesh<class_ArrayMesh_property_shadow_mesh>` | |
|
||||
+-------------------------------------------------+--------------------------------------------------------------------+----------------------------+
|
||||
.. 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)`` |
|
||||
+-------------------------------------------------+--------------------------------------------------------------------+----------------------------+
|
||||
| :ref:`ArrayMesh<class_ArrayMesh>` | :ref:`shadow_mesh<class_ArrayMesh_property_shadow_mesh>` | |
|
||||
+-------------------------------------------------+--------------------------------------------------------------------+----------------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_blend_shape<class_ArrayMesh_method_add_blend_shape>` **(** :ref:`StringName<class_StringName>` 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:`Dictionary<class_Dictionary>` lods={}, :ref:`int<class_int>` compress_flags=0 **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`StringName<class_StringName>` | :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:`Transform3D<class_Transform3D>` transform, :ref:`float<class_float>` texel_size **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`regen_normal_maps<class_ArrayMesh_method_regen_normal_maps>` **(** **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_blend_shape_name<class_ArrayMesh_method_set_blend_shape_name>` **(** :ref:`int<class_int>` index, :ref:`StringName<class_StringName>` 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_set_name<class_ArrayMesh_method_surface_set_name>` **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_String>` name **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`surface_update_attribute_region<class_ArrayMesh_method_surface_update_attribute_region>` **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` data **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`surface_update_skin_region<class_ArrayMesh_method_surface_update_skin_region>` **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` data **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`surface_update_vertex_region<class_ArrayMesh_method_surface_update_vertex_region>` **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` data **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_blend_shape<class_ArrayMesh_method_add_blend_shape>` **(** :ref:`StringName<class_StringName>` 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:`Dictionary<class_Dictionary>` lods={}, :ref:`int<class_int>` compress_flags=0 **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`StringName<class_StringName>` | :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:`Transform3D<class_Transform3D>` transform, :ref:`float<class_float>` texel_size **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`regen_normal_maps<class_ArrayMesh_method_regen_normal_maps>` **(** **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_blend_shape_name<class_ArrayMesh_method_set_blend_shape_name>` **(** :ref:`int<class_int>` index, :ref:`StringName<class_StringName>` 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_set_name<class_ArrayMesh_method_surface_set_name>` **(** :ref:`int<class_int>` surf_idx, :ref:`String<class_String>` name **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`surface_update_attribute_region<class_ArrayMesh_method_surface_update_attribute_region>` **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` data **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`surface_update_skin_region<class_ArrayMesh_method_surface_update_skin_region>` **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` data **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`surface_update_vertex_region<class_ArrayMesh_method_surface_update_vertex_region>` **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` data **)** |
|
||||
+-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. 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-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_ArrayMesh_property_shadow_mesh:
|
||||
|
||||
- :ref:`ArrayMesh<class_ArrayMesh>` **shadow_mesh**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+----------+------------------------+
|
||||
| *Setter* | set_shadow_mesh(value) |
|
||||
+----------+------------------------+
|
||||
| *Getter* | get_shadow_mesh() |
|
||||
+----------+------------------------+
|
||||
:ref:`ArrayMesh<class_ArrayMesh>` **shadow_mesh**
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_shadow_mesh** **(** :ref:`ArrayMesh<class_ArrayMesh>` value **)**
|
||||
- :ref:`ArrayMesh<class_ArrayMesh>` **get_shadow_mesh** **(** **)**
|
||||
|
||||
.. 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_ArrayMesh_method_add_blend_shape:
|
||||
|
||||
- void **add_blend_shape** **(** :ref:`StringName<class_StringName>` name **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **add_blend_shape** **(** :ref:`StringName<class_StringName>` 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:`Dictionary<class_Dictionary>` lods={}, :ref:`int<class_int>` compress_flags=0 **)**
|
||||
.. 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:`Dictionary<class_Dictionary>` lods={}, :ref:`int<class_int>` compress_flags=0 **)**
|
||||
|
||||
Creates a new surface.
|
||||
|
||||
@@ -199,143 +234,211 @@ 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_Mesh_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 an exact multiple of the vertex array's length, when multiple elements of a sub-array correspond to a single vertex) or be empty, except for :ref:`Mesh.ARRAY_INDEX<class_Mesh_constant_ARRAY_INDEX>` if it is used.
|
||||
|
||||
.. 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:`StringName<class_StringName>` **get_blend_shape_name** **(** :ref:`int<class_int>` index **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`StringName<class_StringName>` **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:`Transform3D<class_Transform3D>` 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:`Transform3D<class_Transform3D>` 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_normal_maps:
|
||||
|
||||
- void **regen_normal_maps** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Will regenerate normal maps for the ``ArrayMesh``.
|
||||
void **regen_normal_maps** **(** **)**
|
||||
|
||||
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:`StringName<class_StringName>` name **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_blend_shape_name** **(** :ref:`int<class_int>` index, :ref:`StringName<class_StringName>` name **)**
|
||||
|
||||
Sets the name of the blend shape at this index.
|
||||
|
||||
.. 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_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_attribute_region:
|
||||
|
||||
- void **surface_update_attribute_region** **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` data **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **surface_update_attribute_region** **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` 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_ArrayMesh_method_surface_update_skin_region:
|
||||
|
||||
- void **surface_update_skin_region** **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` data **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **surface_update_skin_region** **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` 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_ArrayMesh_method_surface_update_vertex_region:
|
||||
|
||||
- void **surface_update_vertex_region** **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` data **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **surface_update_vertex_region** **(** :ref:`int<class_int>` surf_idx, :ref:`int<class_int>` offset, :ref:`PackedByteArray<class_PackedByteArray>` data **)**
|
||||
|
||||
.. container:: contribute
|
||||
|
||||
|
||||
@@ -14,72 +14,98 @@ ArrayOccluder3D
|
||||
|
||||
3D polygon shape for use with occlusion culling in :ref:`OccluderInstance3D<class_OccluderInstance3D>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
``ArrayOccluder3D`` stores an arbitrary 3D polygon shape that can be used by the engine's occlusion culling system. This is analogous to :ref:`ArrayMesh<class_ArrayMesh>`, but for occluders.
|
||||
**ArrayOccluder3D** stores an arbitrary 3D polygon shape that can be used by the engine's occlusion culling system. This is analogous to :ref:`ArrayMesh<class_ArrayMesh>`, but for occluders.
|
||||
|
||||
See :ref:`OccluderInstance3D<class_OccluderInstance3D>`'s documentation for instructions on setting up occlusion culling.
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-----------------------------------------------------+----------------------------------------------------------+--------------------------+
|
||||
| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`indices<class_ArrayOccluder3D_property_indices>` | ``PackedInt32Array()`` |
|
||||
+-----------------------------------------------------+----------------------------------------------------------+--------------------------+
|
||||
| :ref:`PackedVector3Array<class_PackedVector3Array>` | :ref:`vertices<class_ArrayOccluder3D_property_vertices>` | ``PackedVector3Array()`` |
|
||||
+-----------------------------------------------------+----------------------------------------------------------+--------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------------------------------+----------------------------------------------------------+--------------------------+
|
||||
| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`indices<class_ArrayOccluder3D_property_indices>` | ``PackedInt32Array()`` |
|
||||
+-----------------------------------------------------+----------------------------------------------------------+--------------------------+
|
||||
| :ref:`PackedVector3Array<class_PackedVector3Array>` | :ref:`vertices<class_ArrayOccluder3D_property_vertices>` | ``PackedVector3Array()`` |
|
||||
+-----------------------------------------------------+----------------------------------------------------------+--------------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_arrays<class_ArrayOccluder3D_method_set_arrays>` **(** :ref:`PackedVector3Array<class_PackedVector3Array>` vertices, :ref:`PackedInt32Array<class_PackedInt32Array>` indices **)** |
|
||||
+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_arrays<class_ArrayOccluder3D_method_set_arrays>` **(** :ref:`PackedVector3Array<class_PackedVector3Array>` vertices, :ref:`PackedInt32Array<class_PackedInt32Array>` indices **)** |
|
||||
+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_ArrayOccluder3D_property_indices:
|
||||
|
||||
- :ref:`PackedInt32Array<class_PackedInt32Array>` **indices**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------------+
|
||||
| *Default* | ``PackedInt32Array()`` |
|
||||
+-----------+------------------------+
|
||||
| *Setter* | set_indices(value) |
|
||||
+-----------+------------------------+
|
||||
| *Getter* | get_indices() |
|
||||
+-----------+------------------------+
|
||||
:ref:`PackedInt32Array<class_PackedInt32Array>` **indices** = ``PackedInt32Array()``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_indices** **(** :ref:`PackedInt32Array<class_PackedInt32Array>` value **)**
|
||||
- :ref:`PackedInt32Array<class_PackedInt32Array>` **get_indices** **(** **)**
|
||||
|
||||
.. 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_ArrayOccluder3D_property_vertices:
|
||||
|
||||
- :ref:`PackedVector3Array<class_PackedVector3Array>` **vertices**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+--------------------------+
|
||||
| *Default* | ``PackedVector3Array()`` |
|
||||
+-----------+--------------------------+
|
||||
| *Setter* | set_vertices(value) |
|
||||
+-----------+--------------------------+
|
||||
| *Getter* | get_vertices() |
|
||||
+-----------+--------------------------+
|
||||
:ref:`PackedVector3Array<class_PackedVector3Array>` **vertices** = ``PackedVector3Array()``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_vertices** **(** :ref:`PackedVector3Array<class_PackedVector3Array>` value **)**
|
||||
- :ref:`PackedVector3Array<class_PackedVector3Array>` **get_vertices** **(** **)**
|
||||
|
||||
.. 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_ArrayOccluder3D_method_set_arrays:
|
||||
|
||||
- void **set_arrays** **(** :ref:`PackedVector3Array<class_PackedVector3Array>` vertices, :ref:`PackedInt32Array<class_PackedInt32Array>` indices **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_arrays** **(** :ref:`PackedVector3Array<class_PackedVector3Array>` vertices, :ref:`PackedInt32Array<class_PackedInt32Array>` indices **)**
|
||||
|
||||
.. container:: contribute
|
||||
|
||||
|
||||
@@ -14,134 +14,191 @@ 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:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` | :ref:`alignment_horizontal<class_AspectRatioContainer_property_alignment_horizontal>` | ``1`` |
|
||||
+---------------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
|
||||
| :ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` | :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:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` | :ref:`alignment_horizontal<class_AspectRatioContainer_property_alignment_horizontal>` | ``1`` |
|
||||
+---------------------------------------------------------------+---------------------------------------------------------------------------------------+---------+
|
||||
| :ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` | :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.clip_contents<class_Control_property_clip_contents>` is enabled, this allows to show only the container's area restricted by its own bounding rectangle.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _enum_AspectRatioContainer_AlignmentMode:
|
||||
|
||||
.. _class_AspectRatioContainer_constant_ALIGNMENT_BEGIN:
|
||||
|
||||
.. _class_AspectRatioContainer_constant_ALIGNMENT_CENTER:
|
||||
|
||||
.. _class_AspectRatioContainer_constant_ALIGNMENT_END:
|
||||
.. rst-class:: classref-enumeration
|
||||
|
||||
enum **AlignmentMode**:
|
||||
|
||||
- **ALIGNMENT_BEGIN** = **0** --- Aligns child controls with the beginning (left or top) of the container.
|
||||
.. _class_AspectRatioContainer_constant_ALIGNMENT_BEGIN:
|
||||
|
||||
- **ALIGNMENT_CENTER** = **1** --- Aligns child controls with the center of the container.
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
- **ALIGNMENT_END** = **2** --- Aligns child controls with the end (right or bottom) of the container.
|
||||
:ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` **ALIGNMENT_BEGIN** = ``0``
|
||||
|
||||
Aligns child controls with the beginning (left or top) of the container.
|
||||
|
||||
.. _class_AspectRatioContainer_constant_ALIGNMENT_CENTER:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` **ALIGNMENT_CENTER** = ``1``
|
||||
|
||||
Aligns child controls with the center of the container.
|
||||
|
||||
.. _class_AspectRatioContainer_constant_ALIGNMENT_END:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` **ALIGNMENT_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:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` **alignment_horizontal**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------------------+
|
||||
| *Default* | ``1`` |
|
||||
+-----------+---------------------------------+
|
||||
| *Setter* | set_alignment_horizontal(value) |
|
||||
+-----------+---------------------------------+
|
||||
| *Getter* | get_alignment_horizontal() |
|
||||
+-----------+---------------------------------+
|
||||
:ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` **alignment_horizontal** = ``1``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_alignment_horizontal** **(** :ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` value **)**
|
||||
- :ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` **get_alignment_horizontal** **(** **)**
|
||||
|
||||
Specifies the horizontal relative position of child controls.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AspectRatioContainer_property_alignment_vertical:
|
||||
|
||||
- :ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` **alignment_vertical**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-------------------------------+
|
||||
| *Default* | ``1`` |
|
||||
+-----------+-------------------------------+
|
||||
| *Setter* | set_alignment_vertical(value) |
|
||||
+-----------+-------------------------------+
|
||||
| *Getter* | get_alignment_vertical() |
|
||||
+-----------+-------------------------------+
|
||||
:ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` **alignment_vertical** = ``1``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_alignment_vertical** **(** :ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` value **)**
|
||||
- :ref:`AlignmentMode<enum_AspectRatioContainer_AlignmentMode>` **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.
|
||||
|
||||
|
||||
@@ -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:`AStar3D<class_AStar3D>` 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| |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :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| |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`PackedInt64Array<class_PackedInt64Array>` | :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:`PackedInt64Array<class_PackedInt64Array>` | :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:`PackedInt64Array<class_PackedInt64Array>` | :ref:`get_point_ids<class_AStar2D_method_get_point_ids>` **(** **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedVector2Array<class_PackedVector2Array>` | :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:`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| |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :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| |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`PackedInt64Array<class_PackedInt64Array>` | :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:`PackedInt64Array<class_PackedInt64Array>` | :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:`PackedInt64Array<class_PackedInt64Array>` | :ref:`get_point_ids<class_AStar2D_method_get_point_ids>` **(** **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedVector2Array<class_PackedVector2Array>` | :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:`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| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_compute_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |const|
|
||||
|
||||
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| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_estimate_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |const|
|
||||
|
||||
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.
|
||||
|
||||
@@ -122,27 +145,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.
|
||||
|
||||
@@ -165,37 +200,53 @@ Creates a segment between the given points. If ``bidirectional`` is ``false``, o
|
||||
|
||||
|
||||
|
||||
.. 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.
|
||||
|
||||
@@ -222,11 +273,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:`PackedInt64Array<class_PackedInt64Array>` **get_id_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedInt64Array<class_PackedInt64Array>` **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.
|
||||
|
||||
@@ -266,19 +321,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:`PackedInt64Array<class_PackedInt64Array>` **get_point_connections** **(** :ref:`int<class_int>` id **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedInt64Array<class_PackedInt64Array>` **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.
|
||||
|
||||
@@ -313,101 +376,149 @@ Returns an array with the IDs of the points that form the connection with the gi
|
||||
|
||||
|
||||
|
||||
.. 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_ids:
|
||||
|
||||
- :ref:`PackedInt64Array<class_PackedInt64Array>` **get_point_ids** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedInt64Array<class_PackedInt64Array>` **get_point_ids** **(** **)**
|
||||
|
||||
Returns an array of all point IDs.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar2D_method_get_point_path:
|
||||
|
||||
- :ref:`PackedVector2Array<class_PackedVector2Array>` **get_point_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedVector2Array<class_PackedVector2Array>` **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:`PackedVector2Array<class_PackedVector2Array>` 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_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, such as points on a grid. 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.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AStar3D
|
||||
|
||||
An implementation of A\* to find the shortest paths among connected points in space.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -57,87 +59,108 @@ It is also possible to use non-Euclidean distances. To do so, create a class tha
|
||||
|
||||
If the default :ref:`_estimate_cost<class_AStar3D_method__estimate_cost>` and :ref:`_compute_cost<class_AStar3D_method__compute_cost>` methods are used, or if the supplied :ref:`_estimate_cost<class_AStar3D_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_AStar3D_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_AStar3D_method__compute_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStar3D_method__estimate_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_point<class_AStar3D_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_AStar3D_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_AStar3D_method_clear>` **(** **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`connect_points<class_AStar3D_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_AStar3D_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_AStar3D_method_get_available_point_id>` **(** **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_closest_point<class_AStar3D_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_AStar3D_method_get_closest_position_in_segment>` **(** :ref:`Vector3<class_Vector3>` to_position **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedInt64Array<class_PackedInt64Array>` | :ref:`get_id_path<class_AStar3D_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_AStar3D_method_get_point_capacity>` **(** **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedInt64Array<class_PackedInt64Array>` | :ref:`get_point_connections<class_AStar3D_method_get_point_connections>` **(** :ref:`int<class_int>` id **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_point_count<class_AStar3D_method_get_point_count>` **(** **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedInt64Array<class_PackedInt64Array>` | :ref:`get_point_ids<class_AStar3D_method_get_point_ids>` **(** **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedVector3Array<class_PackedVector3Array>` | :ref:`get_point_path<class_AStar3D_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_AStar3D_method_get_point_position>` **(** :ref:`int<class_int>` id **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_point_weight_scale<class_AStar3D_method_get_point_weight_scale>` **(** :ref:`int<class_int>` id **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_point<class_AStar3D_method_has_point>` **(** :ref:`int<class_int>` id **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_point_disabled<class_AStar3D_method_is_point_disabled>` **(** :ref:`int<class_int>` id **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_point<class_AStar3D_method_remove_point>` **(** :ref:`int<class_int>` id **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`reserve_space<class_AStar3D_method_reserve_space>` **(** :ref:`int<class_int>` num_nodes **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_point_disabled<class_AStar3D_method_set_point_disabled>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_point_position<class_AStar3D_method_set_point_position>` **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_point_weight_scale<class_AStar3D_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_AStar3D_method__compute_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStar3D_method__estimate_cost>` **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_point<class_AStar3D_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_AStar3D_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_AStar3D_method_clear>` **(** **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`connect_points<class_AStar3D_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_AStar3D_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_AStar3D_method_get_available_point_id>` **(** **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_closest_point<class_AStar3D_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_AStar3D_method_get_closest_position_in_segment>` **(** :ref:`Vector3<class_Vector3>` to_position **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedInt64Array<class_PackedInt64Array>` | :ref:`get_id_path<class_AStar3D_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_AStar3D_method_get_point_capacity>` **(** **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedInt64Array<class_PackedInt64Array>` | :ref:`get_point_connections<class_AStar3D_method_get_point_connections>` **(** :ref:`int<class_int>` id **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_point_count<class_AStar3D_method_get_point_count>` **(** **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedInt64Array<class_PackedInt64Array>` | :ref:`get_point_ids<class_AStar3D_method_get_point_ids>` **(** **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedVector3Array<class_PackedVector3Array>` | :ref:`get_point_path<class_AStar3D_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_AStar3D_method_get_point_position>` **(** :ref:`int<class_int>` id **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_point_weight_scale<class_AStar3D_method_get_point_weight_scale>` **(** :ref:`int<class_int>` id **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`has_point<class_AStar3D_method_has_point>` **(** :ref:`int<class_int>` id **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_point_disabled<class_AStar3D_method_is_point_disabled>` **(** :ref:`int<class_int>` id **)** |const| |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_point<class_AStar3D_method_remove_point>` **(** :ref:`int<class_int>` id **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`reserve_space<class_AStar3D_method_reserve_space>` **(** :ref:`int<class_int>` num_nodes **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_point_disabled<class_AStar3D_method_set_point_disabled>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` disabled=true **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_point_position<class_AStar3D_method_set_point_position>` **(** :ref:`int<class_int>` id, :ref:`Vector3<class_Vector3>` position **)** |
|
||||
+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_point_weight_scale<class_AStar3D_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_AStar3D_method__compute_cost:
|
||||
|
||||
- :ref:`float<class_float>` **_compute_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_compute_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |const|
|
||||
|
||||
Called when computing the cost between two connected points.
|
||||
|
||||
Note that this function is hidden in the default ``AStar3D`` class.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar3D_method__estimate_cost:
|
||||
|
||||
- :ref:`float<class_float>` **_estimate_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_estimate_cost** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)** |virtual| |const|
|
||||
|
||||
Called when estimating the cost between a point and the path's ending point.
|
||||
|
||||
Note that this function is hidden in the default ``AStar3D`` class.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar3D_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.
|
||||
|
||||
@@ -160,27 +183,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_AStar3D_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_AStar3D_method_clear:
|
||||
|
||||
- void **clear** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **clear** **(** **)**
|
||||
|
||||
Clears all the points and segments.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar3D_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.
|
||||
|
||||
@@ -203,37 +238,53 @@ Creates a segment between the given points. If ``bidirectional`` is ``false``, o
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar3D_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_AStar3D_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_AStar3D_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_AStar3D_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.
|
||||
|
||||
@@ -260,11 +311,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_AStar3D_method_get_id_path:
|
||||
|
||||
- :ref:`PackedInt64Array<class_PackedInt64Array>` **get_id_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedInt64Array<class_PackedInt64Array>` **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 AStar3D between the given points. The array is ordered from the starting point to the ending point of the path.
|
||||
|
||||
@@ -303,19 +358,27 @@ Returns an array with the IDs of the points that form the path found by AStar3D
|
||||
|
||||
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_AStar3D_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_AStar3D_method_get_point_connections:
|
||||
|
||||
- :ref:`PackedInt64Array<class_PackedInt64Array>` **get_point_connections** **(** :ref:`int<class_int>` id **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedInt64Array<class_PackedInt64Array>` **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.
|
||||
|
||||
@@ -349,101 +412,149 @@ Returns an array with the IDs of the points that form the connection with the gi
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar3D_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_AStar3D_method_get_point_ids:
|
||||
|
||||
- :ref:`PackedInt64Array<class_PackedInt64Array>` **get_point_ids** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedInt64Array<class_PackedInt64Array>` **get_point_ids** **(** **)**
|
||||
|
||||
Returns an array of all point IDs.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar3D_method_get_point_path:
|
||||
|
||||
- :ref:`PackedVector3Array<class_PackedVector3Array>` **get_point_path** **(** :ref:`int<class_int>` from_id, :ref:`int<class_int>` to_id **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedVector3Array<class_PackedVector3Array>` **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 AStar3D 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:`PackedVector3Array<class_PackedVector3Array>` and will print an error message.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar3D_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_AStar3D_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_AStar3D_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_AStar3D_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_AStar3D_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_AStar3D_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, such as points on a grid. New capacity must be greater or equals to old capacity.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStar3D_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_AStar3D_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_AStar3D_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_AStar3D_method__compute_cost>` when determining the overall cost of traveling across a segment from a neighboring point to this point.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AStarGrid2D
|
||||
|
||||
A\* (or "A-Star") pathfinding tailored to find the shortest paths on 2D grids.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -44,68 +46,82 @@ In contrast to :ref:`AStar2D<class_AStar2D>`, you only need set the :ref:`size<c
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`cell_size<class_AStarGrid2D_property_cell_size>` | ``Vector2(1, 1)`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`Heuristic<enum_AStarGrid2D_Heuristic>` | :ref:`default_heuristic<class_AStarGrid2D_property_default_heuristic>` | ``0`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` | :ref:`diagonal_mode<class_AStarGrid2D_property_diagonal_mode>` | ``0`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`jumping_enabled<class_AStarGrid2D_property_jumping_enabled>` | ``false`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`offset<class_AStarGrid2D_property_offset>` | ``Vector2(0, 0)`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`Vector2i<class_Vector2i>` | :ref:`size<class_AStarGrid2D_property_size>` | ``Vector2i(0, 0)`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`cell_size<class_AStarGrid2D_property_cell_size>` | ``Vector2(1, 1)`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`Heuristic<enum_AStarGrid2D_Heuristic>` | :ref:`default_heuristic<class_AStarGrid2D_property_default_heuristic>` | ``0`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` | :ref:`diagonal_mode<class_AStarGrid2D_property_diagonal_mode>` | ``0`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`jumping_enabled<class_AStarGrid2D_property_jumping_enabled>` | ``false`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`Vector2<class_Vector2>` | :ref:`offset<class_AStarGrid2D_property_offset>` | ``Vector2(0, 0)`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
| :ref:`Vector2i<class_Vector2i>` | :ref:`size<class_AStarGrid2D_property_size>` | ``Vector2i(0, 0)`` |
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+--------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_compute_cost<class_AStarGrid2D_method__compute_cost>` **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |virtual| |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStarGrid2D_method__estimate_cost>` **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |virtual| |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`clear<class_AStarGrid2D_method_clear>` **(** **)** |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector2i[]<class_Vector2i>` | :ref:`get_id_path<class_AStarGrid2D_method_get_id_path>` **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`get_point_path<class_AStarGrid2D_method_get_point_path>` **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_dirty<class_AStarGrid2D_method_is_dirty>` **(** **)** |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_in_bounds<class_AStarGrid2D_method_is_in_bounds>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_in_boundsv<class_AStarGrid2D_method_is_in_boundsv>` **(** :ref:`Vector2i<class_Vector2i>` id **)** |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_point_solid<class_AStarGrid2D_method_is_point_solid>` **(** :ref:`Vector2i<class_Vector2i>` id **)** |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_point_solid<class_AStarGrid2D_method_set_point_solid>` **(** :ref:`Vector2i<class_Vector2i>` id, :ref:`bool<class_bool>` solid=true **)** |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`update<class_AStarGrid2D_method_update>` **(** **)** |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_compute_cost<class_AStarGrid2D_method__compute_cost>` **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |virtual| |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_estimate_cost<class_AStarGrid2D_method__estimate_cost>` **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |virtual| |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`clear<class_AStarGrid2D_method_clear>` **(** **)** |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector2i[]<class_Vector2i>` | :ref:`get_id_path<class_AStarGrid2D_method_get_id_path>` **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`get_point_path<class_AStarGrid2D_method_get_point_path>` **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_dirty<class_AStarGrid2D_method_is_dirty>` **(** **)** |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_in_bounds<class_AStarGrid2D_method_is_in_bounds>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_in_boundsv<class_AStarGrid2D_method_is_in_boundsv>` **(** :ref:`Vector2i<class_Vector2i>` id **)** |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_point_solid<class_AStarGrid2D_method_is_point_solid>` **(** :ref:`Vector2i<class_Vector2i>` id **)** |const| |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_point_solid<class_AStarGrid2D_method_set_point_solid>` **(** :ref:`Vector2i<class_Vector2i>` id, :ref:`bool<class_bool>` solid=true **)** |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`update<class_AStarGrid2D_method_update>` **(** **)** |
|
||||
+-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Enumerations
|
||||
------------
|
||||
|
||||
.. _enum_AStarGrid2D_Heuristic:
|
||||
|
||||
.. _class_AStarGrid2D_constant_HEURISTIC_EUCLIDEAN:
|
||||
|
||||
.. _class_AStarGrid2D_constant_HEURISTIC_MANHATTAN:
|
||||
|
||||
.. _class_AStarGrid2D_constant_HEURISTIC_OCTILE:
|
||||
|
||||
.. _class_AStarGrid2D_constant_HEURISTIC_CHEBYSHEV:
|
||||
|
||||
.. _class_AStarGrid2D_constant_HEURISTIC_MAX:
|
||||
.. rst-class:: classref-enumeration
|
||||
|
||||
enum **Heuristic**:
|
||||
|
||||
- **HEURISTIC_EUCLIDEAN** = **0** --- The Euclidean heuristic to be used for the pathfinding using the following formula:
|
||||
.. _class_AStarGrid2D_constant_HEURISTIC_EUCLIDEAN:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`Heuristic<enum_AStarGrid2D_Heuristic>` **HEURISTIC_EUCLIDEAN** = ``0``
|
||||
|
||||
The Euclidean heuristic to be used for the pathfinding using the following formula:
|
||||
|
||||
::
|
||||
|
||||
@@ -113,7 +129,13 @@ enum **Heuristic**:
|
||||
dy = abs(to_id.y - from_id.y)
|
||||
result = sqrt(dx * dx + dy * dy)
|
||||
|
||||
- **HEURISTIC_MANHATTAN** = **1** --- The Manhattan heuristic to be used for the pathfinding using the following formula:
|
||||
.. _class_AStarGrid2D_constant_HEURISTIC_MANHATTAN:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`Heuristic<enum_AStarGrid2D_Heuristic>` **HEURISTIC_MANHATTAN** = ``1``
|
||||
|
||||
The Manhattan heuristic to be used for the pathfinding using the following formula:
|
||||
|
||||
::
|
||||
|
||||
@@ -121,7 +143,13 @@ enum **Heuristic**:
|
||||
dy = abs(to_id.y - from_id.y)
|
||||
result = dx + dy
|
||||
|
||||
- **HEURISTIC_OCTILE** = **2** --- The Octile heuristic to be used for the pathfinding using the following formula:
|
||||
.. _class_AStarGrid2D_constant_HEURISTIC_OCTILE:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`Heuristic<enum_AStarGrid2D_Heuristic>` **HEURISTIC_OCTILE** = ``2``
|
||||
|
||||
The Octile heuristic to be used for the pathfinding using the following formula:
|
||||
|
||||
::
|
||||
|
||||
@@ -130,7 +158,13 @@ enum **Heuristic**:
|
||||
f = sqrt(2) - 1
|
||||
result = (dx < dy) ? f * dx + dy : f * dy + dx;
|
||||
|
||||
- **HEURISTIC_CHEBYSHEV** = **3** --- The Chebyshev heuristic to be used for the pathfinding using the following formula:
|
||||
.. _class_AStarGrid2D_constant_HEURISTIC_CHEBYSHEV:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`Heuristic<enum_AStarGrid2D_Heuristic>` **HEURISTIC_CHEBYSHEV** = ``3``
|
||||
|
||||
The Chebyshev heuristic to be used for the pathfinding using the following formula:
|
||||
|
||||
::
|
||||
|
||||
@@ -138,223 +172,311 @@ enum **Heuristic**:
|
||||
dy = abs(to_id.y - from_id.y)
|
||||
result = max(dx, dy)
|
||||
|
||||
- **HEURISTIC_MAX** = **4** --- Represents the size of the :ref:`Heuristic<enum_AStarGrid2D_Heuristic>` enum.
|
||||
.. _class_AStarGrid2D_constant_HEURISTIC_MAX:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`Heuristic<enum_AStarGrid2D_Heuristic>` **HEURISTIC_MAX** = ``4``
|
||||
|
||||
Represents the size of the :ref:`Heuristic<enum_AStarGrid2D_Heuristic>` enum.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _enum_AStarGrid2D_DiagonalMode:
|
||||
|
||||
.. _class_AStarGrid2D_constant_DIAGONAL_MODE_ALWAYS:
|
||||
|
||||
.. _class_AStarGrid2D_constant_DIAGONAL_MODE_NEVER:
|
||||
|
||||
.. _class_AStarGrid2D_constant_DIAGONAL_MODE_AT_LEAST_ONE_WALKABLE:
|
||||
|
||||
.. _class_AStarGrid2D_constant_DIAGONAL_MODE_ONLY_IF_NO_OBSTACLES:
|
||||
|
||||
.. _class_AStarGrid2D_constant_DIAGONAL_MODE_MAX:
|
||||
.. rst-class:: classref-enumeration
|
||||
|
||||
enum **DiagonalMode**:
|
||||
|
||||
- **DIAGONAL_MODE_ALWAYS** = **0** --- The pathfinding algorithm will ignore solid neighbors around the target cell and allow passing using diagonals.
|
||||
.. _class_AStarGrid2D_constant_DIAGONAL_MODE_ALWAYS:
|
||||
|
||||
- **DIAGONAL_MODE_NEVER** = **1** --- The pathfinding algorithm will ignore all diagonals and the way will be always orthogonal.
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
- **DIAGONAL_MODE_AT_LEAST_ONE_WALKABLE** = **2** --- The pathfinding algorithm will avoid using diagonals if at least two obstacles have been placed around the neighboring cells of the specific path segment.
|
||||
:ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` **DIAGONAL_MODE_ALWAYS** = ``0``
|
||||
|
||||
- **DIAGONAL_MODE_ONLY_IF_NO_OBSTACLES** = **3** --- The pathfinding algorithm will avoid using diagonals if any obstacle has been placed around the neighboring cells of the specific path segment.
|
||||
The pathfinding algorithm will ignore solid neighbors around the target cell and allow passing using diagonals.
|
||||
|
||||
- **DIAGONAL_MODE_MAX** = **4** --- Represents the size of the :ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` enum.
|
||||
.. _class_AStarGrid2D_constant_DIAGONAL_MODE_NEVER:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` **DIAGONAL_MODE_NEVER** = ``1``
|
||||
|
||||
The pathfinding algorithm will ignore all diagonals and the way will be always orthogonal.
|
||||
|
||||
.. _class_AStarGrid2D_constant_DIAGONAL_MODE_AT_LEAST_ONE_WALKABLE:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` **DIAGONAL_MODE_AT_LEAST_ONE_WALKABLE** = ``2``
|
||||
|
||||
The pathfinding algorithm will avoid using diagonals if at least two obstacles have been placed around the neighboring cells of the specific path segment.
|
||||
|
||||
.. _class_AStarGrid2D_constant_DIAGONAL_MODE_ONLY_IF_NO_OBSTACLES:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` **DIAGONAL_MODE_ONLY_IF_NO_OBSTACLES** = ``3``
|
||||
|
||||
The pathfinding algorithm will avoid using diagonals if any obstacle has been placed around the neighboring cells of the specific path segment.
|
||||
|
||||
.. _class_AStarGrid2D_constant_DIAGONAL_MODE_MAX:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` **DIAGONAL_MODE_MAX** = ``4``
|
||||
|
||||
Represents the size of the :ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` enum.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AStarGrid2D_property_cell_size:
|
||||
|
||||
- :ref:`Vector2<class_Vector2>` **cell_size**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``Vector2(1, 1)`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_cell_size(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_cell_size() |
|
||||
+-----------+----------------------+
|
||||
:ref:`Vector2<class_Vector2>` **cell_size** = ``Vector2(1, 1)``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_cell_size** **(** :ref:`Vector2<class_Vector2>` value **)**
|
||||
- :ref:`Vector2<class_Vector2>` **get_cell_size** **(** **)**
|
||||
|
||||
The size of the point cell which will be applied to calculate the resulting point position returned by :ref:`get_point_path<class_AStarGrid2D_method_get_point_path>`. If changed, :ref:`update<class_AStarGrid2D_method_update>` needs to be called before finding the next path.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_property_default_heuristic:
|
||||
|
||||
- :ref:`Heuristic<enum_AStarGrid2D_Heuristic>` **default_heuristic**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+------------------------------+
|
||||
| *Setter* | set_default_heuristic(value) |
|
||||
+-----------+------------------------------+
|
||||
| *Getter* | get_default_heuristic() |
|
||||
+-----------+------------------------------+
|
||||
:ref:`Heuristic<enum_AStarGrid2D_Heuristic>` **default_heuristic** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_default_heuristic** **(** :ref:`Heuristic<enum_AStarGrid2D_Heuristic>` value **)**
|
||||
- :ref:`Heuristic<enum_AStarGrid2D_Heuristic>` **get_default_heuristic** **(** **)**
|
||||
|
||||
The default :ref:`Heuristic<enum_AStarGrid2D_Heuristic>` which will be used to calculate the path if :ref:`_compute_cost<class_AStarGrid2D_method__compute_cost>` and/or :ref:`_estimate_cost<class_AStarGrid2D_method__estimate_cost>` were not overridden.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_property_diagonal_mode:
|
||||
|
||||
- :ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` **diagonal_mode**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+--------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+--------------------------+
|
||||
| *Setter* | set_diagonal_mode(value) |
|
||||
+-----------+--------------------------+
|
||||
| *Getter* | get_diagonal_mode() |
|
||||
+-----------+--------------------------+
|
||||
:ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` **diagonal_mode** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_diagonal_mode** **(** :ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` value **)**
|
||||
- :ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` **get_diagonal_mode** **(** **)**
|
||||
|
||||
A specific :ref:`DiagonalMode<enum_AStarGrid2D_DiagonalMode>` mode which will force the path to avoid or accept the specified diagonals.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_property_jumping_enabled:
|
||||
|
||||
- :ref:`bool<class_bool>` **jumping_enabled**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------------+
|
||||
| *Default* | ``false`` |
|
||||
+-----------+----------------------------+
|
||||
| *Setter* | set_jumping_enabled(value) |
|
||||
+-----------+----------------------------+
|
||||
| *Getter* | is_jumping_enabled() |
|
||||
+-----------+----------------------------+
|
||||
:ref:`bool<class_bool>` **jumping_enabled** = ``false``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_jumping_enabled** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **is_jumping_enabled** **(** **)**
|
||||
|
||||
Enables or disables jumping to skip up the intermediate points and speeds up the searching algorithm.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_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 offset of the grid which will be applied to calculate the resulting point position returned by :ref:`get_point_path<class_AStarGrid2D_method_get_point_path>`. If changed, :ref:`update<class_AStarGrid2D_method_update>` needs to be called before finding the next path.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_property_size:
|
||||
|
||||
- :ref:`Vector2i<class_Vector2i>` **size**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+--------------------+
|
||||
| *Default* | ``Vector2i(0, 0)`` |
|
||||
+-----------+--------------------+
|
||||
| *Setter* | set_size(value) |
|
||||
+-----------+--------------------+
|
||||
| *Getter* | get_size() |
|
||||
+-----------+--------------------+
|
||||
:ref:`Vector2i<class_Vector2i>` **size** = ``Vector2i(0, 0)``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_size** **(** :ref:`Vector2i<class_Vector2i>` value **)**
|
||||
- :ref:`Vector2i<class_Vector2i>` **get_size** **(** **)**
|
||||
|
||||
The size of the grid (number of cells of size :ref:`cell_size<class_AStarGrid2D_property_cell_size>` on each axis). If changed, :ref:`update<class_AStarGrid2D_method_update>` needs to be called before finding the next path.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AStarGrid2D_method__compute_cost:
|
||||
|
||||
- :ref:`float<class_float>` **_compute_cost** **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_compute_cost** **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |virtual| |const|
|
||||
|
||||
Called when computing the cost between two connected points.
|
||||
|
||||
Note that this function is hidden in the default ``AStarGrid2D`` class.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_method__estimate_cost:
|
||||
|
||||
- :ref:`float<class_float>` **_estimate_cost** **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_estimate_cost** **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)** |virtual| |const|
|
||||
|
||||
Called when estimating the cost between a point and the path's ending point.
|
||||
|
||||
Note that this function is hidden in the default ``AStarGrid2D`` class.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_method_clear:
|
||||
|
||||
- void **clear** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **clear** **(** **)**
|
||||
|
||||
Clears the grid and sets the :ref:`size<class_AStarGrid2D_property_size>` to :ref:`Vector2i.ZERO<class_Vector2i_constant_ZERO>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_method_get_id_path:
|
||||
|
||||
- :ref:`Vector2i[]<class_Vector2i>` **get_id_path** **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Vector2i[]<class_Vector2i>` **get_id_path** **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` 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.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_method_get_point_path:
|
||||
|
||||
- :ref:`PackedVector2Array<class_PackedVector2Array>` **get_point_path** **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedVector2Array<class_PackedVector2Array>` **get_point_path** **(** :ref:`Vector2i<class_Vector2i>` from_id, :ref:`Vector2i<class_Vector2i>` to_id **)**
|
||||
|
||||
Returns an array with the points that are in the path found by AStarGrid2D 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:`PackedVector3Array<class_PackedVector3Array>` and will print an error message.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_method_is_dirty:
|
||||
|
||||
- :ref:`bool<class_bool>` **is_dirty** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **is_dirty** **(** **)** |const|
|
||||
|
||||
Indicates that the grid parameters were changed and :ref:`update<class_AStarGrid2D_method_update>` needs to be called.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_method_is_in_bounds:
|
||||
|
||||
- :ref:`bool<class_bool>` **is_in_bounds** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **is_in_bounds** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** |const|
|
||||
|
||||
Returns ``true`` if the ``x`` and ``y`` is a valid grid coordinate (id).
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_method_is_in_boundsv:
|
||||
|
||||
- :ref:`bool<class_bool>` **is_in_boundsv** **(** :ref:`Vector2i<class_Vector2i>` id **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **is_in_boundsv** **(** :ref:`Vector2i<class_Vector2i>` id **)** |const|
|
||||
|
||||
Returns ``true`` if the ``id`` vector is a valid grid coordinate.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_method_is_point_solid:
|
||||
|
||||
- :ref:`bool<class_bool>` **is_point_solid** **(** :ref:`Vector2i<class_Vector2i>` id **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **is_point_solid** **(** :ref:`Vector2i<class_Vector2i>` id **)** |const|
|
||||
|
||||
Returns ``true`` if a point is disabled for pathfinding. By default, all points are enabled.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_method_set_point_solid:
|
||||
|
||||
- void **set_point_solid** **(** :ref:`Vector2i<class_Vector2i>` id, :ref:`bool<class_bool>` solid=true **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_point_solid** **(** :ref:`Vector2i<class_Vector2i>` id, :ref:`bool<class_bool>` solid=true **)**
|
||||
|
||||
Disables or enables the specified point for pathfinding. Useful for making an obstacle. By default, all points are enabled.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AStarGrid2D_method_update:
|
||||
|
||||
- void **update** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **update** **(** **)**
|
||||
|
||||
Updates the internal state of the grid according to the parameters to prepare it to search the path. Needs to be called if parameters like :ref:`size<class_AStarGrid2D_property_size>`, :ref:`cell_size<class_AStarGrid2D_property_cell_size>` or :ref:`offset<class_AStarGrid2D_property_offset>` are changed. :ref:`is_dirty<class_AStarGrid2D_method_is_dirty>` will return ``true`` if this is the case and this needs to be called.
|
||||
|
||||
|
||||
@@ -14,90 +14,107 @@ AtlasTexture
|
||||
|
||||
A texture that crops out part of another Texture2D.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
:ref:`Texture2D<class_Texture2D>` resource that draws only part of its :ref:`atlas<class_AtlasTexture_property_atlas>` texture, as defined by the :ref:`region<class_AtlasTexture_property_region>`. An additional :ref:`margin<class_AtlasTexture_property_margin>` can also be set, which is useful for small adjustments.
|
||||
|
||||
Multiple ``AtlasTexture`` resources can be cropped from the same :ref:`atlas<class_AtlasTexture_property_atlas>`. Packing many smaller textures into a singular large texture helps to optimize video memory costs and render calls.
|
||||
Multiple **AtlasTexture** resources can be cropped from the same :ref:`atlas<class_AtlasTexture_property_atlas>`. Packing many smaller textures into a singular large texture helps to optimize video memory costs and render calls.
|
||||
|
||||
\ **Note:** ``AtlasTexture`` cannot be used in an :ref:`AnimatedTexture<class_AnimatedTexture>`, and may not tile properly in nodes such as :ref:`TextureRect<class_TextureRect>`, when inside other ``AtlasTexture`` resources.
|
||||
\ **Note:** **AtlasTexture** cannot be used in an :ref:`AnimatedTexture<class_AnimatedTexture>`, and may not tile properly in nodes such as :ref:`TextureRect<class_TextureRect>`, when inside other **AtlasTexture** resources.
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`Texture2D<class_Texture2D>` | :ref:`atlas<class_AtlasTexture_property_atlas>` | |
|
||||
+-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`filter_clip<class_AtlasTexture_property_filter_clip>` | ``false`` |
|
||||
+-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :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)`` |
|
||||
+-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | resource_local_to_scene | ``false`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
|
||||
+-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`Texture2D<class_Texture2D>` | :ref:`atlas<class_AtlasTexture_property_atlas>` | |
|
||||
+-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`filter_clip<class_AtlasTexture_property_filter_clip>` | ``false`` |
|
||||
+-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :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)`` |
|
||||
+-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | resource_local_to_scene | ``false`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
|
||||
+-----------------------------------+-------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AtlasTexture_property_atlas:
|
||||
|
||||
- :ref:`Texture2D<class_Texture2D>` **atlas**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+----------+------------------+
|
||||
| *Setter* | set_atlas(value) |
|
||||
+----------+------------------+
|
||||
| *Getter* | get_atlas() |
|
||||
+----------+------------------+
|
||||
:ref:`Texture2D<class_Texture2D>` **atlas**
|
||||
|
||||
The texture that contains the atlas. Can be any type inheriting from :ref:`Texture2D<class_Texture2D>`, including another ``AtlasTexture``.
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_atlas** **(** :ref:`Texture2D<class_Texture2D>` value **)**
|
||||
- :ref:`Texture2D<class_Texture2D>` **get_atlas** **(** **)**
|
||||
|
||||
The texture that contains the atlas. Can be any type inheriting from :ref:`Texture2D<class_Texture2D>`, including another **AtlasTexture**.
|
||||
|
||||
.. 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``, the area outside of the :ref:`region<class_AtlasTexture_property_region>` is clipped 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 :ref:`region<class_AtlasTexture_property_region>`. Useful for small adjustments. If the :ref:`Rect2.size<class_Rect2_property_size>` of this property ("w" and "h" in the editor) is set, the drawn texture is resized to fit 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 region used to draw the :ref:`atlas<class_AtlasTexture_property_atlas>`.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AudioBusLayout
|
||||
|
||||
Stores information about the audio buses.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
|
||||
@@ -16,29 +16,46 @@ 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
|
||||
---------
|
||||
|
||||
- `Audio Mic Record Demo <https://godotengine.org/asset-library/asset/527>`__
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-------------------------------------------------------+----------------------------------------------------------------------------------+
|
||||
| :ref:`AudioEffectInstance<class_AudioEffectInstance>` | :ref:`_instantiate<class_AudioEffect_method__instantiate>` **(** **)** |virtual| |
|
||||
+-------------------------------------------------------+----------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------------------+----------------------------------------------------------------------------------+
|
||||
| :ref:`AudioEffectInstance<class_AudioEffectInstance>` | :ref:`_instantiate<class_AudioEffect_method__instantiate>` **(** **)** |virtual| |
|
||||
+-------------------------------------------------------+----------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AudioEffect_method__instantiate:
|
||||
|
||||
- :ref:`AudioEffectInstance<class_AudioEffectInstance>` **_instantiate** **(** **)** |virtual|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`AudioEffectInstance<class_AudioEffectInstance>` **_instantiate** **(** **)** |virtual|
|
||||
|
||||
.. container:: contribute
|
||||
|
||||
|
||||
@@ -14,37 +14,51 @@ AudioEffectAmplify
|
||||
|
||||
Adds an amplifying audio effect to an audio bus.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Increases or decreases the volume being routed through the audio bus.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. 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.
|
||||
|
||||
|
||||
@@ -14,11 +14,15 @@ AudioEffectBandLimitFilter
|
||||
|
||||
Adds a band limit filter to the audio bus.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Limits the frequencies in a range around the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` and allows frequencies outside of this range to pass.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -14,11 +14,15 @@ AudioEffectBandPassFilter
|
||||
|
||||
Adds a band pass filter to the audio bus.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Attenuates the frequencies inside of a range around the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` and cuts frequencies outside of this band.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -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/driver/enable_input<class_ProjectSettings_property_audio/driver/enable_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,105 +34,152 @@ 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:`PackedVector2Array<class_PackedVector2Array>` | :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:`PackedVector2Array<class_PackedVector2Array>` | :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:`PackedVector2Array<class_PackedVector2Array>` **get_buffer** **(** :ref:`int<class_int>` frames **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedVector2Array<class_PackedVector2Array>` **get_buffer** **(** :ref:`int<class_int>` frames **)**
|
||||
|
||||
Gets the next ``frames`` audio samples from the internal ring buffer.
|
||||
|
||||
Returns a :ref:`PackedVector2Array<class_PackedVector2Array>` containing exactly ``frames`` audio samples if available, or an empty :ref:`PackedVector2Array<class_PackedVector2Array>` 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.
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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,140 +33,158 @@ Compressor has many uses in the mix:
|
||||
|
||||
- Accentuates transients by using a wider attack, making effects sound more punchy.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. 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:`StringName<class_StringName>` | :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:`StringName<class_StringName>` | :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:`StringName<class_StringName>` **sidechain**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``&""`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_sidechain(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_sidechain() |
|
||||
+-----------+----------------------+
|
||||
:ref:`StringName<class_StringName>` **sidechain** = ``&""``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_sidechain** **(** :ref:`StringName<class_StringName>` value **)**
|
||||
- :ref:`StringName<class_StringName>` **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.
|
||||
|
||||
|
||||
@@ -16,253 +16,279 @@ 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-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. 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).
|
||||
|
||||
|
||||
@@ -14,142 +14,188 @@ AudioEffectDistortion
|
||||
|
||||
Adds a distortion audio effect to an Audio bus.
|
||||
|
||||
Modify the sound to make it distorted.
|
||||
Modifies the sound to make it distorted.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape.
|
||||
|
||||
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.
|
||||
By distorting the waveform the frequency content changes, 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 (bit depth reduction). 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. The :ref:`drive<class_AudioEffectDistortion_property_drive>` property has no effect in this mode.
|
||||
|
||||
.. _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``
|
||||
|
||||
Increases or decreases the volume after the effect. Value can range from -80 to 24.
|
||||
.. 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, in decibels. 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``
|
||||
|
||||
Increases or decreases the volume before the effect. Value can range from -60 to 60.
|
||||
.. 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, in decibels. 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.)`
|
||||
|
||||
@@ -18,49 +18,74 @@ 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-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. 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.
|
||||
|
||||
|
||||
@@ -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
|
||||
-----------
|
||||
|
||||
@@ -43,6 +45,8 @@ Band 10: 16000 Hz
|
||||
|
||||
See also :ref:`AudioEffectEQ<class_AudioEffectEQ>`, :ref:`AudioEffectEQ6<class_AudioEffectEQ6>`, :ref:`AudioEffectEQ21<class_AudioEffectEQ21>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -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
|
||||
-----------
|
||||
|
||||
@@ -65,6 +67,8 @@ Band 21: 22000 Hz
|
||||
|
||||
See also :ref:`AudioEffectEQ<class_AudioEffectEQ>`, :ref:`AudioEffectEQ6<class_AudioEffectEQ6>`, :ref:`AudioEffectEQ10<class_AudioEffectEQ10>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -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
|
||||
-----------
|
||||
|
||||
@@ -35,6 +37,8 @@ Band 6: 10000 Hz
|
||||
|
||||
See also :ref:`AudioEffectEQ<class_AudioEffectEQ>`, :ref:`AudioEffectEQ10<class_AudioEffectEQ10>`, :ref:`AudioEffectEQ21<class_AudioEffectEQ21>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -16,116 +16,157 @@ 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.
|
||||
|
||||
|
||||
@@ -14,11 +14,15 @@ AudioEffectHighPassFilter
|
||||
|
||||
Adds a high-pass filter to the audio bus.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Cuts frequencies lower than the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` and allows higher frequencies to pass.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -14,11 +14,15 @@ AudioEffectHighShelfFilter
|
||||
|
||||
Adds a high-shelf filter to the audio bus.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Reduces all frequencies above the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -18,31 +18,48 @@ AudioEffectInstance
|
||||
|
||||
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
|
||||
-------
|
||||
|
||||
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`_process<class_AudioEffectInstance_method__process>` **(** const void* src_buffer, AudioFrame* dst_buffer, :ref:`int<class_int>` frame_count **)** |virtual| |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_process_silence<class_AudioEffectInstance_method__process_silence>` **(** **)** |virtual| |const| |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`_process<class_AudioEffectInstance_method__process>` **(** const void* src_buffer, AudioFrame* dst_buffer, :ref:`int<class_int>` frame_count **)** |virtual| |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_process_silence<class_AudioEffectInstance_method__process_silence>` **(** **)** |virtual| |const| |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AudioEffectInstance_method__process:
|
||||
|
||||
- void **_process** **(** const void* src_buffer, AudioFrame* dst_buffer, :ref:`int<class_int>` frame_count **)** |virtual|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **_process** **(** const void* src_buffer, AudioFrame* dst_buffer, :ref:`int<class_int>` frame_count **)** |virtual|
|
||||
|
||||
.. 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_AudioEffectInstance_method__process_silence:
|
||||
|
||||
- :ref:`bool<class_bool>` **_process_silence** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **_process_silence** **(** **)** |virtual| |const|
|
||||
|
||||
.. container:: contribute
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AudioEffectLimiter
|
||||
|
||||
Adds a soft-clip limiter audio effect to an Audio bus.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -21,88 +23,103 @@ 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-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. 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.
|
||||
|
||||
|
||||
@@ -14,11 +14,15 @@ AudioEffectLowPassFilter
|
||||
|
||||
Adds a low-pass filter to the audio bus.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Cuts frequencies higher than the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` and allows lower frequencies to pass.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -14,11 +14,15 @@ AudioEffectLowShelfFilter
|
||||
|
||||
Adds a low-shelf filter to the audio bus.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Reduces all frequencies below the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -14,11 +14,15 @@ AudioEffectNotchFilter
|
||||
|
||||
Adds a notch filter to the Audio bus.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Attenuates frequencies in a narrow band around the :ref:`AudioEffectFilter.cutoff_hz<class_AudioEffectFilter_property_cutoff_hz>` and cuts frequencies outside of this range.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
|
||||
@@ -14,37 +14,51 @@ 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-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Audio buses <../tutorials/audio/audio_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).
|
||||
|
||||
|
||||
@@ -16,109 +16,127 @@ 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-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. 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.
|
||||
|
||||
|
||||
@@ -16,104 +16,152 @@ 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-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+----------------------------------------------------+------------------------------------------------------------------------+---------+
|
||||
| :ref:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` | :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:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` | :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_FFTSize:
|
||||
|
||||
.. _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 **FFTSize**:
|
||||
|
||||
- **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:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` **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:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` enum.
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` **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:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` **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:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` **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:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` **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:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` **FFT_SIZE_MAX** = ``5``
|
||||
|
||||
Represents the size of the :ref:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` enum.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AudioEffectPitchShift_property_fft_size:
|
||||
|
||||
- :ref:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` **fft_size**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------+
|
||||
| *Default* | ``3`` |
|
||||
+-----------+---------------------+
|
||||
| *Setter* | set_fft_size(value) |
|
||||
+-----------+---------------------+
|
||||
| *Getter* | get_fft_size() |
|
||||
+-----------+---------------------+
|
||||
:ref:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` **fft_size** = ``3``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_fft_size** **(** :ref:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` value **)**
|
||||
- :ref:`FFTSize<enum_AudioEffectPitchShift_FFTSize>` **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).
|
||||
|
||||
|
||||
@@ -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,63 +34,94 @@ Tutorials
|
||||
|
||||
- `Audio Mic Record Demo <https://godotengine.org/asset-library/asset/527>`__
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-------------------------------------------+--------------------------------------------------------+-------+
|
||||
| :ref:`Format<enum_AudioStreamWAV_Format>` | :ref:`format<class_AudioEffectRecord_property_format>` | ``1`` |
|
||||
+-------------------------------------------+--------------------------------------------------------+-------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------+--------------------------------------------------------+-------+
|
||||
| :ref:`Format<enum_AudioStreamWAV_Format>` | :ref:`format<class_AudioEffectRecord_property_format>` | ``1`` |
|
||||
+-------------------------------------------+--------------------------------------------------------+-------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioStreamWAV<class_AudioStreamWAV>` | :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:`AudioStreamWAV<class_AudioStreamWAV>` | :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_AudioStreamWAV_Format>` **format**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-------------------+
|
||||
| *Default* | ``1`` |
|
||||
+-----------+-------------------+
|
||||
| *Setter* | set_format(value) |
|
||||
+-----------+-------------------+
|
||||
| *Getter* | get_format() |
|
||||
+-----------+-------------------+
|
||||
:ref:`Format<enum_AudioStreamWAV_Format>` **format** = ``1``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_format** **(** :ref:`Format<enum_AudioStreamWAV_Format>` value **)**
|
||||
- :ref:`Format<enum_AudioStreamWAV_Format>` **get_format** **(** **)**
|
||||
|
||||
Specifies the format in which the sample will be recorded. See :ref:`Format<enum_AudioStreamWAV_Format>` for available formats.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AudioEffectRecord_method_get_recording:
|
||||
|
||||
- :ref:`AudioStreamWAV<class_AudioStreamWAV>` **get_recording** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`AudioStreamWAV<class_AudioStreamWAV>` **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.
|
||||
|
||||
|
||||
@@ -14,11 +14,15 @@ AudioEffectReverb
|
||||
|
||||
Adds a reverberation audio effect to an Audio bus.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Simulates the sound of acoustic environments such as rooms, concert halls, caverns, or an open spaces.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
@@ -26,153 +30,170 @@ 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.
|
||||
|
||||
|
||||
@@ -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,94 +32,138 @@ 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:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` | :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:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` | :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_FFTSize:
|
||||
|
||||
.. _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 **FFTSize**:
|
||||
|
||||
- **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:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` **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:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` enum.
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` **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:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` **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:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` **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:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` **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:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` **FFT_SIZE_MAX** = ``5``
|
||||
|
||||
Represents the size of the :ref:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` 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:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` **fft_size**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------+
|
||||
| *Default* | ``2`` |
|
||||
+-----------+---------------------+
|
||||
| *Setter* | set_fft_size(value) |
|
||||
+-----------+---------------------+
|
||||
| *Getter* | get_fft_size() |
|
||||
+-----------+---------------------+
|
||||
:ref:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` **fft_size** = ``2``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_fft_size** **(** :ref:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` value **)**
|
||||
- :ref:`FFTSize<enum_AudioEffectSpectrumAnalyzer_FFTSize>` **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
|
||||
|
||||
|
||||
@@ -16,34 +16,63 @@ AudioEffectSpectrumAnalyzerInstance
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -14,75 +14,91 @@ AudioEffectStereoEnhance
|
||||
|
||||
An audio effect that can be used to adjust the intensity of stereo panning.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
An audio effect that can be used to adjust the intensity of stereo panning.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Audio buses <../tutorials/audio/audio_buses>`
|
||||
|
||||
.. 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** **(** **)**
|
||||
|
||||
Values greater than 1.0 increase intensity of any panning on audio passing through this effect, whereas values less than 1.0 will decrease the panning intensity. A value of 0.0 will downmix audio to mono.
|
||||
|
||||
.. 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
|
||||
|
||||
|
||||
@@ -14,50 +14,73 @@ AudioListener2D
|
||||
|
||||
Overrides the location sounds are heard from.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Once added to the scene tree and enabled using :ref:`make_current<class_AudioListener2D_method_make_current>`, this node will override the location sounds are heard from. Only one ``AudioListener2D`` can be current. Using :ref:`make_current<class_AudioListener2D_method_make_current>` will disable the previous ``AudioListener2D``.
|
||||
Once added to the scene tree and enabled using :ref:`make_current<class_AudioListener2D_method_make_current>`, this node will override the location sounds are heard from. Only one **AudioListener2D** can be current. Using :ref:`make_current<class_AudioListener2D_method_make_current>` will disable the previous **AudioListener2D**.
|
||||
|
||||
If there is no active ``AudioListener2D`` in the current :ref:`Viewport<class_Viewport>`, center of the screen will be used as a hearing point for the audio. ``AudioListener2D`` needs to be inside :ref:`SceneTree<class_SceneTree>` to function.
|
||||
If there is no active **AudioListener2D** in the current :ref:`Viewport<class_Viewport>`, center of the screen will be used as a hearing point for the audio. **AudioListener2D** needs to be inside :ref:`SceneTree<class_SceneTree>` to function.
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| void | :ref:`clear_current<class_AudioListener2D_method_clear_current>` **(** **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_current<class_AudioListener2D_method_is_current>` **(** **)** |const| |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| void | :ref:`make_current<class_AudioListener2D_method_make_current>` **(** **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| void | :ref:`clear_current<class_AudioListener2D_method_clear_current>` **(** **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_current<class_AudioListener2D_method_is_current>` **(** **)** |const| |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
| void | :ref:`make_current<class_AudioListener2D_method_make_current>` **(** **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AudioListener2D_method_clear_current:
|
||||
|
||||
- void **clear_current** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Disables the ``AudioListener2D``. If it's not set as current, this method will have no effect.
|
||||
void **clear_current** **(** **)**
|
||||
|
||||
Disables the **AudioListener2D**. If it's not set as current, this method will have no effect.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioListener2D_method_is_current:
|
||||
|
||||
- :ref:`bool<class_bool>` **is_current** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Returns ``true`` if this ``AudioListener2D`` is currently active.
|
||||
:ref:`bool<class_bool>` **is_current** **(** **)** |const|
|
||||
|
||||
Returns ``true`` if this **AudioListener2D** is currently active.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioListener2D_method_make_current:
|
||||
|
||||
- void **make_current** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
Makes the ``AudioListener2D`` active, setting it as the hearing point for the sounds. If there is already another active ``AudioListener2D``, it will be disabled.
|
||||
void **make_current** **(** **)**
|
||||
|
||||
This method will have no effect if the ``AudioListener2D`` is not added to :ref:`SceneTree<class_SceneTree>`.
|
||||
Makes the **AudioListener2D** active, setting it as the hearing point for the sounds. If there is already another active **AudioListener2D**, it will be disabled.
|
||||
|
||||
This method will have no effect if the **AudioListener2D** is not added to :ref:`SceneTree<class_SceneTree>`.
|
||||
|
||||
.. |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.)`
|
||||
|
||||
@@ -14,56 +14,83 @@ AudioListener3D
|
||||
|
||||
Overrides the location sounds are heard from.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Once added to the scene tree and enabled using :ref:`make_current<class_AudioListener3D_method_make_current>`, this node will override the location sounds are heard from. This can be used to listen from a location different from the :ref:`Camera3D<class_Camera3D>`.
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+---------------------------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`clear_current<class_AudioListener3D_method_clear_current>` **(** **)** |
|
||||
+---------------------------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_listener_transform<class_AudioListener3D_method_get_listener_transform>` **(** **)** |const| |
|
||||
+---------------------------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_current<class_AudioListener3D_method_is_current>` **(** **)** |const| |
|
||||
+---------------------------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`make_current<class_AudioListener3D_method_make_current>` **(** **)** |
|
||||
+---------------------------------------+--------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`clear_current<class_AudioListener3D_method_clear_current>` **(** **)** |
|
||||
+---------------------------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Transform3D<class_Transform3D>` | :ref:`get_listener_transform<class_AudioListener3D_method_get_listener_transform>` **(** **)** |const| |
|
||||
+---------------------------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_current<class_AudioListener3D_method_is_current>` **(** **)** |const| |
|
||||
+---------------------------------------+--------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`make_current<class_AudioListener3D_method_make_current>` **(** **)** |
|
||||
+---------------------------------------+--------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AudioListener3D_method_clear_current:
|
||||
|
||||
- void **clear_current** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **clear_current** **(** **)**
|
||||
|
||||
Disables the listener to use the current camera's listener instead.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioListener3D_method_get_listener_transform:
|
||||
|
||||
- :ref:`Transform3D<class_Transform3D>` **get_listener_transform** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Transform3D<class_Transform3D>` **get_listener_transform** **(** **)** |const|
|
||||
|
||||
Returns the listener's global orthonormalized :ref:`Transform3D<class_Transform3D>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioListener3D_method_is_current:
|
||||
|
||||
- :ref:`bool<class_bool>` **is_current** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **is_current** **(** **)** |const|
|
||||
|
||||
Returns ``true`` if the listener was made current using :ref:`make_current<class_AudioListener3D_method_make_current>`, ``false`` otherwise.
|
||||
|
||||
\ **Note:** There may be more than one AudioListener3D marked as "current" in the scene tree, but only the one that was made current last will be used.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioListener3D_method_make_current:
|
||||
|
||||
- void **make_current** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **make_current** **(** **)**
|
||||
|
||||
Enables the listener. This will override the current camera's listener.
|
||||
|
||||
|
||||
@@ -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,517 +34,727 @@ 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:`playback_speed_scale<class_AudioServer_property_playback_speed_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:`playback_speed_scale<class_AudioServer_property_playback_speed_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:`PackedStringArray<class_PackedStringArray>` | :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:`StringName<class_StringName>` 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:`StringName<class_StringName>` | :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:`PackedStringArray<class_PackedStringArray>` | :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:`StringName<class_StringName>` 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:`set_enable_tagging_used_audio_streams<class_AudioServer_method_set_enable_tagging_used_audio_streams>` **(** :ref:`bool<class_bool>` enable **)** |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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:`PackedStringArray<class_PackedStringArray>` | :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:`StringName<class_StringName>` 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:`StringName<class_StringName>` | :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:`PackedStringArray<class_PackedStringArray>` | :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:`StringName<class_StringName>` 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:`set_enable_tagging_used_audio_streams<class_AudioServer_method_set_enable_tagging_used_audio_streams>` **(** :ref:`bool<class_bool>` enable **)** |
|
||||
+-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| 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/driver/enable_input<class_ProjectSettings_property_audio/driver/enable_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_playback_speed_scale:
|
||||
|
||||
- :ref:`float<class_float>` **playback_speed_scale**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------------------+
|
||||
| *Default* | ``1.0`` |
|
||||
+-----------+---------------------------------+
|
||||
| *Setter* | set_playback_speed_scale(value) |
|
||||
+-----------+---------------------------------+
|
||||
| *Getter* | get_playback_speed_scale() |
|
||||
+-----------+---------------------------------+
|
||||
:ref:`float<class_float>` **playback_speed_scale** = ``1.0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_playback_speed_scale** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_playback_speed_scale** **(** **)**
|
||||
|
||||
Scales the rate at which audio is played (i.e. setting it to ``0.5`` will make the audio be played at half its speed).
|
||||
|
||||
.. 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:`PackedStringArray<class_PackedStringArray>` **capture_get_device_list** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedStringArray<class_PackedStringArray>` **capture_get_device_list** **(** **)**
|
||||
|
||||
Returns the names of all audio input devices detected on the system.
|
||||
|
||||
\ **Note:** :ref:`ProjectSettings.audio/driver/enable_input<class_ProjectSettings_property_audio/driver/enable_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 number 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:`StringName<class_StringName>` bus_name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **get_bus_index** **(** :ref:`StringName<class_StringName>` 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:`StringName<class_StringName>` **get_bus_send** **(** :ref:`int<class_int>` bus_idx **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`StringName<class_StringName>` **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:`PackedStringArray<class_PackedStringArray>` **get_device_list** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedStringArray<class_PackedStringArray>` **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:`StringName<class_StringName>` send **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_bus_send** **(** :ref:`int<class_int>` bus_idx, :ref:`StringName<class_StringName>` 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_set_enable_tagging_used_audio_streams:
|
||||
|
||||
- void **set_enable_tagging_used_audio_streams** **(** :ref:`bool<class_bool>` enable **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_enable_tagging_used_audio_streams** **(** :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_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.)
|
||||
|
||||
|
||||
@@ -16,11 +16,15 @@ AudioStream
|
||||
|
||||
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:`AudioStreamWAV<class_AudioStreamWAV>`) and Ogg (via :ref:`AudioStreamOggVorbis<class_AudioStreamOggVorbis>`) file formats.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
@@ -32,111 +36,156 @@ Tutorials
|
||||
|
||||
- `Audio Spectrum Demo <https://godotengine.org/asset-library/asset/528>`__
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_get_beat_count<class_AudioStream_method__get_beat_count>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_get_bpm<class_AudioStream_method__get_bpm>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_get_length<class_AudioStream_method__get_length>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`_get_stream_name<class_AudioStream_method__get_stream_name>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`_instantiate_playback<class_AudioStream_method__instantiate_playback>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_is_monophonic<class_AudioStream_method__is_monophonic>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_length<class_AudioStream_method_get_length>` **(** **)** |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`instantiate_playback<class_AudioStream_method_instantiate_playback>` **(** **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_monophonic<class_AudioStream_method_is_monophonic>` **(** **)** |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_get_beat_count<class_AudioStream_method__get_beat_count>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_get_bpm<class_AudioStream_method__get_bpm>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_get_length<class_AudioStream_method__get_length>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`_get_stream_name<class_AudioStream_method__get_stream_name>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`_instantiate_playback<class_AudioStream_method__instantiate_playback>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_is_monophonic<class_AudioStream_method__is_monophonic>` **(** **)** |virtual| |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_length<class_AudioStream_method_get_length>` **(** **)** |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`instantiate_playback<class_AudioStream_method_instantiate_playback>` **(** **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_monophonic<class_AudioStream_method_is_monophonic>` **(** **)** |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AudioStream_method__get_beat_count:
|
||||
|
||||
- :ref:`int<class_int>` **_get_beat_count** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **_get_beat_count** **(** **)** |virtual| |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_AudioStream_method__get_bpm:
|
||||
|
||||
- :ref:`float<class_float>` **_get_bpm** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_get_bpm** **(** **)** |virtual| |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_AudioStream_method__get_length:
|
||||
|
||||
- :ref:`float<class_float>` **_get_length** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_get_length** **(** **)** |virtual| |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_AudioStream_method__get_stream_name:
|
||||
|
||||
- :ref:`String<class_String>` **_get_stream_name** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`String<class_String>` **_get_stream_name** **(** **)** |virtual| |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_AudioStream_method__instantiate_playback:
|
||||
|
||||
- :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **_instantiate_playback** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **_instantiate_playback** **(** **)** |virtual| |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_AudioStream_method__is_monophonic:
|
||||
|
||||
- :ref:`bool<class_bool>` **_is_monophonic** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **_is_monophonic** **(** **)** |virtual| |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_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.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStream_method_instantiate_playback:
|
||||
|
||||
- :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **instantiate_playback** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **instantiate_playback** **(** **)**
|
||||
|
||||
Returns an AudioStreamPlayback. Useful for when you want to extend :ref:`_instantiate_playback<class_AudioStream_method__instantiate_playback>` but call :ref:`instantiate_playback<class_AudioStream_method_instantiate_playback>` from an internally held AudioStream subresource. An example of this can be found in the source files for ``AudioStreamRandomPitch::instantiate_playback``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStream_method_is_monophonic:
|
||||
|
||||
- :ref:`bool<class_bool>` **is_monophonic** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **is_monophonic** **(** **)** |const|
|
||||
|
||||
Returns true if this audio stream only supports monophonic playback, or false if the audio stream supports polyphony.
|
||||
|
||||
|
||||
@@ -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 GDExtension. 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.
|
||||
|
||||
|
||||
@@ -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,71 +30,104 @@ 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:`PackedVector2Array<class_PackedVector2Array>` 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:`PackedVector2Array<class_PackedVector2Array>` 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
|
||||
|
||||
: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:`PackedVector2Array<class_PackedVector2Array>` frames **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **push_buffer** **(** :ref:`PackedVector2Array<class_PackedVector2Array>` 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 GDExtension, 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 GDExtension, but :ref:`push_frame<class_AudioStreamGeneratorPlayback_method_push_frame>` may be *more* efficient in GDScript.
|
||||
|
||||
|
||||
@@ -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/driver/enable_input<class_ProjectSettings_property_audio/driver/enable_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
|
||||
---------
|
||||
|
||||
|
||||
@@ -14,96 +14,111 @@ AudioStreamMP3
|
||||
|
||||
MP3 audio stream driver.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
MP3 audio stream driver. See :ref:`data<class_AudioStreamMP3_property_data>` if you want to load an MP3 file at run-time.
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-----------------------------------------------+---------------------------------------------------------------+-----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`bar_beats<class_AudioStreamMP3_property_bar_beats>` | ``4`` |
|
||||
+-----------------------------------------------+---------------------------------------------------------------+-----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`beat_count<class_AudioStreamMP3_property_beat_count>` | ``0`` |
|
||||
+-----------------------------------------------+---------------------------------------------------------------+-----------------------+
|
||||
| :ref:`float<class_float>` | :ref:`bpm<class_AudioStreamMP3_property_bpm>` | ``0.0`` |
|
||||
+-----------------------------------------------+---------------------------------------------------------------+-----------------------+
|
||||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`data<class_AudioStreamMP3_property_data>` | ``PackedByteArray()`` |
|
||||
+-----------------------------------------------+---------------------------------------------------------------+-----------------------+
|
||||
| :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:`int<class_int>` | :ref:`bar_beats<class_AudioStreamMP3_property_bar_beats>` | ``4`` |
|
||||
+-----------------------------------------------+---------------------------------------------------------------+-----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`beat_count<class_AudioStreamMP3_property_beat_count>` | ``0`` |
|
||||
+-----------------------------------------------+---------------------------------------------------------------+-----------------------+
|
||||
| :ref:`float<class_float>` | :ref:`bpm<class_AudioStreamMP3_property_bpm>` | ``0.0`` |
|
||||
+-----------------------------------------------+---------------------------------------------------------------+-----------------------+
|
||||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`data<class_AudioStreamMP3_property_data>` | ``PackedByteArray()`` |
|
||||
+-----------------------------------------------+---------------------------------------------------------------+-----------------------+
|
||||
| :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_bar_beats:
|
||||
|
||||
- :ref:`int<class_int>` **bar_beats**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``4`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_bar_beats(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_bar_beats() |
|
||||
+-----------+----------------------+
|
||||
:ref:`int<class_int>` **bar_beats** = ``4``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_bar_beats** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_bar_beats** **(** **)**
|
||||
|
||||
.. 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_AudioStreamMP3_property_beat_count:
|
||||
|
||||
- :ref:`int<class_int>` **beat_count**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-----------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+-----------------------+
|
||||
| *Setter* | set_beat_count(value) |
|
||||
+-----------+-----------------------+
|
||||
| *Getter* | get_beat_count() |
|
||||
+-----------+-----------------------+
|
||||
:ref:`int<class_int>` **beat_count** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_beat_count** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_beat_count** **(** **)**
|
||||
|
||||
.. 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_AudioStreamMP3_property_bpm:
|
||||
|
||||
- :ref:`float<class_float>` **bpm**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------+
|
||||
| *Default* | ``0.0`` |
|
||||
+-----------+----------------+
|
||||
| *Setter* | set_bpm(value) |
|
||||
+-----------+----------------+
|
||||
| *Getter* | get_bpm() |
|
||||
+-----------+----------------+
|
||||
:ref:`float<class_float>` **bpm** = ``0.0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_bpm** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_bpm** **(** **)**
|
||||
|
||||
.. 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_AudioStreamMP3_property_data:
|
||||
|
||||
- :ref:`PackedByteArray<class_PackedByteArray>` **data**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-----------------------+
|
||||
| *Default* | ``PackedByteArray()`` |
|
||||
+-----------+-----------------------+
|
||||
| *Setter* | set_data(value) |
|
||||
+-----------+-----------------------+
|
||||
| *Getter* | get_data() |
|
||||
+-----------+-----------------------+
|
||||
:ref:`PackedByteArray<class_PackedByteArray>` **data** = ``PackedByteArray()``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_data** **(** :ref:`PackedByteArray<class_PackedByteArray>` value **)**
|
||||
- :ref:`PackedByteArray<class_PackedByteArray>` **get_data** **(** **)**
|
||||
|
||||
Contains the audio data in bytes.
|
||||
|
||||
@@ -136,35 +151,37 @@ You can load a file without having to import it beforehand using the code snippe
|
||||
|
||||
|
||||
|
||||
.. 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.
|
||||
|
||||
|
||||
@@ -16,121 +16,138 @@ AudioStreamOggVorbis
|
||||
|
||||
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:`int<class_int>` | :ref:`bar_beats<class_AudioStreamOggVorbis_property_bar_beats>` | ``4`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`int<class_int>` | :ref:`beat_count<class_AudioStreamOggVorbis_property_beat_count>` | ``0`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`float<class_float>` | :ref:`bpm<class_AudioStreamOggVorbis_property_bpm>` | ``0.0`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :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`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`OggPacketSequence<class_OggPacketSequence>` | :ref:`packet_sequence<class_AudioStreamOggVorbis_property_packet_sequence>` | |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`int<class_int>` | :ref:`bar_beats<class_AudioStreamOggVorbis_property_bar_beats>` | ``4`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`int<class_int>` | :ref:`beat_count<class_AudioStreamOggVorbis_property_beat_count>` | ``0`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`float<class_float>` | :ref:`bpm<class_AudioStreamOggVorbis_property_bpm>` | ``0.0`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :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`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
| :ref:`OggPacketSequence<class_OggPacketSequence>` | :ref:`packet_sequence<class_AudioStreamOggVorbis_property_packet_sequence>` | |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+-----------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AudioStreamOggVorbis_property_bar_beats:
|
||||
|
||||
- :ref:`int<class_int>` **bar_beats**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``4`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_bar_beats(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_bar_beats() |
|
||||
+-----------+----------------------+
|
||||
:ref:`int<class_int>` **bar_beats** = ``4``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_bar_beats** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_bar_beats** **(** **)**
|
||||
|
||||
.. 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_AudioStreamOggVorbis_property_beat_count:
|
||||
|
||||
- :ref:`int<class_int>` **beat_count**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-----------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+-----------------------+
|
||||
| *Setter* | set_beat_count(value) |
|
||||
+-----------+-----------------------+
|
||||
| *Getter* | get_beat_count() |
|
||||
+-----------+-----------------------+
|
||||
:ref:`int<class_int>` **beat_count** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_beat_count** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_beat_count** **(** **)**
|
||||
|
||||
.. 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_AudioStreamOggVorbis_property_bpm:
|
||||
|
||||
- :ref:`float<class_float>` **bpm**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------+
|
||||
| *Default* | ``0.0`` |
|
||||
+-----------+----------------+
|
||||
| *Setter* | set_bpm(value) |
|
||||
+-----------+----------------+
|
||||
| *Getter* | get_bpm() |
|
||||
+-----------+----------------+
|
||||
:ref:`float<class_float>` **bpm** = ``0.0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_bpm** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_bpm** **(** **)**
|
||||
|
||||
.. 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_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.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamOggVorbis_property_packet_sequence:
|
||||
|
||||
- :ref:`OggPacketSequence<class_OggPacketSequence>` **packet_sequence**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+----------+----------------------------+
|
||||
| *Setter* | set_packet_sequence(value) |
|
||||
+----------+----------------------------+
|
||||
| *Getter* | get_packet_sequence() |
|
||||
+----------+----------------------------+
|
||||
:ref:`OggPacketSequence<class_OggPacketSequence>` **packet_sequence**
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_packet_sequence** **(** :ref:`OggPacketSequence<class_OggPacketSequence>` value **)**
|
||||
- :ref:`OggPacketSequence<class_OggPacketSequence>` **get_packet_sequence** **(** **)**
|
||||
|
||||
Contains the raw Ogg data for this stream.
|
||||
|
||||
|
||||
@@ -16,113 +16,158 @@ 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
|
||||
---------
|
||||
|
||||
- `Audio Generator Demo <https://godotengine.org/asset-library/asset/526>`__
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_get_loop_count<class_AudioStreamPlayback_method__get_loop_count>` **(** **)** |virtual| |const| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_get_playback_position<class_AudioStreamPlayback_method__get_playback_position>` **(** **)** |virtual| |const| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_is_playing<class_AudioStreamPlayback_method__is_playing>` **(** **)** |virtual| |const| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_mix<class_AudioStreamPlayback_method__mix>` **(** AudioFrame* buffer, :ref:`float<class_float>` rate_scale, :ref:`int<class_int>` frames **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`_seek<class_AudioStreamPlayback_method__seek>` **(** :ref:`float<class_float>` position **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`_start<class_AudioStreamPlayback_method__start>` **(** :ref:`float<class_float>` from_pos **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`_stop<class_AudioStreamPlayback_method__stop>` **(** **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`_tag_used_streams<class_AudioStreamPlayback_method__tag_used_streams>` **(** **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_get_loop_count<class_AudioStreamPlayback_method__get_loop_count>` **(** **)** |virtual| |const| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_get_playback_position<class_AudioStreamPlayback_method__get_playback_position>` **(** **)** |virtual| |const| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`_is_playing<class_AudioStreamPlayback_method__is_playing>` **(** **)** |virtual| |const| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_mix<class_AudioStreamPlayback_method__mix>` **(** AudioFrame* buffer, :ref:`float<class_float>` rate_scale, :ref:`int<class_int>` frames **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`_seek<class_AudioStreamPlayback_method__seek>` **(** :ref:`float<class_float>` position **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`_start<class_AudioStreamPlayback_method__start>` **(** :ref:`float<class_float>` from_pos **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`_stop<class_AudioStreamPlayback_method__stop>` **(** **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`_tag_used_streams<class_AudioStreamPlayback_method__tag_used_streams>` **(** **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AudioStreamPlayback_method__get_loop_count:
|
||||
|
||||
- :ref:`int<class_int>` **_get_loop_count** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **_get_loop_count** **(** **)** |virtual| |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_AudioStreamPlayback_method__get_playback_position:
|
||||
|
||||
- :ref:`float<class_float>` **_get_playback_position** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_get_playback_position** **(** **)** |virtual| |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_AudioStreamPlayback_method__is_playing:
|
||||
|
||||
- :ref:`bool<class_bool>` **_is_playing** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **_is_playing** **(** **)** |virtual| |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_AudioStreamPlayback_method__mix:
|
||||
|
||||
- :ref:`int<class_int>` **_mix** **(** AudioFrame* buffer, :ref:`float<class_float>` rate_scale, :ref:`int<class_int>` frames **)** |virtual|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **_mix** **(** AudioFrame* buffer, :ref:`float<class_float>` rate_scale, :ref:`int<class_int>` frames **)** |virtual|
|
||||
|
||||
.. 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_AudioStreamPlayback_method__seek:
|
||||
|
||||
- void **_seek** **(** :ref:`float<class_float>` position **)** |virtual|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **_seek** **(** :ref:`float<class_float>` position **)** |virtual|
|
||||
|
||||
.. 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_AudioStreamPlayback_method__start:
|
||||
|
||||
- void **_start** **(** :ref:`float<class_float>` from_pos **)** |virtual|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **_start** **(** :ref:`float<class_float>` from_pos **)** |virtual|
|
||||
|
||||
.. 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_AudioStreamPlayback_method__stop:
|
||||
|
||||
- void **_stop** **(** **)** |virtual|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **_stop** **(** **)** |virtual|
|
||||
|
||||
.. 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_AudioStreamPlayback_method__tag_used_streams:
|
||||
|
||||
- void **_tag_used_streams** **(** **)** |virtual|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **_tag_used_streams** **(** **)** |virtual|
|
||||
|
||||
.. container:: contribute
|
||||
|
||||
|
||||
@@ -18,43 +18,64 @@ AudioStreamPlaybackResampled
|
||||
|
||||
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:`float<class_float>` | :ref:`_get_stream_sampling_rate<class_AudioStreamPlaybackResampled_method__get_stream_sampling_rate>` **(** **)** |virtual| |const| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_mix_resampled<class_AudioStreamPlaybackResampled_method__mix_resampled>` **(** AudioFrame* dst_buffer, :ref:`int<class_int>` frame_count **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`begin_resample<class_AudioStreamPlaybackResampled_method_begin_resample>` **(** **)** |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`_get_stream_sampling_rate<class_AudioStreamPlaybackResampled_method__get_stream_sampling_rate>` **(** **)** |virtual| |const| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`_mix_resampled<class_AudioStreamPlaybackResampled_method__mix_resampled>` **(** AudioFrame* dst_buffer, :ref:`int<class_int>` frame_count **)** |virtual| |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`begin_resample<class_AudioStreamPlaybackResampled_method_begin_resample>` **(** **)** |
|
||||
+---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AudioStreamPlaybackResampled_method__get_stream_sampling_rate:
|
||||
|
||||
- :ref:`float<class_float>` **_get_stream_sampling_rate** **(** **)** |virtual| |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **_get_stream_sampling_rate** **(** **)** |virtual| |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_AudioStreamPlaybackResampled_method__mix_resampled:
|
||||
|
||||
- :ref:`int<class_int>` **_mix_resampled** **(** AudioFrame* dst_buffer, :ref:`int<class_int>` frame_count **)** |virtual|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **_mix_resampled** **(** AudioFrame* dst_buffer, :ref:`int<class_int>` frame_count **)** |virtual|
|
||||
|
||||
.. 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_AudioStreamPlaybackResampled_method_begin_resample:
|
||||
|
||||
- void **begin_resample** **(** **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **begin_resample** **(** **)**
|
||||
|
||||
.. container:: contribute
|
||||
|
||||
|
||||
@@ -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,253 +40,331 @@ 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:`StringName<class_StringName>` | :ref:`bus<class_AudioStreamPlayer_property_bus>` | ``&"Master"`` |
|
||||
+----------------------------------------------------+----------------------------------------------------------------------+---------------+
|
||||
| :ref:`int<class_int>` | :ref:`max_polyphony<class_AudioStreamPlayer_property_max_polyphony>` | ``1`` |
|
||||
+----------------------------------------------------+----------------------------------------------------------------------+---------------+
|
||||
| :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:`StringName<class_StringName>` | :ref:`bus<class_AudioStreamPlayer_property_bus>` | ``&"Master"`` |
|
||||
+----------------------------------------------------+----------------------------------------------------------------------+---------------+
|
||||
| :ref:`int<class_int>` | :ref:`max_polyphony<class_AudioStreamPlayer_property_max_polyphony>` | ``1`` |
|
||||
+----------------------------------------------------+----------------------------------------------------------------------+---------------+
|
||||
| :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:`StringName<class_StringName>` **bus**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------+
|
||||
| *Default* | ``&"Master"`` |
|
||||
+-----------+----------------+
|
||||
| *Setter* | set_bus(value) |
|
||||
+-----------+----------------+
|
||||
| *Getter* | get_bus() |
|
||||
+-----------+----------------+
|
||||
:ref:`StringName<class_StringName>` **bus** = ``&"Master"``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_bus** **(** :ref:`StringName<class_StringName>` value **)**
|
||||
- :ref:`StringName<class_StringName>` **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_max_polyphony:
|
||||
|
||||
- :ref:`int<class_int>` **max_polyphony**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+--------------------------+
|
||||
| *Default* | ``1`` |
|
||||
+-----------+--------------------------+
|
||||
| *Setter* | set_max_polyphony(value) |
|
||||
+-----------+--------------------------+
|
||||
| *Getter* | get_max_polyphony() |
|
||||
+-----------+--------------------------+
|
||||
:ref:`int<class_int>` **max_polyphony** = ``1``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_max_polyphony** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_max_polyphony** **(** **)**
|
||||
|
||||
The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds.
|
||||
|
||||
.. 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.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AudioStreamPlayer2D
|
||||
|
||||
Plays positional sound in 2D space.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -23,295 +25,358 @@ 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:`Audio streams <../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:`StringName<class_StringName>` | :ref:`bus<class_AudioStreamPlayer2D_property_bus>` | ``&"Master"`` |
|
||||
+---------------------------------------+------------------------------------------------------------------------------+---------------+
|
||||
| :ref:`float<class_float>` | :ref:`max_distance<class_AudioStreamPlayer2D_property_max_distance>` | ``2000.0`` |
|
||||
+---------------------------------------+------------------------------------------------------------------------------+---------------+
|
||||
| :ref:`int<class_int>` | :ref:`max_polyphony<class_AudioStreamPlayer2D_property_max_polyphony>` | ``1`` |
|
||||
+---------------------------------------+------------------------------------------------------------------------------+---------------+
|
||||
| :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:`StringName<class_StringName>` | :ref:`bus<class_AudioStreamPlayer2D_property_bus>` | ``&"Master"`` |
|
||||
+---------------------------------------+------------------------------------------------------------------------------+---------------+
|
||||
| :ref:`float<class_float>` | :ref:`max_distance<class_AudioStreamPlayer2D_property_max_distance>` | ``2000.0`` |
|
||||
+---------------------------------------+------------------------------------------------------------------------------+---------------+
|
||||
| :ref:`int<class_int>` | :ref:`max_polyphony<class_AudioStreamPlayer2D_property_max_polyphony>` | ``1`` |
|
||||
+---------------------------------------+------------------------------------------------------------------------------+---------------+
|
||||
| :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:`StringName<class_StringName>` **bus**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------+
|
||||
| *Default* | ``&"Master"`` |
|
||||
+-----------+----------------+
|
||||
| *Setter* | set_bus(value) |
|
||||
+-----------+----------------+
|
||||
| *Getter* | get_bus() |
|
||||
+-----------+----------------+
|
||||
:ref:`StringName<class_StringName>` **bus** = ``&"Master"``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_bus** **(** :ref:`StringName<class_StringName>` value **)**
|
||||
- :ref:`StringName<class_StringName>` **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_max_polyphony:
|
||||
|
||||
- :ref:`int<class_int>` **max_polyphony**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+--------------------------+
|
||||
| *Default* | ``1`` |
|
||||
+-----------+--------------------------+
|
||||
| *Setter* | set_max_polyphony(value) |
|
||||
+-----------+--------------------------+
|
||||
| *Getter* | get_max_polyphony() |
|
||||
+-----------+--------------------------+
|
||||
:ref:`int<class_int>` **max_polyphony** = ``1``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_max_polyphony** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_max_polyphony** **(** **)**
|
||||
|
||||
The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds.
|
||||
|
||||
.. 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/general/2d_panning_strength<class_ProjectSettings_property_audio/general/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``
|
||||
|
||||
If ``true``, audio is playing.
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- :ref:`bool<class_bool>` **is_playing** **(** **)**
|
||||
|
||||
If ``true``, audio is playing or is queued to be played (see :ref:`play<class_AudioStreamPlayer2D_method_play>`).
|
||||
|
||||
.. 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
|
||||
|
||||
Plays the audio from the given position ``from_position``, in seconds.
|
||||
void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
|
||||
|
||||
Queues the audio to play on the next physics frame, 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.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AudioStreamPlayer3D
|
||||
|
||||
Plays positional sound in 3D space.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -23,480 +25,591 @@ 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:`volume_db<class_AudioStreamPlayer3D_property_volume_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:`volume_db<class_AudioStreamPlayer3D_property_volume_db>` to a very low value like ``-100`` (which isn't audible to human hearing).
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Audio streams <../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:`StringName<class_StringName>` | :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:`int<class_int>` | :ref:`max_polyphony<class_AudioStreamPlayer3D_property_max_polyphony>` | ``1`` |
|
||||
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
|
||||
| :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_size<class_AudioStreamPlayer3D_property_unit_size>` | ``10.0`` |
|
||||
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
|
||||
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioStreamPlayer3D_property_volume_db>` | ``0.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:`StringName<class_StringName>` | :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:`int<class_int>` | :ref:`max_polyphony<class_AudioStreamPlayer3D_property_max_polyphony>` | ``1`` |
|
||||
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
|
||||
| :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_size<class_AudioStreamPlayer3D_property_unit_size>` | ``10.0`` |
|
||||
+--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
|
||||
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioStreamPlayer3D_property_volume_db>` | ``0.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_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.
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
- **DOPPLER_TRACKING_PHYSICS_STEP** = **2** --- Executes doppler tracking in physics step.
|
||||
: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.
|
||||
|
||||
.. _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.
|
||||
|
||||
.. 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:`Area3D<class_Area3D>` 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:`StringName<class_StringName>` **bus**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------+
|
||||
| *Default* | ``&"Master"`` |
|
||||
+-----------+----------------+
|
||||
| *Setter* | set_bus(value) |
|
||||
+-----------+----------------+
|
||||
| *Getter* | get_bus() |
|
||||
+-----------+----------------+
|
||||
:ref:`StringName<class_StringName>` **bus** = ``&"Master"``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_bus** **(** :ref:`StringName<class_StringName>` value **)**
|
||||
- :ref:`StringName<class_StringName>` **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 should be calculated.
|
||||
|
||||
.. 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``
|
||||
|
||||
The distance past which the sound can no longer be heard at all. Only has an effect if set to a value greater than ``0.0``. :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` works in tandem with :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>`. However, unlike :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>` whose behavior depends on the :ref:`attenuation_model<class_AudioStreamPlayer3D_property_attenuation_model>`, :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` always works in a linear fashion. This can be used to prevent the ``AudioStreamPlayer3D`` from requiring audio mixing when the listener is far away, which saves CPU resources.
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_max_distance** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_max_distance** **(** **)**
|
||||
|
||||
The distance past which the sound can no longer be heard at all. Only has an effect if set to a value greater than ``0.0``. :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` works in tandem with :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>`. However, unlike :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>` whose behavior depends on the :ref:`attenuation_model<class_AudioStreamPlayer3D_property_attenuation_model>`, :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` always works in a linear fashion. This can be used to prevent the **AudioStreamPlayer3D** from requiring audio mixing when the listener is far away, which saves CPU resources.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamPlayer3D_property_max_polyphony:
|
||||
|
||||
- :ref:`int<class_int>` **max_polyphony**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+--------------------------+
|
||||
| *Default* | ``1`` |
|
||||
+-----------+--------------------------+
|
||||
| *Setter* | set_max_polyphony(value) |
|
||||
+-----------+--------------------------+
|
||||
| *Getter* | get_max_polyphony() |
|
||||
+-----------+--------------------------+
|
||||
:ref:`int<class_int>` **max_polyphony** = ``1``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_max_polyphony** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_max_polyphony** **(** **)**
|
||||
|
||||
The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds.
|
||||
|
||||
.. 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/general/3d_panning_strength<class_ProjectSettings_property_audio/general/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``
|
||||
|
||||
If ``true``, audio is playing.
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- :ref:`bool<class_bool>` **is_playing** **(** **)**
|
||||
|
||||
If ``true``, audio is playing or is queued to be played (see :ref:`play<class_AudioStreamPlayer3D_method_play>`).
|
||||
|
||||
.. 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_size:
|
||||
|
||||
- :ref:`float<class_float>` **unit_size**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``10.0`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_unit_size(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_unit_size() |
|
||||
+-----------+----------------------+
|
||||
:ref:`float<class_float>` **unit_size** = ``10.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-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamPlayer3D_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** **(** **)**
|
||||
|
||||
The base sound level unaffected by dampening, in decibels.
|
||||
|
||||
.. 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
|
||||
|
||||
Plays the audio from the given position ``from_position``, in seconds.
|
||||
void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
|
||||
|
||||
Queues the audio to play on the next physics frame, 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.
|
||||
|
||||
|
||||
@@ -14,181 +14,253 @@ AudioStreamRandomizer
|
||||
|
||||
Wraps a pool of audio streams with pitch and volume shifting.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Picks a random AudioStream from the pool, depending on the playback mode, and applies random pitch shifting and volume shifting during playback.
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------+---------+
|
||||
| :ref:`PlaybackMode<enum_AudioStreamRandomizer_PlaybackMode>` | :ref:`playback_mode<class_AudioStreamRandomizer_property_playback_mode>` | ``0`` |
|
||||
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------+---------+
|
||||
| :ref:`float<class_float>` | :ref:`random_pitch<class_AudioStreamRandomizer_property_random_pitch>` | ``1.1`` |
|
||||
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------+---------+
|
||||
| :ref:`float<class_float>` | :ref:`random_volume_offset_db<class_AudioStreamRandomizer_property_random_volume_offset_db>` | ``5.0`` |
|
||||
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------+---------+
|
||||
| :ref:`int<class_int>` | :ref:`streams_count<class_AudioStreamRandomizer_property_streams_count>` | ``0`` |
|
||||
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------+---------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------+---------+
|
||||
| :ref:`PlaybackMode<enum_AudioStreamRandomizer_PlaybackMode>` | :ref:`playback_mode<class_AudioStreamRandomizer_property_playback_mode>` | ``0`` |
|
||||
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------+---------+
|
||||
| :ref:`float<class_float>` | :ref:`random_pitch<class_AudioStreamRandomizer_property_random_pitch>` | ``1.1`` |
|
||||
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------+---------+
|
||||
| :ref:`float<class_float>` | :ref:`random_volume_offset_db<class_AudioStreamRandomizer_property_random_volume_offset_db>` | ``5.0`` |
|
||||
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------+---------+
|
||||
| :ref:`int<class_int>` | :ref:`streams_count<class_AudioStreamRandomizer_property_streams_count>` | ``0`` |
|
||||
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------+---------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_stream<class_AudioStreamRandomizer_method_add_stream>` **(** :ref:`int<class_int>` index **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioStream<class_AudioStream>` | :ref:`get_stream<class_AudioStreamRandomizer_method_get_stream>` **(** :ref:`int<class_int>` index **)** |const| |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_stream_probability_weight<class_AudioStreamRandomizer_method_get_stream_probability_weight>` **(** :ref:`int<class_int>` index **)** |const| |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`move_stream<class_AudioStreamRandomizer_method_move_stream>` **(** :ref:`int<class_int>` index_from, :ref:`int<class_int>` index_to **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_stream<class_AudioStreamRandomizer_method_remove_stream>` **(** :ref:`int<class_int>` index **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_stream<class_AudioStreamRandomizer_method_set_stream>` **(** :ref:`int<class_int>` index, :ref:`AudioStream<class_AudioStream>` stream **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_stream_probability_weight<class_AudioStreamRandomizer_method_set_stream_probability_weight>` **(** :ref:`int<class_int>` index, :ref:`float<class_float>` weight **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`add_stream<class_AudioStreamRandomizer_method_add_stream>` **(** :ref:`int<class_int>` index **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`AudioStream<class_AudioStream>` | :ref:`get_stream<class_AudioStreamRandomizer_method_get_stream>` **(** :ref:`int<class_int>` index **)** |const| |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_stream_probability_weight<class_AudioStreamRandomizer_method_get_stream_probability_weight>` **(** :ref:`int<class_int>` index **)** |const| |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`move_stream<class_AudioStreamRandomizer_method_move_stream>` **(** :ref:`int<class_int>` index_from, :ref:`int<class_int>` index_to **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_stream<class_AudioStreamRandomizer_method_remove_stream>` **(** :ref:`int<class_int>` index **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_stream<class_AudioStreamRandomizer_method_set_stream>` **(** :ref:`int<class_int>` index, :ref:`AudioStream<class_AudioStream>` stream **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_stream_probability_weight<class_AudioStreamRandomizer_method_set_stream_probability_weight>` **(** :ref:`int<class_int>` index, :ref:`float<class_float>` weight **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Enumerations
|
||||
------------
|
||||
|
||||
.. _enum_AudioStreamRandomizer_PlaybackMode:
|
||||
|
||||
.. _class_AudioStreamRandomizer_constant_PLAYBACK_RANDOM_NO_REPEATS:
|
||||
|
||||
.. _class_AudioStreamRandomizer_constant_PLAYBACK_RANDOM:
|
||||
|
||||
.. _class_AudioStreamRandomizer_constant_PLAYBACK_SEQUENTIAL:
|
||||
.. rst-class:: classref-enumeration
|
||||
|
||||
enum **PlaybackMode**:
|
||||
|
||||
- **PLAYBACK_RANDOM_NO_REPEATS** = **0** --- Pick a stream at random according to the probability weights chosen for each stream, but avoid playing the same stream twice in a row whenever possible.
|
||||
.. _class_AudioStreamRandomizer_constant_PLAYBACK_RANDOM_NO_REPEATS:
|
||||
|
||||
- **PLAYBACK_RANDOM** = **1** --- Pick a stream at random according to the probability weights chosen for each stream.
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
- **PLAYBACK_SEQUENTIAL** = **2** --- Play streams in the order they appear in the stream pool.
|
||||
:ref:`PlaybackMode<enum_AudioStreamRandomizer_PlaybackMode>` **PLAYBACK_RANDOM_NO_REPEATS** = ``0``
|
||||
|
||||
Pick a stream at random according to the probability weights chosen for each stream, but avoid playing the same stream twice in a row whenever possible.
|
||||
|
||||
.. _class_AudioStreamRandomizer_constant_PLAYBACK_RANDOM:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`PlaybackMode<enum_AudioStreamRandomizer_PlaybackMode>` **PLAYBACK_RANDOM** = ``1``
|
||||
|
||||
Pick a stream at random according to the probability weights chosen for each stream.
|
||||
|
||||
.. _class_AudioStreamRandomizer_constant_PLAYBACK_SEQUENTIAL:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`PlaybackMode<enum_AudioStreamRandomizer_PlaybackMode>` **PLAYBACK_SEQUENTIAL** = ``2``
|
||||
|
||||
Play streams in the order they appear in the stream pool.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AudioStreamRandomizer_property_playback_mode:
|
||||
|
||||
- :ref:`PlaybackMode<enum_AudioStreamRandomizer_PlaybackMode>` **playback_mode**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+--------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+--------------------------+
|
||||
| *Setter* | set_playback_mode(value) |
|
||||
+-----------+--------------------------+
|
||||
| *Getter* | get_playback_mode() |
|
||||
+-----------+--------------------------+
|
||||
:ref:`PlaybackMode<enum_AudioStreamRandomizer_PlaybackMode>` **playback_mode** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_playback_mode** **(** :ref:`PlaybackMode<enum_AudioStreamRandomizer_PlaybackMode>` value **)**
|
||||
- :ref:`PlaybackMode<enum_AudioStreamRandomizer_PlaybackMode>` **get_playback_mode** **(** **)**
|
||||
|
||||
Controls how this AudioStreamRandomizer picks which AudioStream to play next.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamRandomizer_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. A value of 1 means no variation.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamRandomizer_property_random_volume_offset_db:
|
||||
|
||||
- :ref:`float<class_float>` **random_volume_offset_db**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------------------------+
|
||||
| *Default* | ``5.0`` |
|
||||
+-----------+------------------------------------+
|
||||
| *Setter* | set_random_volume_offset_db(value) |
|
||||
+-----------+------------------------------------+
|
||||
| *Getter* | get_random_volume_offset_db() |
|
||||
+-----------+------------------------------------+
|
||||
:ref:`float<class_float>` **random_volume_offset_db** = ``5.0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_random_volume_offset_db** **(** :ref:`float<class_float>` value **)**
|
||||
- :ref:`float<class_float>` **get_random_volume_offset_db** **(** **)**
|
||||
|
||||
The intensity of random volume variation. A value of 0 means no variation.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamRandomizer_property_streams_count:
|
||||
|
||||
- :ref:`int<class_int>` **streams_count**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+--------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+--------------------------+
|
||||
| *Setter* | set_streams_count(value) |
|
||||
+-----------+--------------------------+
|
||||
| *Getter* | get_streams_count() |
|
||||
+-----------+--------------------------+
|
||||
:ref:`int<class_int>` **streams_count** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_streams_count** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_streams_count** **(** **)**
|
||||
|
||||
The number of streams in the stream pool.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_AudioStreamRandomizer_method_add_stream:
|
||||
|
||||
- void **add_stream** **(** :ref:`int<class_int>` index **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **add_stream** **(** :ref:`int<class_int>` index **)**
|
||||
|
||||
Insert a stream at the specified index.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamRandomizer_method_get_stream:
|
||||
|
||||
- :ref:`AudioStream<class_AudioStream>` **get_stream** **(** :ref:`int<class_int>` index **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`AudioStream<class_AudioStream>` **get_stream** **(** :ref:`int<class_int>` index **)** |const|
|
||||
|
||||
Returns the stream at the specified index.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamRandomizer_method_get_stream_probability_weight:
|
||||
|
||||
- :ref:`float<class_float>` **get_stream_probability_weight** **(** :ref:`int<class_int>` index **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **get_stream_probability_weight** **(** :ref:`int<class_int>` index **)** |const|
|
||||
|
||||
Returns the probability weight associated with the stream at the given index.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamRandomizer_method_move_stream:
|
||||
|
||||
- void **move_stream** **(** :ref:`int<class_int>` index_from, :ref:`int<class_int>` index_to **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **move_stream** **(** :ref:`int<class_int>` index_from, :ref:`int<class_int>` index_to **)**
|
||||
|
||||
Move a stream from one index to another.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamRandomizer_method_remove_stream:
|
||||
|
||||
- void **remove_stream** **(** :ref:`int<class_int>` index **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **remove_stream** **(** :ref:`int<class_int>` index **)**
|
||||
|
||||
Remove the stream at the specified index.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamRandomizer_method_set_stream:
|
||||
|
||||
- void **set_stream** **(** :ref:`int<class_int>` index, :ref:`AudioStream<class_AudioStream>` stream **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_stream** **(** :ref:`int<class_int>` index, :ref:`AudioStream<class_AudioStream>` stream **)**
|
||||
|
||||
Set the AudioStream at the specified index.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamRandomizer_method_set_stream_probability_weight:
|
||||
|
||||
- void **set_stream_probability_weight** **(** :ref:`int<class_int>` index, :ref:`float<class_float>` weight **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_stream_probability_weight** **(** :ref:`int<class_int>` index, :ref:`float<class_float>` weight **)**
|
||||
|
||||
Set the probability weight of the stream at the specified index. The higher this value, the more likely that the randomizer will choose this stream during random playback modes.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ AudioStreamWAV
|
||||
|
||||
Stores audio data loaded from WAV files.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -21,169 +23,229 @@ AudioStreamWAV stores sound samples loaded from WAV files. To play the stored so
|
||||
|
||||
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:`PackedByteArray<class_PackedByteArray>` | :ref:`data<class_AudioStreamWAV_property_data>` | ``PackedByteArray()`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`Format<enum_AudioStreamWAV_Format>` | :ref:`format<class_AudioStreamWAV_property_format>` | ``0`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`loop_begin<class_AudioStreamWAV_property_loop_begin>` | ``0`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`loop_end<class_AudioStreamWAV_property_loop_end>` | ``0`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`LoopMode<enum_AudioStreamWAV_LoopMode>` | :ref:`loop_mode<class_AudioStreamWAV_property_loop_mode>` | ``0`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`mix_rate<class_AudioStreamWAV_property_mix_rate>` | ``44100`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`stereo<class_AudioStreamWAV_property_stereo>` | ``false`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`data<class_AudioStreamWAV_property_data>` | ``PackedByteArray()`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`Format<enum_AudioStreamWAV_Format>` | :ref:`format<class_AudioStreamWAV_property_format>` | ``0`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`loop_begin<class_AudioStreamWAV_property_loop_begin>` | ``0`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`loop_end<class_AudioStreamWAV_property_loop_end>` | ``0`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`LoopMode<enum_AudioStreamWAV_LoopMode>` | :ref:`loop_mode<class_AudioStreamWAV_property_loop_mode>` | ``0`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`mix_rate<class_AudioStreamWAV_property_mix_rate>` | ``44100`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`stereo<class_AudioStreamWAV_property_stereo>` | ``false`` |
|
||||
+-----------------------------------------------+-------------------------------------------------------------+-----------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_to_wav<class_AudioStreamWAV_method_save_to_wav>` **(** :ref:`String<class_String>` path **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save_to_wav<class_AudioStreamWAV_method_save_to_wav>` **(** :ref:`String<class_String>` path **)** |
|
||||
+---------------------------------------+----------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Enumerations
|
||||
------------
|
||||
|
||||
.. _enum_AudioStreamWAV_Format:
|
||||
|
||||
.. _class_AudioStreamWAV_constant_FORMAT_8_BITS:
|
||||
|
||||
.. _class_AudioStreamWAV_constant_FORMAT_16_BITS:
|
||||
|
||||
.. _class_AudioStreamWAV_constant_FORMAT_IMA_ADPCM:
|
||||
.. rst-class:: classref-enumeration
|
||||
|
||||
enum **Format**:
|
||||
|
||||
- **FORMAT_8_BITS** = **0** --- 8-bit audio codec.
|
||||
.. _class_AudioStreamWAV_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_AudioStreamWAV_Format>` **FORMAT_8_BITS** = ``0``
|
||||
|
||||
8-bit audio codec.
|
||||
|
||||
.. _class_AudioStreamWAV_constant_FORMAT_16_BITS:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`Format<enum_AudioStreamWAV_Format>` **FORMAT_16_BITS** = ``1``
|
||||
|
||||
16-bit audio codec.
|
||||
|
||||
.. _class_AudioStreamWAV_constant_FORMAT_IMA_ADPCM:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`Format<enum_AudioStreamWAV_Format>` **FORMAT_IMA_ADPCM** = ``2``
|
||||
|
||||
Audio is compressed using IMA ADPCM.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _enum_AudioStreamWAV_LoopMode:
|
||||
|
||||
.. _class_AudioStreamWAV_constant_LOOP_DISABLED:
|
||||
|
||||
.. _class_AudioStreamWAV_constant_LOOP_FORWARD:
|
||||
|
||||
.. _class_AudioStreamWAV_constant_LOOP_PINGPONG:
|
||||
|
||||
.. _class_AudioStreamWAV_constant_LOOP_BACKWARD:
|
||||
.. rst-class:: classref-enumeration
|
||||
|
||||
enum **LoopMode**:
|
||||
|
||||
- **LOOP_DISABLED** = **0** --- Audio does not loop.
|
||||
.. _class_AudioStreamWAV_constant_LOOP_DISABLED:
|
||||
|
||||
- **LOOP_FORWARD** = **1** --- Audio loops the data between :ref:`loop_begin<class_AudioStreamWAV_property_loop_begin>` and :ref:`loop_end<class_AudioStreamWAV_property_loop_end>`, playing forward only.
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
- **LOOP_PINGPONG** = **2** --- Audio loops the data between :ref:`loop_begin<class_AudioStreamWAV_property_loop_begin>` and :ref:`loop_end<class_AudioStreamWAV_property_loop_end>`, playing back and forth.
|
||||
:ref:`LoopMode<enum_AudioStreamWAV_LoopMode>` **LOOP_DISABLED** = ``0``
|
||||
|
||||
- **LOOP_BACKWARD** = **3** --- Audio loops the data between :ref:`loop_begin<class_AudioStreamWAV_property_loop_begin>` and :ref:`loop_end<class_AudioStreamWAV_property_loop_end>`, playing backward only.
|
||||
Audio does not loop.
|
||||
|
||||
.. _class_AudioStreamWAV_constant_LOOP_FORWARD:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`LoopMode<enum_AudioStreamWAV_LoopMode>` **LOOP_FORWARD** = ``1``
|
||||
|
||||
Audio loops the data between :ref:`loop_begin<class_AudioStreamWAV_property_loop_begin>` and :ref:`loop_end<class_AudioStreamWAV_property_loop_end>`, playing forward only.
|
||||
|
||||
.. _class_AudioStreamWAV_constant_LOOP_PINGPONG:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`LoopMode<enum_AudioStreamWAV_LoopMode>` **LOOP_PINGPONG** = ``2``
|
||||
|
||||
Audio loops the data between :ref:`loop_begin<class_AudioStreamWAV_property_loop_begin>` and :ref:`loop_end<class_AudioStreamWAV_property_loop_end>`, playing back and forth.
|
||||
|
||||
.. _class_AudioStreamWAV_constant_LOOP_BACKWARD:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`LoopMode<enum_AudioStreamWAV_LoopMode>` **LOOP_BACKWARD** = ``3``
|
||||
|
||||
Audio loops the data between :ref:`loop_begin<class_AudioStreamWAV_property_loop_begin>` and :ref:`loop_end<class_AudioStreamWAV_property_loop_end>`, playing backward only.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_AudioStreamWAV_property_data:
|
||||
|
||||
- :ref:`PackedByteArray<class_PackedByteArray>` **data**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-----------------------+
|
||||
| *Default* | ``PackedByteArray()`` |
|
||||
+-----------+-----------------------+
|
||||
| *Setter* | set_data(value) |
|
||||
+-----------+-----------------------+
|
||||
| *Getter* | get_data() |
|
||||
+-----------+-----------------------+
|
||||
:ref:`PackedByteArray<class_PackedByteArray>` **data** = ``PackedByteArray()``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_data** **(** :ref:`PackedByteArray<class_PackedByteArray>` value **)**
|
||||
- :ref:`PackedByteArray<class_PackedByteArray>` **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_AudioStreamWAV_property_format:
|
||||
|
||||
- :ref:`Format<enum_AudioStreamWAV_Format>` **format**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+-------------------+
|
||||
| *Setter* | set_format(value) |
|
||||
+-----------+-------------------+
|
||||
| *Getter* | get_format() |
|
||||
+-----------+-------------------+
|
||||
:ref:`Format<enum_AudioStreamWAV_Format>` **format** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_format** **(** :ref:`Format<enum_AudioStreamWAV_Format>` value **)**
|
||||
- :ref:`Format<enum_AudioStreamWAV_Format>` **get_format** **(** **)**
|
||||
|
||||
Audio format. See :ref:`Format<enum_AudioStreamWAV_Format>` constants for values.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamWAV_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_AudioStreamWAV_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_AudioStreamWAV_property_loop_mode:
|
||||
|
||||
- :ref:`LoopMode<enum_AudioStreamWAV_LoopMode>` **loop_mode**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_loop_mode(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_loop_mode() |
|
||||
+-----------+----------------------+
|
||||
:ref:`LoopMode<enum_AudioStreamWAV_LoopMode>` **loop_mode** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_loop_mode** **(** :ref:`LoopMode<enum_AudioStreamWAV_LoopMode>` value **)**
|
||||
- :ref:`LoopMode<enum_AudioStreamWAV_LoopMode>` **get_loop_mode** **(** **)**
|
||||
|
||||
The loop mode. This information will be imported automatically from the WAV file if present. See :ref:`LoopMode<enum_AudioStreamWAV_LoopMode>` constants for values.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_AudioStreamWAV_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_AudioStreamWAV_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_AudioStreamWAV_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 AudioStreamWAV as a WAV file to ``path``. Samples with IMA ADPCM format can't be saved.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ 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
|
||||
-----------
|
||||
|
||||
@@ -21,64 +23,95 @@ Node for back-buffering the currently-displayed screen. The region defined in th
|
||||
|
||||
\ **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)``
|
||||
|
||||
.. 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>`.
|
||||
|
||||
|
||||
@@ -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:`ButtonGroup<class_ButtonGroup>` | :ref:`button_group<class_BaseButton_property_button_group>` | |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`MouseButton<enum_@GlobalScope_MouseButton>` | :ref:`button_mask<class_BaseButton_property_button_mask>` | ``1`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`button_pressed<class_BaseButton_property_button_pressed>` | ``false`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`disabled<class_BaseButton_property_disabled>` | ``false`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`keep_pressed_outside<class_BaseButton_property_keep_pressed_outside>` | ``false`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`Shortcut<class_Shortcut>` | :ref:`shortcut<class_BaseButton_property_shortcut>` | |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`shortcut_feedback<class_BaseButton_property_shortcut_feedback>` | ``true`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :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:`ButtonGroup<class_ButtonGroup>` | :ref:`button_group<class_BaseButton_property_button_group>` | |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`MouseButton<enum_@GlobalScope_MouseButton>` | :ref:`button_mask<class_BaseButton_property_button_mask>` | ``1`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`button_pressed<class_BaseButton_property_button_pressed>` | ``false`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`disabled<class_BaseButton_property_disabled>` | ``false`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`keep_pressed_outside<class_BaseButton_property_keep_pressed_outside>` | ``false`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`Shortcut<class_Shortcut>` | :ref:`shortcut<class_BaseButton_property_shortcut>` | |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`shortcut_feedback<class_BaseButton_property_shortcut_feedback>` | ``true`` |
|
||||
+---------------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||||
| :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_group:
|
||||
|
||||
- :ref:`ButtonGroup<class_ButtonGroup>` **button_group**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+----------+-------------------------+
|
||||
| *Setter* | set_button_group(value) |
|
||||
+----------+-------------------------+
|
||||
| *Getter* | get_button_group() |
|
||||
+----------+-------------------------+
|
||||
:ref:`ButtonGroup<class_ButtonGroup>` **button_group**
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_button_group** **(** :ref:`ButtonGroup<class_ButtonGroup>` value **)**
|
||||
- :ref:`ButtonGroup<class_ButtonGroup>` **get_button_group** **(** **)**
|
||||
|
||||
The :ref:`ButtonGroup<class_ButtonGroup>` associated with the button. Not to be confused with node groups.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BaseButton_property_button_mask:
|
||||
|
||||
- :ref:`MouseButton<enum_@GlobalScope_MouseButton>` **button_mask**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------------+
|
||||
| *Default* | ``1`` |
|
||||
+-----------+------------------------+
|
||||
| *Setter* | set_button_mask(value) |
|
||||
+-----------+------------------------+
|
||||
| *Getter* | get_button_mask() |
|
||||
+-----------+------------------------+
|
||||
:ref:`MouseButton<enum_@GlobalScope_MouseButton>` **button_mask** = ``1``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_button_mask** **(** :ref:`MouseButton<enum_@GlobalScope_MouseButton>` value **)**
|
||||
- :ref:`MouseButton<enum_@GlobalScope_MouseButton>` **get_button_mask** **(** **)**
|
||||
|
||||
Binary mask to choose which mouse buttons this button will respond to.
|
||||
|
||||
To allow both left-click and right-click, use ``MOUSE_BUTTON_MASK_LEFT | MOUSE_BUTTON_MASK_RIGHT``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BaseButton_property_button_pressed:
|
||||
|
||||
- :ref:`bool<class_bool>` **button_pressed**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+--------------------+
|
||||
| *Default* | ``false`` |
|
||||
+-----------+--------------------+
|
||||
| *Setter* | set_pressed(value) |
|
||||
+-----------+--------------------+
|
||||
| *Getter* | is_pressed() |
|
||||
+-----------+--------------------+
|
||||
:ref:`bool<class_bool>` **button_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:`button_pressed<class_BaseButton_property_button_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_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_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_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_feedback:
|
||||
|
||||
- :ref:`bool<class_bool>` **shortcut_feedback**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+------------------------------+
|
||||
| *Default* | ``true`` |
|
||||
+-----------+------------------------------+
|
||||
| *Setter* | set_shortcut_feedback(value) |
|
||||
+-----------+------------------------------+
|
||||
| *Getter* | is_shortcut_feedback() |
|
||||
+-----------+------------------------------+
|
||||
:ref:`bool<class_bool>` **shortcut_feedback** = ``true``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_shortcut_feedback** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **is_shortcut_feedback** **(** **)**
|
||||
|
||||
If ``true``, the button will appear pressed when its shortcut is activated. If ``false`` and :ref:`toggle_mode<class_BaseButton_property_toggle_mode>` is ``false``, the shortcut will activate the button without appearing to press 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:`button_pressed<class_BaseButton_property_button_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``.
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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,386 +44,570 @@ 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
|
||||
|
||||
Constructors
|
||||
------------
|
||||
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_constructor_Basis>` **(** **)** |
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_constructor_Basis>` **(** :ref:`Basis<class_Basis>` from **)** |
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_constructor_Basis>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_constructor_Basis>` **(** :ref:`Quaternion<class_Quaternion>` from **)** |
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_constructor_Basis>` **(** :ref:`Vector3<class_Vector3>` x_axis, :ref:`Vector3<class_Vector3>` y_axis, :ref:`Vector3<class_Vector3>` z_axis **)** |
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_constructor_Basis>` **(** **)** |
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_constructor_Basis>` **(** :ref:`Basis<class_Basis>` from **)** |
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_constructor_Basis>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_constructor_Basis>` **(** :ref:`Quaternion<class_Quaternion>` from **)** |
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`Basis<class_Basis_constructor_Basis>` **(** :ref:`Vector3<class_Vector3>` x_axis, :ref:`Vector3<class_Vector3>` y_axis, :ref:`Vector3<class_Vector3>` z_axis **)** |
|
||||
+---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`determinant<class_Basis_method_determinant>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`from_euler<class_Basis_method_from_euler>` **(** :ref:`Vector3<class_Vector3>` euler, :ref:`int<class_int>` order=2 **)** |static| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`from_scale<class_Basis_method_from_scale>` **(** :ref:`Vector3<class_Vector3>` scale **)** |static| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_euler<class_Basis_method_get_euler>` **(** :ref:`int<class_int>` order=2 **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Quaternion<class_Quaternion>` | :ref:`get_rotation_quaternion<class_Basis_method_get_rotation_quaternion>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_scale<class_Basis_method_get_scale>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`inverse<class_Basis_method_inverse>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_Basis_method_is_equal_approx>` **(** :ref:`Basis<class_Basis>` b **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_finite<class_Basis_method_is_finite>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`looking_at<class_Basis_method_looking_at>` **(** :ref:`Vector3<class_Vector3>` target, :ref:`Vector3<class_Vector3>` up=Vector3(0, 1, 0) **)** |static| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`orthonormalized<class_Basis_method_orthonormalized>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`rotated<class_Basis_method_rotated>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`scaled<class_Basis_method_scaled>` **(** :ref:`Vector3<class_Vector3>` scale **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`slerp<class_Basis_method_slerp>` **(** :ref:`Basis<class_Basis>` to, :ref:`float<class_float>` weight **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`tdotx<class_Basis_method_tdotx>` **(** :ref:`Vector3<class_Vector3>` with **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`tdoty<class_Basis_method_tdoty>` **(** :ref:`Vector3<class_Vector3>` with **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`tdotz<class_Basis_method_tdotz>` **(** :ref:`Vector3<class_Vector3>` with **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`transposed<class_Basis_method_transposed>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`determinant<class_Basis_method_determinant>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`from_euler<class_Basis_method_from_euler>` **(** :ref:`Vector3<class_Vector3>` euler, :ref:`int<class_int>` order=2 **)** |static| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`from_scale<class_Basis_method_from_scale>` **(** :ref:`Vector3<class_Vector3>` scale **)** |static| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_euler<class_Basis_method_get_euler>` **(** :ref:`int<class_int>` order=2 **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Quaternion<class_Quaternion>` | :ref:`get_rotation_quaternion<class_Basis_method_get_rotation_quaternion>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`get_scale<class_Basis_method_get_scale>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`inverse<class_Basis_method_inverse>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_Basis_method_is_equal_approx>` **(** :ref:`Basis<class_Basis>` b **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`is_finite<class_Basis_method_is_finite>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`looking_at<class_Basis_method_looking_at>` **(** :ref:`Vector3<class_Vector3>` target, :ref:`Vector3<class_Vector3>` up=Vector3(0, 1, 0) **)** |static| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`orthonormalized<class_Basis_method_orthonormalized>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`rotated<class_Basis_method_rotated>` **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`scaled<class_Basis_method_scaled>` **(** :ref:`Vector3<class_Vector3>` scale **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`slerp<class_Basis_method_slerp>` **(** :ref:`Basis<class_Basis>` to, :ref:`float<class_float>` weight **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`tdotx<class_Basis_method_tdotx>` **(** :ref:`Vector3<class_Vector3>` with **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`tdoty<class_Basis_method_tdoty>` **(** :ref:`Vector3<class_Vector3>` with **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`tdotz<class_Basis_method_tdotz>` **(** :ref:`Vector3<class_Vector3>` with **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`transposed<class_Basis_method_transposed>` **(** **)** |const| |
|
||||
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Operators
|
||||
---------
|
||||
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator !=<class_Basis_operator_neq_bool>` **(** :ref:`Basis<class_Basis>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`operator *<class_Basis_operator_mul_Basis>` **(** :ref:`Basis<class_Basis>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`operator *<class_Basis_operator_mul_Vector3>` **(** :ref:`Vector3<class_Vector3>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`operator *<class_Basis_operator_mul_Basis>` **(** :ref:`float<class_float>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`operator *<class_Basis_operator_mul_Basis>` **(** :ref:`int<class_int>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator ==<class_Basis_operator_eq_bool>` **(** :ref:`Basis<class_Basis>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`operator []<class_Basis_operator_idx_Vector3>` **(** :ref:`int<class_int>` index **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator !=<class_Basis_operator_neq_Basis>` **(** :ref:`Basis<class_Basis>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`operator *<class_Basis_operator_mul_Basis>` **(** :ref:`Basis<class_Basis>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`operator *<class_Basis_operator_mul_Vector3>` **(** :ref:`Vector3<class_Vector3>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`operator *<class_Basis_operator_mul_float>` **(** :ref:`float<class_float>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Basis<class_Basis>` | :ref:`operator *<class_Basis_operator_mul_int>` **(** :ref:`int<class_int>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator ==<class_Basis_operator_eq_Basis>` **(** :ref:`Basis<class_Basis>` right **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`operator []<class_Basis_operator_idx_int>` **(** :ref:`int<class_int>` index **)** |
|
||||
+-------------------------------+-----------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. 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
|
||||
|
||||
Constructor Descriptions
|
||||
------------------------
|
||||
|
||||
.. _class_Basis_constructor_Basis:
|
||||
|
||||
- :ref:`Basis<class_Basis>` **Basis** **(** **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
Constructs a default-initialized ``Basis`` set to :ref:`IDENTITY<class_Basis_constant_IDENTITY>`.
|
||||
:ref:`Basis<class_Basis>` **Basis** **(** **)**
|
||||
|
||||
Constructs a default-initialized **Basis** set to :ref:`IDENTITY<class_Basis_constant_IDENTITY>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
- :ref:`Basis<class_Basis>` **Basis** **(** :ref:`Basis<class_Basis>` from **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
Constructs a ``Basis`` as a copy of the given ``Basis``.
|
||||
:ref:`Basis<class_Basis>` **Basis** **(** :ref:`Basis<class_Basis>` from **)**
|
||||
|
||||
Constructs a **Basis** as a copy of the given **Basis**.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
- :ref:`Basis<class_Basis>` **Basis** **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
: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:`Quaternion<class_Quaternion>` from **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
:ref:`Basis<class_Basis>` **Basis** **(** :ref:`Quaternion<class_Quaternion>` 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>` x_axis, :ref:`Vector3<class_Vector3>` y_axis, :ref:`Vector3<class_Vector3>` z_axis **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
: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-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_Basis_method_determinant:
|
||||
|
||||
- :ref:`float<class_float>` **determinant** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **determinant** **(** **)** |const|
|
||||
|
||||
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_from_euler:
|
||||
|
||||
- :ref:`Basis<class_Basis>` **from_euler** **(** :ref:`Vector3<class_Vector3>` euler, :ref:`int<class_int>` order=2 **)** |static|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Basis<class_Basis>` **from_euler** **(** :ref:`Vector3<class_Vector3>` euler, :ref:`int<class_int>` order=2 **)** |static|
|
||||
|
||||
Constructs a pure rotation Basis matrix from Euler angles in the specified Euler rotation order. By default, use YXZ order (most common). See the :ref:`EulerOrder<enum_@GlobalScope_EulerOrder>` enum for possible values.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Basis_method_from_scale:
|
||||
|
||||
- :ref:`Basis<class_Basis>` **from_scale** **(** :ref:`Vector3<class_Vector3>` scale **)** |static|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Basis<class_Basis>` **from_scale** **(** :ref:`Vector3<class_Vector3>` scale **)** |static|
|
||||
|
||||
Constructs a pure scale basis matrix with no rotation or shearing. The scale values are set as the diagonal of the matrix, and the other parts of the matrix are zero.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Basis_method_get_euler:
|
||||
|
||||
- :ref:`Vector3<class_Vector3>` **get_euler** **(** :ref:`int<class_int>` order=2 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Vector3<class_Vector3>` **get_euler** **(** :ref:`int<class_int>` order=2 **)** |const|
|
||||
|
||||
Returns the basis's rotation in the form of Euler angles. The Euler order depends on the ``order`` parameter, by default it uses 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_quaternion<class_Basis_method_get_rotation_quaternion>` method instead, which returns a :ref:`Quaternion<class_Quaternion>` quaternion instead of Euler angles.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Basis_method_get_rotation_quaternion:
|
||||
|
||||
- :ref:`Quaternion<class_Quaternion>` **get_rotation_quaternion** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Quaternion<class_Quaternion>` **get_rotation_quaternion** **(** **)** |const|
|
||||
|
||||
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** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Vector3<class_Vector3>` **get_scale** **(** **)** |const|
|
||||
|
||||
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** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Basis<class_Basis>` **inverse** **(** **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **is_equal_approx** **(** :ref:`Basis<class_Basis>` b **)** |const|
|
||||
|
||||
Returns ``true`` if this basis and ``b`` are approximately equal, by calling ``is_equal_approx`` on each component.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Basis_method_is_finite:
|
||||
|
||||
- :ref:`bool<class_bool>` **is_finite** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **is_finite** **(** **)** |const|
|
||||
|
||||
Returns ``true`` if this basis is finite, by calling :ref:`@GlobalScope.is_finite<class_@GlobalScope_method_is_finite>` on each component.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Basis_method_looking_at:
|
||||
|
||||
- :ref:`Basis<class_Basis>` **looking_at** **(** :ref:`Vector3<class_Vector3>` target, :ref:`Vector3<class_Vector3>` up=Vector3(0, 1, 0) **)** |static|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Basis<class_Basis>` **looking_at** **(** :ref:`Vector3<class_Vector3>` target, :ref:`Vector3<class_Vector3>` up=Vector3(0, 1, 0) **)** |static|
|
||||
|
||||
Creates a Basis with a rotation such that the forward axis (-Z) points towards the ``target`` position.
|
||||
|
||||
The up axis (+Y) points as close to the ``up`` vector as possible while staying perpendicular to the forward axis. The resulting Basis is orthonormalized. The ``target`` and ``up`` vectors cannot be zero, and cannot be parallel to each other.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Basis_method_orthonormalized:
|
||||
|
||||
- :ref:`Basis<class_Basis>` **orthonormalized** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Basis<class_Basis>` **orthonormalized** **(** **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Basis<class_Basis>` **rotated** **(** :ref:`Vector3<class_Vector3>` axis, :ref:`float<class_float>` angle **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Basis<class_Basis>` **scaled** **(** :ref:`Vector3<class_Vector3>` scale **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Basis<class_Basis>` **slerp** **(** :ref:`Basis<class_Basis>` to, :ref:`float<class_float>` weight **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **tdotx** **(** :ref:`Vector3<class_Vector3>` with **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **tdoty** **(** :ref:`Vector3<class_Vector3>` with **)** |const|
|
||||
|
||||
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 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **tdotz** **(** :ref:`Vector3<class_Vector3>` with **)** |const|
|
||||
|
||||
Transposed dot product with the Z axis of the matrix.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Basis_method_transposed:
|
||||
|
||||
- :ref:`Basis<class_Basis>` **transposed** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Basis<class_Basis>` **transposed** **(** **)** |const|
|
||||
|
||||
Returns the transposed version of the matrix.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Operator Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_Basis_operator_neq_bool:
|
||||
.. _class_Basis_operator_neq_Basis:
|
||||
|
||||
- :ref:`bool<class_bool>` **operator !=** **(** :ref:`Basis<class_Basis>` right **)**
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
Returns ``true`` if the ``Basis`` matrices are not equal.
|
||||
:ref:`bool<class_bool>` **operator !=** **(** :ref:`Basis<class_Basis>` right **)**
|
||||
|
||||
Returns ``true`` if the **Basis** matrices are not equal.
|
||||
|
||||
\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx<class_Basis_method_is_equal_approx>` instead, which is more reliable.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Basis_operator_mul_Basis:
|
||||
|
||||
- :ref:`Basis<class_Basis>` **operator *** **(** :ref:`Basis<class_Basis>` right **)**
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`Basis<class_Basis>` **operator *** **(** :ref:`Basis<class_Basis>` right **)**
|
||||
|
||||
Composes these two basis matrices by multiplying them together. This has the effect of transforming the second basis (the child) by the first basis (the parent).
|
||||
|
||||
----
|
||||
|
||||
- :ref:`Vector3<class_Vector3>` **operator *** **(** :ref:`Vector3<class_Vector3>` right **)**
|
||||
|
||||
Transforms (multiplies) the :ref:`Vector3<class_Vector3>` by the given ``Basis`` matrix.
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
- :ref:`Basis<class_Basis>` **operator *** **(** :ref:`float<class_float>` right **)**
|
||||
.. _class_Basis_operator_mul_Vector3:
|
||||
|
||||
This operator multiplies all components of the ``Basis``, which scales it uniformly.
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`Vector3<class_Vector3>` **operator *** **(** :ref:`Vector3<class_Vector3>` right **)**
|
||||
|
||||
Transforms (multiplies) the :ref:`Vector3<class_Vector3>` by the given **Basis** matrix.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
- :ref:`Basis<class_Basis>` **operator *** **(** :ref:`int<class_int>` right **)**
|
||||
.. _class_Basis_operator_mul_float:
|
||||
|
||||
This operator multiplies all components of the ``Basis``, which scales it uniformly.
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`Basis<class_Basis>` **operator *** **(** :ref:`float<class_float>` right **)**
|
||||
|
||||
This operator multiplies all components of the **Basis**, which scales it uniformly.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Basis_operator_eq_bool:
|
||||
.. _class_Basis_operator_mul_int:
|
||||
|
||||
- :ref:`bool<class_bool>` **operator ==** **(** :ref:`Basis<class_Basis>` right **)**
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
Returns ``true`` if the ``Basis`` matrices are exactly equal.
|
||||
:ref:`Basis<class_Basis>` **operator *** **(** :ref:`int<class_int>` right **)**
|
||||
|
||||
This operator multiplies all components of the **Basis**, which scales it uniformly.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Basis_operator_eq_Basis:
|
||||
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`bool<class_bool>` **operator ==** **(** :ref:`Basis<class_Basis>` right **)**
|
||||
|
||||
Returns ``true`` if the **Basis** matrices are exactly equal.
|
||||
|
||||
\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx<class_Basis_method_is_equal_approx>` instead, which is more reliable.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Basis_operator_idx_Vector3:
|
||||
.. _class_Basis_operator_idx_int:
|
||||
|
||||
- :ref:`Vector3<class_Vector3>` **operator []** **(** :ref:`int<class_int>` index **)**
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`Vector3<class_Vector3>` **operator []** **(** :ref:`int<class_int>` index **)**
|
||||
|
||||
Access basis components using their index. ``b[0]`` is equivalent to ``b.x``, ``b[1]`` is equivalent to ``b.y``, and ``b[2]`` is equivalent to ``b.z``.
|
||||
|
||||
|
||||
@@ -14,112 +14,159 @@ 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:`Vector2i<class_Vector2i>` 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:`int<class_int>` x, :ref:`int<class_int>` y **)** |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`get_bitv<class_BitMap_method_get_bitv>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector2i<class_Vector2i>` | :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:`Rect2i<class_Rect2i>` rect **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedVector2Array[]<class_PackedVector2Array>` | :ref:`opaque_to_polygons<class_BitMap_method_opaque_to_polygons>` **(** :ref:`Rect2i<class_Rect2i>` rect, :ref:`float<class_float>` epsilon=2.0 **)** |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`resize<class_BitMap_method_resize>` **(** :ref:`Vector2i<class_Vector2i>` new_size **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_bit<class_BitMap_method_set_bit>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`bool<class_bool>` bit **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_bit_rect<class_BitMap_method_set_bit_rect>` **(** :ref:`Rect2i<class_Rect2i>` rect, :ref:`bool<class_bool>` bit **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_bitv<class_BitMap_method_set_bitv>` **(** :ref:`Vector2i<class_Vector2i>` position, :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:`Vector2i<class_Vector2i>` 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:`int<class_int>` x, :ref:`int<class_int>` y **)** |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`get_bitv<class_BitMap_method_get_bitv>` **(** :ref:`Vector2i<class_Vector2i>` position **)** |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Vector2i<class_Vector2i>` | :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:`Rect2i<class_Rect2i>` rect **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`PackedVector2Array[]<class_PackedVector2Array>` | :ref:`opaque_to_polygons<class_BitMap_method_opaque_to_polygons>` **(** :ref:`Rect2i<class_Rect2i>` rect, :ref:`float<class_float>` epsilon=2.0 **)** |const| |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`resize<class_BitMap_method_resize>` **(** :ref:`Vector2i<class_Vector2i>` new_size **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_bit<class_BitMap_method_set_bit>` **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`bool<class_bool>` bit **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_bit_rect<class_BitMap_method_set_bit_rect>` **(** :ref:`Rect2i<class_Rect2i>` rect, :ref:`bool<class_bool>` bit **)** |
|
||||
+-------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_bitv<class_BitMap_method_set_bitv>` **(** :ref:`Vector2i<class_Vector2i>` position, :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 :ref:`Image.FORMAT_L8<class_Image_constant_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:`Vector2i<class_Vector2i>` size **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **create** **(** :ref:`Vector2i<class_Vector2i>` 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:`int<class_int>` x, :ref:`int<class_int>` y **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **get_bit** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y **)** |const|
|
||||
|
||||
Returns bitmap's value at the specified position.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BitMap_method_get_bitv:
|
||||
|
||||
- :ref:`bool<class_bool>` **get_bitv** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **get_bitv** **(** :ref:`Vector2i<class_Vector2i>` position **)** |const|
|
||||
|
||||
Returns bitmap's value at the specified position.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BitMap_method_get_size:
|
||||
|
||||
- :ref:`Vector2i<class_Vector2i>` **get_size** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Vector2i<class_Vector2i>` **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 number 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:`Rect2i<class_Rect2i>` rect **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **grow_mask** **(** :ref:`int<class_int>` pixels, :ref:`Rect2i<class_Rect2i>` 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:`PackedVector2Array[]<class_PackedVector2Array>` **opaque_to_polygons** **(** :ref:`Rect2i<class_Rect2i>` rect, :ref:`float<class_float>` epsilon=2.0 **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`PackedVector2Array[]<class_PackedVector2Array>` **opaque_to_polygons** **(** :ref:`Rect2i<class_Rect2i>` rect, :ref:`float<class_float>` epsilon=2.0 **)** |const|
|
||||
|
||||
Creates an :ref:`Array<class_Array>` of polygons covering a rectangular portion of the bitmap. It uses a marching squares algorithm, followed by Ramer-Douglas-Peucker (RDP) reduction of the number of vertices. Each polygon is described as a :ref:`PackedVector2Array<class_PackedVector2Array>` of its vertices.
|
||||
|
||||
@@ -131,35 +178,51 @@ To get polygons covering the whole bitmap, pass:
|
||||
|
||||
\ ``epsilon`` is passed to RDP to control how accurately the polygons cover the bitmap: a lower ``epsilon`` corresponds to more points in the polygons.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BitMap_method_resize:
|
||||
|
||||
- void **resize** **(** :ref:`Vector2i<class_Vector2i>` new_size **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **resize** **(** :ref:`Vector2i<class_Vector2i>` new_size **)**
|
||||
|
||||
Resizes the image to ``new_size``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BitMap_method_set_bit:
|
||||
|
||||
- void **set_bit** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :ref:`bool<class_bool>` bit **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_bit** **(** :ref:`int<class_int>` x, :ref:`int<class_int>` y, :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:`Rect2i<class_Rect2i>` rect, :ref:`bool<class_bool>` bit **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_bit_rect** **(** :ref:`Rect2i<class_Rect2i>` rect, :ref:`bool<class_bool>` bit **)**
|
||||
|
||||
Sets a rectangular portion of the bitmap to the specified value.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BitMap_method_set_bitv:
|
||||
|
||||
- void **set_bitv** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`bool<class_bool>` bit **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_bitv** **(** :ref:`Vector2i<class_Vector2i>` position, :ref:`bool<class_bool>` bit **)**
|
||||
|
||||
Sets the bitmap's element at the specified position, to the specified value.
|
||||
|
||||
|
||||
@@ -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,147 +27,210 @@ 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:`Transform2D<class_Transform2D>` | :ref:`rest<class_Bone2D_property_rest>` | ``Transform2D(0, 0, 0, 0, 0, 0)`` |
|
||||
+---------------------------------------+-----------------------------------------+-----------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------------+-----------------------------------------+-----------------------------------+
|
||||
| :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:`bool<class_bool>` | :ref:`get_autocalculate_length_and_angle<class_Bone2D_method_get_autocalculate_length_and_angle>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_bone_angle<class_Bone2D_method_get_bone_angle>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_default_length<class_Bone2D_method_get_default_length>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_index_in_skeleton<class_Bone2D_method_get_index_in_skeleton>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_length<class_Bone2D_method_get_length>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Transform2D<class_Transform2D>` | :ref:`get_skeleton_rest<class_Bone2D_method_get_skeleton_rest>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_autocalculate_length_and_angle<class_Bone2D_method_set_autocalculate_length_and_angle>` **(** :ref:`bool<class_bool>` auto_calculate **)** |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_bone_angle<class_Bone2D_method_set_bone_angle>` **(** :ref:`float<class_float>` angle **)** |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_default_length<class_Bone2D_method_set_default_length>` **(** :ref:`float<class_float>` default_length **)** |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_length<class_Bone2D_method_set_length>` **(** :ref:`float<class_float>` length **)** |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`apply_rest<class_Bone2D_method_apply_rest>` **(** **)** |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`get_autocalculate_length_and_angle<class_Bone2D_method_get_autocalculate_length_and_angle>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_bone_angle<class_Bone2D_method_get_bone_angle>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_default_length<class_Bone2D_method_get_default_length>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_index_in_skeleton<class_Bone2D_method_get_index_in_skeleton>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`float<class_float>` | :ref:`get_length<class_Bone2D_method_get_length>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Transform2D<class_Transform2D>` | :ref:`get_skeleton_rest<class_Bone2D_method_get_skeleton_rest>` **(** **)** |const| |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_autocalculate_length_and_angle<class_Bone2D_method_set_autocalculate_length_and_angle>` **(** :ref:`bool<class_bool>` auto_calculate **)** |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_bone_angle<class_Bone2D_method_set_bone_angle>` **(** :ref:`float<class_float>` angle **)** |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_default_length<class_Bone2D_method_set_default_length>` **(** :ref:`float<class_float>` default_length **)** |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_length<class_Bone2D_method_set_length>` **(** :ref:`float<class_float>` length **)** |
|
||||
+---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _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_autocalculate_length_and_angle:
|
||||
|
||||
- :ref:`bool<class_bool>` **get_autocalculate_length_and_angle** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **get_autocalculate_length_and_angle** **(** **)** |const|
|
||||
|
||||
Returns whether this ``Bone2D`` node is going to autocalculate its length and bone angle using its first ``Bone2D`` child node, if one exists. If there are no ``Bone2D`` children, then it cannot autocalculate these values and will print a warning.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Bone2D_method_get_bone_angle:
|
||||
|
||||
- :ref:`float<class_float>` **get_bone_angle** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **get_bone_angle** **(** **)** |const|
|
||||
|
||||
Returns the angle of the bone in the ``Bone2D`` node.
|
||||
|
||||
\ **Note:** This is different from the ``Bone2D``'s rotation. The bone angle is the rotation of the bone shown by the ``Bone2D`` gizmo, and because ``Bone2D`` bones are based on positions, this can vary from the actual rotation of the ``Bone2D`` node.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Bone2D_method_get_default_length:
|
||||
|
||||
- :ref:`float<class_float>` **get_default_length** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **get_default_length** **(** **)** |const|
|
||||
|
||||
Deprecated. Please use ``get_length`` instead.
|
||||
|
||||
.. 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_length:
|
||||
|
||||
- :ref:`float<class_float>` **get_length** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`float<class_float>` **get_length** **(** **)** |const|
|
||||
|
||||
Returns the length of the bone in the ``Bone2D`` node.
|
||||
|
||||
.. 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.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Bone2D_method_set_autocalculate_length_and_angle:
|
||||
|
||||
- void **set_autocalculate_length_and_angle** **(** :ref:`bool<class_bool>` auto_calculate **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_autocalculate_length_and_angle** **(** :ref:`bool<class_bool>` auto_calculate **)**
|
||||
|
||||
When set to ``true``, the ``Bone2D`` node will attempt to automatically calculate the bone angle and length using the first child ``Bone2D`` node, if one exists. If none exist, the ``Bone2D`` cannot automatically calculate these values and will print a warning.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Bone2D_method_set_bone_angle:
|
||||
|
||||
- void **set_bone_angle** **(** :ref:`float<class_float>` angle **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_bone_angle** **(** :ref:`float<class_float>` angle **)**
|
||||
|
||||
Sets the bone angle for the ``Bone2D`` node. This is typically set to the rotation from the ``Bone2D`` node to a child ``Bone2D`` node.
|
||||
|
||||
\ **Note:** This is different from the ``Bone2D``'s rotation. The bone angle is the rotation of the bone shown by the ``Bone2D`` gizmo, and because ``Bone2D`` bones are based on positions, this can vary from the actual rotation of the ``Bone2D`` node.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Bone2D_method_set_default_length:
|
||||
|
||||
- void **set_default_length** **(** :ref:`float<class_float>` default_length **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_default_length** **(** :ref:`float<class_float>` default_length **)**
|
||||
|
||||
Deprecated. Please use ``set_length`` instead.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_Bone2D_method_set_length:
|
||||
|
||||
- void **set_length** **(** :ref:`float<class_float>` length **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_length** **(** :ref:`float<class_float>` length **)**
|
||||
|
||||
Sets the length of the bone in the ``Bone2D`` node.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ BoneAttachment3D
|
||||
|
||||
A node that will attach to a bone.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -21,145 +23,201 @@ This node will allow you to select a bone for this node to attach to. The BoneAt
|
||||
|
||||
The BoneAttachment3D node must either be a child of a :ref:`Skeleton3D<class_Skeleton3D>` node or be given an external :ref:`Skeleton3D<class_Skeleton3D>` to use in order to function properly.
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-----------------------------+-------------------------------------------------------------+--------+
|
||||
| :ref:`int<class_int>` | :ref:`bone_idx<class_BoneAttachment3D_property_bone_idx>` | ``-1`` |
|
||||
+-----------------------------+-------------------------------------------------------------+--------+
|
||||
| :ref:`String<class_String>` | :ref:`bone_name<class_BoneAttachment3D_property_bone_name>` | ``""`` |
|
||||
+-----------------------------+-------------------------------------------------------------+--------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------+-------------------------------------------------------------+--------+
|
||||
| :ref:`int<class_int>` | :ref:`bone_idx<class_BoneAttachment3D_property_bone_idx>` | ``-1`` |
|
||||
+-----------------------------+-------------------------------------------------------------+--------+
|
||||
| :ref:`String<class_String>` | :ref:`bone_name<class_BoneAttachment3D_property_bone_name>` | ``""`` |
|
||||
+-----------------------------+-------------------------------------------------------------+--------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`NodePath<class_NodePath>` | :ref:`get_external_skeleton<class_BoneAttachment3D_method_get_external_skeleton>` **(** **)** |const| |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_override_mode<class_BoneAttachment3D_method_get_override_mode>` **(** **)** |const| |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`get_override_pose<class_BoneAttachment3D_method_get_override_pose>` **(** **)** |const| |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`get_use_external_skeleton<class_BoneAttachment3D_method_get_use_external_skeleton>` **(** **)** |const| |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`on_bone_pose_update<class_BoneAttachment3D_method_on_bone_pose_update>` **(** :ref:`int<class_int>` bone_index **)** |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_external_skeleton<class_BoneAttachment3D_method_set_external_skeleton>` **(** :ref:`NodePath<class_NodePath>` external_skeleton **)** |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_override_mode<class_BoneAttachment3D_method_set_override_mode>` **(** :ref:`int<class_int>` override_mode **)** |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_override_pose<class_BoneAttachment3D_method_set_override_pose>` **(** :ref:`bool<class_bool>` override_pose **)** |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_use_external_skeleton<class_BoneAttachment3D_method_set_use_external_skeleton>` **(** :ref:`bool<class_bool>` use_external_skeleton **)** |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`NodePath<class_NodePath>` | :ref:`get_external_skeleton<class_BoneAttachment3D_method_get_external_skeleton>` **(** **)** |const| |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`get_override_mode<class_BoneAttachment3D_method_get_override_mode>` **(** **)** |const| |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`get_override_pose<class_BoneAttachment3D_method_get_override_pose>` **(** **)** |const| |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`get_use_external_skeleton<class_BoneAttachment3D_method_get_use_external_skeleton>` **(** **)** |const| |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`on_bone_pose_update<class_BoneAttachment3D_method_on_bone_pose_update>` **(** :ref:`int<class_int>` bone_index **)** |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_external_skeleton<class_BoneAttachment3D_method_set_external_skeleton>` **(** :ref:`NodePath<class_NodePath>` external_skeleton **)** |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_override_mode<class_BoneAttachment3D_method_set_override_mode>` **(** :ref:`int<class_int>` override_mode **)** |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_override_pose<class_BoneAttachment3D_method_set_override_pose>` **(** :ref:`bool<class_bool>` override_pose **)** |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_use_external_skeleton<class_BoneAttachment3D_method_set_use_external_skeleton>` **(** :ref:`bool<class_bool>` use_external_skeleton **)** |
|
||||
+---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_BoneAttachment3D_property_bone_idx:
|
||||
|
||||
- :ref:`int<class_int>` **bone_idx**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------+
|
||||
| *Default* | ``-1`` |
|
||||
+-----------+---------------------+
|
||||
| *Setter* | set_bone_idx(value) |
|
||||
+-----------+---------------------+
|
||||
| *Getter* | get_bone_idx() |
|
||||
+-----------+---------------------+
|
||||
:ref:`int<class_int>` **bone_idx** = ``-1``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_bone_idx** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_bone_idx** **(** **)**
|
||||
|
||||
The index of the attached bone.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneAttachment3D_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.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_BoneAttachment3D_method_get_external_skeleton:
|
||||
|
||||
- :ref:`NodePath<class_NodePath>` **get_external_skeleton** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`NodePath<class_NodePath>` **get_external_skeleton** **(** **)** |const|
|
||||
|
||||
Returns the :ref:`NodePath<class_NodePath>` to the external :ref:`Skeleton3D<class_Skeleton3D>` node, if one has been set.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneAttachment3D_method_get_override_mode:
|
||||
|
||||
- :ref:`int<class_int>` **get_override_mode** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`int<class_int>` **get_override_mode** **(** **)** |const|
|
||||
|
||||
Deprecated. Local pose overrides will be removed.
|
||||
|
||||
Returns the override mode for the BoneAttachment3D node (0=global / 1=local).
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneAttachment3D_method_get_override_pose:
|
||||
|
||||
- :ref:`bool<class_bool>` **get_override_pose** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **get_override_pose** **(** **)** |const|
|
||||
|
||||
Returns whether the BoneAttachment3D node is overriding the bone pose of the bone it's attached to.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneAttachment3D_method_get_use_external_skeleton:
|
||||
|
||||
- :ref:`bool<class_bool>` **get_use_external_skeleton** **(** **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`bool<class_bool>` **get_use_external_skeleton** **(** **)** |const|
|
||||
|
||||
Returns whether the BoneAttachment3D node is using an external :ref:`Skeleton3D<class_Skeleton3D>` rather than attempting to use its parent node as the :ref:`Skeleton3D<class_Skeleton3D>`.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneAttachment3D_method_on_bone_pose_update:
|
||||
|
||||
- void **on_bone_pose_update** **(** :ref:`int<class_int>` bone_index **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **on_bone_pose_update** **(** :ref:`int<class_int>` bone_index **)**
|
||||
|
||||
A function that is called automatically when the :ref:`Skeleton3D<class_Skeleton3D>` the BoneAttachment3D node is using has a bone that has changed its pose. This function is where the BoneAttachment3D node updates its position so it is correctly bound when it is *not* set to override the bone pose.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneAttachment3D_method_set_external_skeleton:
|
||||
|
||||
- void **set_external_skeleton** **(** :ref:`NodePath<class_NodePath>` external_skeleton **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_external_skeleton** **(** :ref:`NodePath<class_NodePath>` external_skeleton **)**
|
||||
|
||||
Sets the :ref:`NodePath<class_NodePath>` to the external skeleton that the BoneAttachment3D node should use. The external :ref:`Skeleton3D<class_Skeleton3D>` node is only used when ``use_external_skeleton`` is set to ``true``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneAttachment3D_method_set_override_mode:
|
||||
|
||||
- void **set_override_mode** **(** :ref:`int<class_int>` override_mode **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_override_mode** **(** :ref:`int<class_int>` override_mode **)**
|
||||
|
||||
Deprecated. Local pose overrides will be removed.
|
||||
|
||||
Sets the override mode for the BoneAttachment3D node (0=global / 1=local). The override mode defines which of the bone poses the BoneAttachment3D node will override.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneAttachment3D_method_set_override_pose:
|
||||
|
||||
- void **set_override_pose** **(** :ref:`bool<class_bool>` override_pose **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_override_pose** **(** :ref:`bool<class_bool>` override_pose **)**
|
||||
|
||||
Sets whether the BoneAttachment3D node will override the bone pose of the bone it is attached to. When set to ``true``, the BoneAttachment3D node can change the pose of the bone.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneAttachment3D_method_set_use_external_skeleton:
|
||||
|
||||
- void **set_use_external_skeleton** **(** :ref:`bool<class_bool>` use_external_skeleton **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_use_external_skeleton** **(** :ref:`bool<class_bool>` use_external_skeleton **)**
|
||||
|
||||
Sets whether the BoneAttachment3D node will use an extenral :ref:`Skeleton3D<class_Skeleton3D>` node rather than attenpting to use its parent node as the :ref:`Skeleton3D<class_Skeleton3D>`. When set to ``true``, the BoneAttachment3D node will use the external :ref:`Skeleton3D<class_Skeleton3D>` node set in ``set_external_skeleton``.
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ BoneMap
|
||||
|
||||
Bone map for retargeting.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -21,87 +23,134 @@ This class contains a hashmap that uses a list of bone names in :ref:`SkeletonPr
|
||||
|
||||
By assigning the actual :ref:`Skeleton3D<class_Skeleton3D>` bone name as the key value, it maps the :ref:`Skeleton3D<class_Skeleton3D>` to the :ref:`SkeletonProfile<class_SkeletonProfile>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`Retargeting 3D Skeletons <../tutorials/assets_pipeline/retargeting_3d_skeletons>`
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-----------------------------------------------+------------------------------------------------+
|
||||
| :ref:`SkeletonProfile<class_SkeletonProfile>` | :ref:`profile<class_BoneMap_property_profile>` |
|
||||
+-----------------------------------------------+------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------------------------------+------------------------------------------------+
|
||||
| :ref:`SkeletonProfile<class_SkeletonProfile>` | :ref:`profile<class_BoneMap_property_profile>` |
|
||||
+-----------------------------------------------+------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`find_profile_bone_name<class_BoneMap_method_find_profile_bone_name>` **(** :ref:`StringName<class_StringName>` skeleton_bone_name **)** |const| |
|
||||
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`get_skeleton_bone_name<class_BoneMap_method_get_skeleton_bone_name>` **(** :ref:`StringName<class_StringName>` profile_bone_name **)** |const| |
|
||||
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_skeleton_bone_name<class_BoneMap_method_set_skeleton_bone_name>` **(** :ref:`StringName<class_StringName>` profile_bone_name, :ref:`StringName<class_StringName>` skeleton_bone_name **)** |
|
||||
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`find_profile_bone_name<class_BoneMap_method_find_profile_bone_name>` **(** :ref:`StringName<class_StringName>` skeleton_bone_name **)** |const| |
|
||||
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| :ref:`StringName<class_StringName>` | :ref:`get_skeleton_bone_name<class_BoneMap_method_get_skeleton_bone_name>` **(** :ref:`StringName<class_StringName>` profile_bone_name **)** |const| |
|
||||
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_skeleton_bone_name<class_BoneMap_method_set_skeleton_bone_name>` **(** :ref:`StringName<class_StringName>` profile_bone_name, :ref:`StringName<class_StringName>` skeleton_bone_name **)** |
|
||||
+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Signals
|
||||
-------
|
||||
|
||||
.. _class_BoneMap_signal_bone_map_updated:
|
||||
|
||||
- **bone_map_updated** **(** **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
This signal is emitted when change the key value in the ``BoneMap``. This is used to validate mapping and to update ``BoneMap`` editor.
|
||||
**bone_map_updated** **(** **)**
|
||||
|
||||
This signal is emitted when change the key value in the **BoneMap**. This is used to validate mapping and to update **BoneMap** editor.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneMap_signal_profile_updated:
|
||||
|
||||
- **profile_updated** **(** **)**
|
||||
.. rst-class:: classref-signal
|
||||
|
||||
This signal is emitted when change the value in profile or change the reference of profile. This is used to update key names in the ``BoneMap`` and to redraw the ``BoneMap`` editor.
|
||||
**profile_updated** **(** **)**
|
||||
|
||||
This signal is emitted when change the value in profile or change the reference of profile. This is used to update key names in the **BoneMap** and to redraw the **BoneMap** editor.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_BoneMap_property_profile:
|
||||
|
||||
- :ref:`SkeletonProfile<class_SkeletonProfile>` **profile**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+----------+--------------------+
|
||||
| *Setter* | set_profile(value) |
|
||||
+----------+--------------------+
|
||||
| *Getter* | get_profile() |
|
||||
+----------+--------------------+
|
||||
:ref:`SkeletonProfile<class_SkeletonProfile>` **profile**
|
||||
|
||||
A :ref:`SkeletonProfile<class_SkeletonProfile>` of the mapping target. Key names in the ``BoneMap`` are synchronized with it.
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_profile** **(** :ref:`SkeletonProfile<class_SkeletonProfile>` value **)**
|
||||
- :ref:`SkeletonProfile<class_SkeletonProfile>` **get_profile** **(** **)**
|
||||
|
||||
A :ref:`SkeletonProfile<class_SkeletonProfile>` of the mapping target. Key names in the **BoneMap** are synchronized with it.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_BoneMap_method_find_profile_bone_name:
|
||||
|
||||
- :ref:`StringName<class_StringName>` **find_profile_bone_name** **(** :ref:`StringName<class_StringName>` skeleton_bone_name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`StringName<class_StringName>` **find_profile_bone_name** **(** :ref:`StringName<class_StringName>` skeleton_bone_name **)** |const|
|
||||
|
||||
Returns a profile bone name having ``skeleton_bone_name``. If not found, an empty :ref:`StringName<class_StringName>` will be returned.
|
||||
|
||||
In the retargeting process, the returned bone name is the bone name of the target skeleton.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneMap_method_get_skeleton_bone_name:
|
||||
|
||||
- :ref:`StringName<class_StringName>` **get_skeleton_bone_name** **(** :ref:`StringName<class_StringName>` profile_bone_name **)** |const|
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`StringName<class_StringName>` **get_skeleton_bone_name** **(** :ref:`StringName<class_StringName>` profile_bone_name **)** |const|
|
||||
|
||||
Returns a skeleton bone name is mapped to ``profile_bone_name``.
|
||||
|
||||
In the retargeting process, the returned bone name is the bone name of the source skeleton.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoneMap_method_set_skeleton_bone_name:
|
||||
|
||||
- void **set_skeleton_bone_name** **(** :ref:`StringName<class_StringName>` profile_bone_name, :ref:`StringName<class_StringName>` skeleton_bone_name **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
void **set_skeleton_bone_name** **(** :ref:`StringName<class_StringName>` profile_bone_name, :ref:`StringName<class_StringName>` skeleton_bone_name **)**
|
||||
|
||||
Maps a skeleton bone name to ``profile_bone_name``.
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ bool
|
||||
|
||||
Boolean built-in type.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -119,89 +121,139 @@ The following code will set ``can_shoot`` to ``false`` and start a timer. This w
|
||||
|
||||
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Constructors
|
||||
------------
|
||||
|
||||
+-------------------------+-------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`bool<class_bool_constructor_bool>` **(** **)** |
|
||||
+-------------------------+-------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`bool<class_bool_constructor_bool>` **(** :ref:`bool<class_bool>` from **)** |
|
||||
+-------------------------+-------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`bool<class_bool_constructor_bool>` **(** :ref:`float<class_float>` from **)** |
|
||||
+-------------------------+-------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`bool<class_bool_constructor_bool>` **(** :ref:`int<class_int>` from **)** |
|
||||
+-------------------------+-------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+-------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`bool<class_bool_constructor_bool>` **(** **)** |
|
||||
+-------------------------+-------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`bool<class_bool_constructor_bool>` **(** :ref:`bool<class_bool>` from **)** |
|
||||
+-------------------------+-------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`bool<class_bool_constructor_bool>` **(** :ref:`float<class_float>` from **)** |
|
||||
+-------------------------+-------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`bool<class_bool_constructor_bool>` **(** :ref:`int<class_int>` from **)** |
|
||||
+-------------------------+-------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Operators
|
||||
---------
|
||||
|
||||
+-------------------------+--------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator !=<class_bool_operator_neq_bool>` **(** :ref:`bool<class_bool>` right **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator \<<class_bool_operator_lt_bool>` **(** :ref:`bool<class_bool>` right **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator ==<class_bool_operator_eq_bool>` **(** :ref:`bool<class_bool>` right **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator ><class_bool_operator_gt_bool>` **(** :ref:`bool<class_bool>` right **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------+--------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator !=<class_bool_operator_neq_bool>` **(** :ref:`bool<class_bool>` right **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator \<<class_bool_operator_lt_bool>` **(** :ref:`bool<class_bool>` right **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator ==<class_bool_operator_eq_bool>` **(** :ref:`bool<class_bool>` right **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`operator ><class_bool_operator_gt_bool>` **(** :ref:`bool<class_bool>` right **)** |
|
||||
+-------------------------+--------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Constructor Descriptions
|
||||
------------------------
|
||||
|
||||
.. _class_bool_constructor_bool:
|
||||
|
||||
- :ref:`bool<class_bool>` **bool** **(** **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
Constructs a default-initialized ``bool`` set to ``false``.
|
||||
:ref:`bool<class_bool>` **bool** **(** **)**
|
||||
|
||||
Constructs a default-initialized **bool** set to ``false``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
- :ref:`bool<class_bool>` **bool** **(** :ref:`bool<class_bool>` from **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
Constructs a ``bool`` as a copy of the given ``bool``.
|
||||
:ref:`bool<class_bool>` **bool** **(** :ref:`bool<class_bool>` from **)**
|
||||
|
||||
Constructs a **bool** as a copy of the given **bool**.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
- :ref:`bool<class_bool>` **bool** **(** :ref:`float<class_float>` from **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
:ref:`bool<class_bool>` **bool** **(** :ref:`float<class_float>` from **)**
|
||||
|
||||
Cast a :ref:`float<class_float>` value to a boolean value, this method will return ``false`` if ``0.0`` is passed in, and ``true`` for all other floats.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
- :ref:`bool<class_bool>` **bool** **(** :ref:`int<class_int>` from **)**
|
||||
.. rst-class:: classref-constructor
|
||||
|
||||
:ref:`bool<class_bool>` **bool** **(** :ref:`int<class_int>` from **)**
|
||||
|
||||
Cast an :ref:`int<class_int>` value to a boolean value, this method will return ``false`` if ``0`` is passed in, and ``true`` for all other ints.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Operator Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_bool_operator_neq_bool:
|
||||
|
||||
- :ref:`bool<class_bool>` **operator !=** **(** :ref:`bool<class_bool>` right **)**
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`bool<class_bool>` **operator !=** **(** :ref:`bool<class_bool>` right **)**
|
||||
|
||||
Returns ``true`` if two bools are different, i.e. one is ``true`` and the other is ``false``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_bool_operator_lt_bool:
|
||||
|
||||
- :ref:`bool<class_bool>` **operator <** **(** :ref:`bool<class_bool>` right **)**
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`bool<class_bool>` **operator <** **(** :ref:`bool<class_bool>` right **)**
|
||||
|
||||
Returns ``true`` if the left operand is ``false`` and the right operand is ``true``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_bool_operator_eq_bool:
|
||||
|
||||
- :ref:`bool<class_bool>` **operator ==** **(** :ref:`bool<class_bool>` right **)**
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`bool<class_bool>` **operator ==** **(** :ref:`bool<class_bool>` right **)**
|
||||
|
||||
Returns ``true`` if two bools are equal, i.e. both are ``true`` or both are ``false``.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_bool_operator_gt_bool:
|
||||
|
||||
- :ref:`bool<class_bool>` **operator >** **(** :ref:`bool<class_bool>` right **)**
|
||||
.. rst-class:: classref-operator
|
||||
|
||||
:ref:`bool<class_bool>` **operator >** **(** :ref:`bool<class_bool>` right **)**
|
||||
|
||||
Returns ``true`` if the left operand is ``true`` and the right operand is ``false``.
|
||||
|
||||
|
||||
@@ -16,114 +16,171 @@ BoxContainer
|
||||
|
||||
Base class for box containers.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Arranges child :ref:`Control<class_Control>` nodes vertically or horizontally, and rearranges them automatically when their minimum size changes.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- :doc:`GUI containers <../tutorials/ui/gui_containers>`
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-------------------------------------------------------+---------------------------------------------------------+-----------+
|
||||
| :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` | :ref:`alignment<class_BoxContainer_property_alignment>` | ``0`` |
|
||||
+-------------------------------------------------------+---------------------------------------------------------+-----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`vertical<class_BoxContainer_property_vertical>` | ``false`` |
|
||||
+-------------------------------------------------------+---------------------------------------------------------+-----------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------------------------------+---------------------------------------------------------+-----------+
|
||||
| :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` | :ref:`alignment<class_BoxContainer_property_alignment>` | ``0`` |
|
||||
+-------------------------------------------------------+---------------------------------------------------------+-----------+
|
||||
| :ref:`bool<class_bool>` | :ref:`vertical<class_BoxContainer_property_vertical>` | ``false`` |
|
||||
+-------------------------------------------------------+---------------------------------------------------------+-----------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Control<class_Control>` | :ref:`add_spacer<class_BoxContainer_method_add_spacer>` **(** :ref:`bool<class_bool>` begin **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------+
|
||||
| :ref:`Control<class_Control>` | :ref:`add_spacer<class_BoxContainer_method_add_spacer>` **(** :ref:`bool<class_bool>` begin **)** |
|
||||
+-------------------------------+---------------------------------------------------------------------------------------------------+
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Theme Properties
|
||||
----------------
|
||||
|
||||
+-----------------------+-----------------------------------------------------------------+-------+
|
||||
| :ref:`int<class_int>` | :ref:`separation<class_BoxContainer_theme_constant_separation>` | ``4`` |
|
||||
+-----------------------+-----------------------------------------------------------------+-------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-----------------------+-----------------------------------------------------------------+-------+
|
||||
| :ref:`int<class_int>` | :ref:`separation<class_BoxContainer_theme_constant_separation>` | ``4`` |
|
||||
+-----------------------+-----------------------------------------------------------------+-------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Enumerations
|
||||
------------
|
||||
|
||||
.. _enum_BoxContainer_AlignmentMode:
|
||||
|
||||
.. _class_BoxContainer_constant_ALIGNMENT_BEGIN:
|
||||
|
||||
.. _class_BoxContainer_constant_ALIGNMENT_CENTER:
|
||||
|
||||
.. _class_BoxContainer_constant_ALIGNMENT_END:
|
||||
.. rst-class:: classref-enumeration
|
||||
|
||||
enum **AlignmentMode**:
|
||||
|
||||
- **ALIGNMENT_BEGIN** = **0** --- The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout).
|
||||
.. _class_BoxContainer_constant_ALIGNMENT_BEGIN:
|
||||
|
||||
- **ALIGNMENT_CENTER** = **1** --- The child controls will be centered in the container.
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
- **ALIGNMENT_END** = **2** --- The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout).
|
||||
:ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **ALIGNMENT_BEGIN** = ``0``
|
||||
|
||||
The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout).
|
||||
|
||||
.. _class_BoxContainer_constant_ALIGNMENT_CENTER:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **ALIGNMENT_CENTER** = ``1``
|
||||
|
||||
The child controls will be centered in the container.
|
||||
|
||||
.. _class_BoxContainer_constant_ALIGNMENT_END:
|
||||
|
||||
.. rst-class:: classref-enumeration-constant
|
||||
|
||||
:ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **ALIGNMENT_END** = ``2``
|
||||
|
||||
The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout).
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_BoxContainer_property_alignment:
|
||||
|
||||
- :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **alignment**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_alignment(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_alignment() |
|
||||
+-----------+----------------------+
|
||||
:ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **alignment** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_alignment** **(** :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` value **)**
|
||||
- :ref:`AlignmentMode<enum_BoxContainer_AlignmentMode>` **get_alignment** **(** **)**
|
||||
|
||||
The alignment of the container's children (must be one of :ref:`ALIGNMENT_BEGIN<class_BoxContainer_constant_ALIGNMENT_BEGIN>`, :ref:`ALIGNMENT_CENTER<class_BoxContainer_constant_ALIGNMENT_CENTER>`, or :ref:`ALIGNMENT_END<class_BoxContainer_constant_ALIGNMENT_END>`).
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoxContainer_property_vertical:
|
||||
|
||||
- :ref:`bool<class_bool>` **vertical**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+---------------------+
|
||||
| *Default* | ``false`` |
|
||||
+-----------+---------------------+
|
||||
| *Setter* | set_vertical(value) |
|
||||
+-----------+---------------------+
|
||||
| *Getter* | is_vertical() |
|
||||
+-----------+---------------------+
|
||||
:ref:`bool<class_bool>` **vertical** = ``false``
|
||||
|
||||
If ``true``, the ``BoxContainer`` will arrange its children vertically, rather than horizontally.
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_vertical** **(** :ref:`bool<class_bool>` value **)**
|
||||
- :ref:`bool<class_bool>` **is_vertical** **(** **)**
|
||||
|
||||
If ``true``, the **BoxContainer** will arrange its children vertically, rather than horizontally.
|
||||
|
||||
Can't be changed when using :ref:`HBoxContainer<class_HBoxContainer>` and :ref:`VBoxContainer<class_VBoxContainer>`.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
.. _class_BoxContainer_method_add_spacer:
|
||||
|
||||
- :ref:`Control<class_Control>` **add_spacer** **(** :ref:`bool<class_bool>` begin **)**
|
||||
.. rst-class:: classref-method
|
||||
|
||||
:ref:`Control<class_Control>` **add_spacer** **(** :ref:`bool<class_bool>` begin **)**
|
||||
|
||||
Adds a :ref:`Control<class_Control>` node to the box as a spacer. If ``begin`` is ``true``, it will insert the :ref:`Control<class_Control>` node in front of all other children.
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Theme Property Descriptions
|
||||
---------------------------
|
||||
|
||||
.. _class_BoxContainer_theme_constant_separation:
|
||||
|
||||
- :ref:`int<class_int>` **separation**
|
||||
.. rst-class:: classref-themeproperty
|
||||
|
||||
+-----------+-------+
|
||||
| *Default* | ``4`` |
|
||||
+-----------+-------+
|
||||
:ref:`int<class_int>` **separation** = ``4``
|
||||
|
||||
The space between the ``BoxContainer``'s elements, in pixels.
|
||||
The space between the **BoxContainer**'s elements, in pixels.
|
||||
|
||||
.. |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.)`
|
||||
|
||||
@@ -14,6 +14,8 @@ BoxMesh
|
||||
|
||||
Generate an axis-aligned box :ref:`PrimitiveMesh<class_PrimitiveMesh>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -21,83 +23,96 @@ Generate an axis-aligned box :ref:`PrimitiveMesh<class_PrimitiveMesh>`.
|
||||
|
||||
The box's UV layout is arranged in a 3×2 layout that allows texturing each face individually. To apply the same texture on all faces, change the material's UV property to ``Vector3(3, 2, 1)``.
|
||||
|
||||
\ **Note:** When using a large textured ``BoxMesh`` (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase :ref:`subdivide_depth<class_BoxMesh_property_subdivide_depth>`, :ref:`subdivide_height<class_BoxMesh_property_subdivide_height>` and :ref:`subdivide_width<class_BoxMesh_property_subdivide_width>` until you no longer notice UV jittering.
|
||||
\ **Note:** When using a large textured **BoxMesh** (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase :ref:`subdivide_depth<class_BoxMesh_property_subdivide_depth>`, :ref:`subdivide_height<class_BoxMesh_property_subdivide_height>` and :ref:`subdivide_width<class_BoxMesh_property_subdivide_width>` until you no longer notice UV jittering.
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-------------------------------+------------------------------------------------------------------+----------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`size<class_BoxMesh_property_size>` | ``Vector3(1, 1, 1)`` |
|
||||
+-------------------------------+------------------------------------------------------------------+----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`subdivide_depth<class_BoxMesh_property_subdivide_depth>` | ``0`` |
|
||||
+-------------------------------+------------------------------------------------------------------+----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`subdivide_height<class_BoxMesh_property_subdivide_height>` | ``0`` |
|
||||
+-------------------------------+------------------------------------------------------------------+----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`subdivide_width<class_BoxMesh_property_subdivide_width>` | ``0`` |
|
||||
+-------------------------------+------------------------------------------------------------------+----------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------+------------------------------------------------------------------+----------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`size<class_BoxMesh_property_size>` | ``Vector3(1, 1, 1)`` |
|
||||
+-------------------------------+------------------------------------------------------------------+----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`subdivide_depth<class_BoxMesh_property_subdivide_depth>` | ``0`` |
|
||||
+-------------------------------+------------------------------------------------------------------+----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`subdivide_height<class_BoxMesh_property_subdivide_height>` | ``0`` |
|
||||
+-------------------------------+------------------------------------------------------------------+----------------------+
|
||||
| :ref:`int<class_int>` | :ref:`subdivide_width<class_BoxMesh_property_subdivide_width>` | ``0`` |
|
||||
+-------------------------------+------------------------------------------------------------------+----------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_BoxMesh_property_size:
|
||||
|
||||
- :ref:`Vector3<class_Vector3>` **size**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``Vector3(1, 1, 1)`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_size(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_size() |
|
||||
+-----------+----------------------+
|
||||
:ref:`Vector3<class_Vector3>` **size** = ``Vector3(1, 1, 1)``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_size** **(** :ref:`Vector3<class_Vector3>` value **)**
|
||||
- :ref:`Vector3<class_Vector3>` **get_size** **(** **)**
|
||||
|
||||
The box's width, height and depth.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoxMesh_property_subdivide_depth:
|
||||
|
||||
- :ref:`int<class_int>` **subdivide_depth**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+----------------------------+
|
||||
| *Setter* | set_subdivide_depth(value) |
|
||||
+-----------+----------------------------+
|
||||
| *Getter* | get_subdivide_depth() |
|
||||
+-----------+----------------------------+
|
||||
:ref:`int<class_int>` **subdivide_depth** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_subdivide_depth** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_subdivide_depth** **(** **)**
|
||||
|
||||
Number of extra edge loops inserted along the Z axis.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoxMesh_property_subdivide_height:
|
||||
|
||||
- :ref:`int<class_int>` **subdivide_height**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+-----------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+-----------------------------+
|
||||
| *Setter* | set_subdivide_height(value) |
|
||||
+-----------+-----------------------------+
|
||||
| *Getter* | get_subdivide_height() |
|
||||
+-----------+-----------------------------+
|
||||
:ref:`int<class_int>` **subdivide_height** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_subdivide_height** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_subdivide_height** **(** **)**
|
||||
|
||||
Number of extra edge loops inserted along the Y axis.
|
||||
|
||||
.. rst-class:: classref-item-separator
|
||||
|
||||
----
|
||||
|
||||
.. _class_BoxMesh_property_subdivide_width:
|
||||
|
||||
- :ref:`int<class_int>` **subdivide_width**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+----------------------------+
|
||||
| *Setter* | set_subdivide_width(value) |
|
||||
+-----------+----------------------------+
|
||||
| *Getter* | get_subdivide_width() |
|
||||
+-----------+----------------------------+
|
||||
:ref:`int<class_int>` **subdivide_width** = ``0``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_subdivide_width** **(** :ref:`int<class_int>` value **)**
|
||||
- :ref:`int<class_int>` **get_subdivide_width** **(** **)**
|
||||
|
||||
Number of extra edge loops inserted along the X axis.
|
||||
|
||||
|
||||
@@ -14,34 +14,46 @@ BoxOccluder3D
|
||||
|
||||
Cuboid shape for use with occlusion culling in :ref:`OccluderInstance3D<class_OccluderInstance3D>`.
|
||||
|
||||
.. rst-class:: classref-introduction-group
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
``BoxOccluder3D`` stores a cuboid shape that can be used by the engine's occlusion culling system.
|
||||
**BoxOccluder3D** stores a cuboid shape that can be used by the engine's occlusion culling system.
|
||||
|
||||
See :ref:`OccluderInstance3D<class_OccluderInstance3D>`'s documentation for instructions on setting up occlusion culling.
|
||||
|
||||
.. rst-class:: classref-reftable-group
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-------------------------------+------------------------------------------------+----------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`size<class_BoxOccluder3D_property_size>` | ``Vector3(1, 1, 1)`` |
|
||||
+-------------------------------+------------------------------------------------+----------------------+
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
+-------------------------------+------------------------------------------------+----------------------+
|
||||
| :ref:`Vector3<class_Vector3>` | :ref:`size<class_BoxOccluder3D_property_size>` | ``Vector3(1, 1, 1)`` |
|
||||
+-------------------------------+------------------------------------------------+----------------------+
|
||||
|
||||
.. rst-class:: classref-section-separator
|
||||
|
||||
----
|
||||
|
||||
.. rst-class:: classref-descriptions-group
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
.. _class_BoxOccluder3D_property_size:
|
||||
|
||||
- :ref:`Vector3<class_Vector3>` **size**
|
||||
.. rst-class:: classref-property
|
||||
|
||||
+-----------+----------------------+
|
||||
| *Default* | ``Vector3(1, 1, 1)`` |
|
||||
+-----------+----------------------+
|
||||
| *Setter* | set_size(value) |
|
||||
+-----------+----------------------+
|
||||
| *Getter* | get_size() |
|
||||
+-----------+----------------------+
|
||||
:ref:`Vector3<class_Vector3>` **size** = ``Vector3(1, 1, 1)``
|
||||
|
||||
.. rst-class:: classref-property-setget
|
||||
|
||||
- void **set_size** **(** :ref:`Vector3<class_Vector3>` value **)**
|
||||
- :ref:`Vector3<class_Vector3>` **get_size** **(** **)**
|
||||
|
||||
The box's size in 3D units.
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user