GFTweenActionStep¶
API Reference / Action Queue / 类索引
- 路径:
addons/gf/extensions/action_queue/tween/gf_tween_action_step.gd - 模块:
Action Queue - 继承:
Resource - API:
public - 类别:资源定义 (
resource_definition) - 首次版本:
3.17.0
配置化 Tween 属性步骤。 描述一个目标对象属性如何缓动,不绑定具体节点或业务动作。
成员概览¶
| 类型 | 名称 | 签名 |
|---|---|---|
| 属性 | property_name |
var property_name: NodePath = ^"position" |
| 属性 | target_value |
var target_value: Variant = null |
| 属性 | duration |
var duration: float = 0.2 |
| 属性 | delay |
var delay: float = 0.0 |
| 属性 | as_relative |
var as_relative: bool = false |
| 属性 | parallel |
var parallel: bool = false |
| 属性 | transition_type |
var transition_type: Tween.TransitionType = Tween.TRANS_CUBIC |
| 属性 | ease_type |
var ease_type: Tween.EaseType = Tween.EASE_OUT |
| 属性 | marker_id |
var marker_id: StringName = &"" |
| 方法 | append_to_tween |
func append_to_tween(tween: Tween, target: Object, duration_scale: float = 1.0) -> Variant: |
| 方法 | apply_instant |
func apply_instant(target: Object) -> void: |
| 方法 | duplicate_step |
func duplicate_step() -> GFTweenActionStep: |
| 方法 | can_apply_to |
func can_apply_to(target: Object) -> bool: |
| 方法 | get_validation_error |
func get_validation_error(target: Object) -> String: |
| 方法 | capture_initial_value |
func capture_initial_value(target: Object) -> Variant: |
属性¶
property_name¶
- API:
public
要缓动的属性路径。
target_value¶
- API:
public
目标值。
结构:
target_value: Variant,可写入 property_name 的目标值;相对步骤中会与当前值相加。
duration¶
- API:
public
步骤持续时间。
delay¶
- API:
public
步骤延迟。
as_relative¶
- API:
public
是否相对当前值偏移。
parallel¶
- API:
public
是否与前一个步骤并行。
transition_type¶
- API:
public
Tween 过渡类型。
ease_type¶
- API:
public
Tween 缓动类型。
marker_id¶
- API:
public
可选步骤标记。非空时 GFConfiguredTweenAction 会在步骤结束后发出 marker_reached。
方法¶
append_to_tween¶
- API:
public
追加到 Tween。
参数:
| 名称 | 说明 |
|---|---|
tween |
目标 Tween。 |
target |
目标对象。 |
duration_scale |
时长缩放。 |
返回:创建的 Tweener。
结构:
return: Variant,成功时为 PropertyTweener;无效时为 null。
apply_instant¶
- API:
public
立即应用步骤目标值。
参数:
| 名称 | 说明 |
|---|---|
target |
目标对象。 |
duplicate_step¶
- API:
public
创建深拷贝。
返回:新步骤。
can_apply_to¶
- API:
public
检查目标对象是否能应用当前步骤。
参数:
| 名称 | 说明 |
|---|---|
target |
目标对象。 |
返回:可应用时返回 true。
get_validation_error¶
- API:
public
获取当前步骤对目标对象的校验错误。
参数:
| 名称 | 说明 |
|---|---|
target |
目标对象。 |
返回:校验通过时返回空字符串。
capture_initial_value¶
- API:
public
捕获当前属性值。
参数:
| 名称 | 说明 |
|---|---|
target |
目标对象。 |
返回:属性值;步骤无效时返回 null。
结构:
return: Variant,目标属性的深拷贝值;步骤无效时为 null。