Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
AnimationNodeBlendSpace1D¶
继承: AnimationRootNode < AnimationNode < Resource < RefCounted < Object
一组放置在一个虚拟轴上的 AnimationRootNode,在两个相邻节点之间交叉淡化。被 AnimationTree 使用。
描述¶
可添加到 AnimationNodeBlendTree 的资源。
AnimationNodeBlendSpace1D 代表一个虚拟轴,可以使用 add_blend_point 在上面添加任何类型的 AnimationRootNode。输出的是最接近当前值的两个 AnimationRootNode 之间的线性混合。
教程¶
属性¶
|
||
|
||
|
||
|
||
|
||
|
方法¶
void |
add_blend_point ( AnimationRootNode node, float pos, int at_index=-1 ) |
get_blend_point_count ( ) const |
|
get_blend_point_node ( int point ) const |
|
get_blend_point_position ( int point ) const |
|
void |
remove_blend_point ( int point ) |
void |
set_blend_point_node ( int point, AnimationRootNode node ) |
void |
set_blend_point_position ( int point, float pos ) |
枚举¶
enum BlendMode:
BlendMode BLEND_MODE_INTERPOLATED = 0
动画之间的插值是线性的。
BlendMode BLEND_MODE_DISCRETE = 1
混合空间播放混合位置最接近的动画节点的动画。可用于逐帧的 2D 动画。
BlendMode BLEND_MODE_DISCRETE_CARRY = 2
类似于 BLEND_MODE_DISCRETE,但在最后一个动画的播放位置开始新的动画。
属性说明¶
BlendMode blend_mode = 0
控制动画之间的插值。见 BlendMode 常量。
float max_space = 1.0
用于点位置的混合空间轴的上限。见 add_blend_point。
float min_space = -1.0
用于点位置的混合空间轴的下限。见 add_blend_point。
float snap = 0.1
当在轴上移动一个点时,要捕捉到的位置增量。
bool sync = false
如果为 false
,则当混合值为 0
时,停止混合动画的帧。
如果为 true
,则强制混合动画以前进帧。
String value_label = "value"
混合空间虚拟轴的标签。
方法说明¶
void add_blend_point ( AnimationRootNode node, float pos, int at_index=-1 )
在虚拟轴上 pos
设定的给定位置添加一个代表 node
的新点。你可以使用 at_index
参数将其插入到特定的索引处。如果使用 at_index
的默认值,这个点会被插入到混合点数组的末尾。
int get_blend_point_count ( ) const
返回混合轴上的点的数量。
AnimationRootNode get_blend_point_node ( int point ) const
返回索引 point
处的点所引用的 AnimationNode。
float get_blend_point_position ( int point ) const
返回索引 point
处的点的位置。
void remove_blend_point ( int point )
从混合轴移除索引 point
处的点。
void set_blend_point_node ( int point, AnimationRootNode node )
更改索引 point
处的点所引用的 AnimationNode。
void set_blend_point_position ( int point, float pos )
更新混合轴上索引 point
处的点的位置。