mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
325 lines
15 KiB
ReStructuredText
325 lines
15 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/AnimationNodeBlendSpace1D.xml.
|
|
|
|
.. _class_AnimationNodeBlendSpace1D:
|
|
|
|
AnimationNodeBlendSpace1D
|
|
=========================
|
|
|
|
**继承:** :ref:`AnimationRootNode<class_AnimationRootNode>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
一组放置在一个虚拟轴上的 :ref:`AnimationRootNode<class_AnimationRootNode>`\ ,在两个相邻节点之间交叉淡化。被 :ref:`AnimationTree<class_AnimationTree>` 使用。
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
描述
|
|
----
|
|
|
|
可添加到 :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>` 的资源。
|
|
|
|
\ **AnimationNodeBlendSpace1D** 代表一个虚拟轴,可以使用 :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>` 在上面添加任何类型的 :ref:`AnimationRootNode<class_AnimationRootNode>`\ 。输出的是最接近当前值的两个 :ref:`AnimationRootNode<class_AnimationRootNode>` 之间的线性混合。
|
|
|
|
可以使用 :ref:`min_space<class_AnimationNodeBlendSpace1D_property_min_space>` 和 :ref:`max_space<class_AnimationNodeBlendSpace1D_property_max_space>` 来扩展轴的范围。
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
教程
|
|
----
|
|
|
|
- :doc:`使用 AnimationTree <../tutorials/animation/animation_tree>`
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
属性
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+------------------------------------------------------------+--------------------------------------------------------------------------+-------------+
|
|
| :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` | :ref:`blend_mode<class_AnimationNodeBlendSpace1D_property_blend_mode>` | ``0`` |
|
|
+------------------------------------------------------------+--------------------------------------------------------------------------+-------------+
|
|
| :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
|
|
|
|
方法
|
|
----
|
|
|
|
.. 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
|
|
|
|
枚举
|
|
----
|
|
|
|
.. _enum_AnimationNodeBlendSpace1D_BlendMode:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **BlendMode**:
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_constant_BLEND_MODE_INTERPOLATED:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` **BLEND_MODE_INTERPOLATED** = ``0``
|
|
|
|
动画之间的插值是线性的。
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_constant_BLEND_MODE_DISCRETE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` **BLEND_MODE_DISCRETE** = ``1``
|
|
|
|
混合空间播放混合位置最接近的动画节点的动画。可用于逐帧的 2D 动画。
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_constant_BLEND_MODE_DISCRETE_CARRY:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` **BLEND_MODE_DISCRETE_CARRY** = ``2``
|
|
|
|
类似于 :ref:`BLEND_MODE_DISCRETE<class_AnimationNodeBlendSpace1D_constant_BLEND_MODE_DISCRETE>`\ ,但在最后一个动画的播放位置开始新的动画。
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
属性说明
|
|
--------
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_property_blend_mode:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` **blend_mode** = ``0``
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- void **set_blend_mode** **(** :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` value **)**
|
|
- :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` **get_blend_mode** **(** **)**
|
|
|
|
控制动画之间的插值。见 :ref:`BlendMode<enum_AnimationNodeBlendSpace1D_BlendMode>` 常量。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_property_max_space:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
: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** **(** **)**
|
|
|
|
用于点位置的混合空间轴的上限。见 :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_property_min_space:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
: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** **(** **)**
|
|
|
|
用于点位置的混合空间轴的下限。见 :ref:`add_blend_point<class_AnimationNodeBlendSpace1D_method_add_blend_point>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_property_snap:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
: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** **(** **)**
|
|
|
|
当在轴上移动一个点时,要捕捉到的位置增量。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_property_sync:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
: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** **(** **)**
|
|
|
|
如果为 ``false``\ ,则当混合值为 ``0`` 时,停止混合动画的帧。
|
|
|
|
如果为 ``true``\ ,则强制混合动画以前进帧。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_property_value_label:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
: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** **(** **)**
|
|
|
|
混合空间虚拟轴的标签。
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
方法说明
|
|
--------
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_method_add_blend_point:
|
|
|
|
.. 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 **)**
|
|
|
|
在虚拟轴上 ``pos`` 设定的给定位置添加一个代表 ``node`` 的新点。你可以使用 ``at_index`` 参数将其插入到特定的索引处。如果使用 ``at_index`` 的默认值,这个点会被插入到混合点数组的末尾。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_method_get_blend_point_count:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`int<class_int>` **get_blend_point_count** **(** **)** |const|
|
|
|
|
返回混合轴上的点的数量。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_method_get_blend_point_node:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`AnimationRootNode<class_AnimationRootNode>` **get_blend_point_node** **(** :ref:`int<class_int>` point **)** |const|
|
|
|
|
返回索引 ``point`` 处的点所引用的 :ref:`AnimationNode<class_AnimationNode>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_method_get_blend_point_position:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`float<class_float>` **get_blend_point_position** **(** :ref:`int<class_int>` point **)** |const|
|
|
|
|
返回索引 ``point`` 处的点的位置。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_method_remove_blend_point:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
void **remove_blend_point** **(** :ref:`int<class_int>` point **)**
|
|
|
|
从混合轴移除索引 ``point`` 处的点。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_method_set_blend_point_node:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
void **set_blend_point_node** **(** :ref:`int<class_int>` point, :ref:`AnimationRootNode<class_AnimationRootNode>` node **)**
|
|
|
|
更改索引 ``point`` 处的点所引用的 :ref:`AnimationNode<class_AnimationNode>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeBlendSpace1D_method_set_blend_point_position:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
void **set_blend_point_position** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` pos **)**
|
|
|
|
更新混合轴上索引 ``point`` 处的点的位置。
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
|
.. |const| replace:: :abbr:`const (本方法没有副作用。不会修改该实例的任何成员变量。)`
|
|
.. |vararg| replace:: :abbr:`vararg (本方法除了在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
|
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
|
.. |static| replace:: :abbr:`static (调用本方法无需实例,所以可以直接使用类名调用。)`
|
|
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效操作符。)`
|
|
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列标志构成的位掩码整数。)`
|