DEKI/ENGINE 文档
deki-tween 0.19.0
Deki 包参考
deki-tween

补间动画,提供 30 多种缓动函数。在检视器中使用 TweenComponent,或在代码中使用 TweenManager。

仓库:github.com/dekiengine/deki-tween · 最新版本:0.19.0 · 需要引擎 0.19.0 或更高版本

使用 DekiEditor --packages-add deki-tween <project> 或通过包管理器安装。引擎自身的组件和 C++ API 见 Deki 文档。

在编辑器中显示为 **Tween**。

组件

组件 类别 说明
TweenComponent 动画 沿缓动曲线为对象的位置、缩放或旋转制作动画。

功能开关

可以从构建中去掉的部分。带有 define 的功能通过该 define 开关,其余的随其组件一起被剥离。

功能 define 默认值
Tween DEKI_FEATURE_TWEEN 开

组件参考

TweenComponent

沿缓动曲线为对象的位置、缩放或旋转制作动画。

检视器中的名称:补间组件 · 类别:动画 · 类型:DekiTween::TweenComponent

属性 类型 默认值 约束 说明
targetType enum "Position" Position, Scale, Rotation 要对对象的哪个属性做动画:位置、缩放、旋转或颜色。
endValue Vector3 [0.0, 0.0, 0.0] 要到达的值。使用其中哪些分量取决于上面的目标。
duration float 1 0.1 到 10(滑块) 一次播放所需的时间,单位为秒。
delay float 0 0 到 5(滑块) 开始前等待的时间,单位为秒。
easeType enum "Linear" Linear, SineIn, SineOut, SineInOut, QuadIn, QuadOut, QuadInOut, CubicIn, CubicOut, CubicInOut, QuartIn, QuartOut, QuartInOut, QuintIn, QuintOut, QuintInOut, ExpoIn, ExpoOut, ExpoInOut, CircIn, CircOut, CircInOut, BackIn, BackOut, BackInOut, ElasticIn, ElasticOut, ElasticInOut, BounceIn, BounceOut, BounceInOut 运动的曲线形状。线性显得机械;缓入缓出的开始和结束都很柔和,几乎用在任何地方都显得自然。
loops int32 0 -1 到 100 运行的次数。0 运行一次,-1 无限重复。
pingPong bool false 每隔一次反向播放补间,而不是跳回起点。
autoPlay bool true 对象一激活就开始。关闭时需要由其他东西来启动它。
relative bool false 将结束值视为相对于对象当前位置的偏移,而不是绝对的目标值。

更新日志

更新日志为英文。

0.19.0

Changed

  • minEngine 0.19.0: built against engine 0.19.0, whose component metadata records the package each class is in. A build of this package from before does not load and is rebuilt.

Added

  • Japanese, Simplified Chinese and Korean: editor/lang/ja.json, zh.json and ko.json translate the names, tooltips and enum values this package's components show in the Inspector.
  • The package's editor text goes through the editor's translation (Tr), so it shows in the editor's language. Needs the editor release that adds Localization.h; raise minEngine to it when releasing.

0.18.0

Changed

  • minEngine 0.18.0. Reflection ABI 21: the package must be rebuilt.
  • Names follow the code style (deki-engine/docs/codestyle): types, functions and enum values are PascalCase, constants kPascalCase, members m_PascalCase, locals and parameters camelCase. The code is formatted with clang-format 22.
  • The functions the editor finds by name are PascalCase: DekiTweenRegisterComponents, DekiTweenGetAutoComponentCount, DekiTweenEnsureRegistered and the rest. Built against engine ABI 21; a build of this package from before does not load and is rebuilt.
  • Renamed: on_complete and on_update are onComplete and onUpdate; EaseType::COUNT is Count.

Removed

  • The former names from before 0.16.0 (bare class names, and deki-gpio's DekiEsp32::ESP32PinSetup). A scene that old is upgraded with 0.17 first.

更早的版本:CHANGELOG.md


由包的反射数据生成(引擎 0.19.0)。属性名就是场景文件中使用的键。重命名后会保留别名(兼容性)。