22#include <kiwano/2d/animation/Animation.h>
23#include <kiwano/2d/animation/EaseFunc.h>
24#include <kiwano/utils/Logger.h>
53 void SetEaseFunc(
const EaseFunc& func);
60 float Interpolate(
float frac);
64 virtual void UpdateTween(
Actor* target,
float frac) = 0;
86 Vec2 GetDisplacement()
const;
90 void SetDisplacement(
const Vec2& displacement);
101 void Init(
Actor* target)
override;
103 void UpdateTween(
Actor* target,
float frac)
override;
124 Point GetDistination()
const;
128 void SetDistination(
const Point& distination);
138 KGE_ERRORF(
"Reverse() not supported in MoveToAnimation");
143 void Init(
Actor* target)
override;
164 Vec2 GetDisplacement()
const;
168 float GetJumpHeight()
const;
172 int GetJumpCount()
const;
176 void SetDisplacement(
const Vec2& displacement);
180 void SetJumpHeight(
float height);
184 void SetJumpCount(
int count);
195 void Init(
Actor* target)
override;
197 void UpdateTween(
Actor* target,
float frac)
override;
222 Point GetDistination()
const;
226 void SetDistination(
const Point& distination);
236 KGE_ERRORF(
"Reverse() not supported in JumpToAnimation");
241 void Init(
Actor* target)
override;
260 float GetScaleX()
const;
264 float GetScaleY()
const;
268 void SetScaleX(
float scale_x);
272 void SetScaleY(
float scale_y);
283 void Init(
Actor* target)
override;
285 void UpdateTween(
Actor* target,
float frac)
override;
305 float GetTargetScaleX()
const;
309 float GetTargetScaleY()
const;
313 void SetTargetScaleX(
float scale_x);
317 void SetTargetScaleY(
float scale_y);
327 KGE_ERRORF(
"Reverse() not supported in ScaleToAnimation");
332 void Init(
Actor* target)
override;
351 float GetTargetOpacity()
const;
355 void SetTargetOpacity(
float opacity);
365 KGE_ERRORF(
"Reverse() not supported in FadeToAnimation");
370 void Init(
Actor* target)
override;
372 void UpdateTween(
Actor* target,
float frac)
override;
393 float GetRotation()
const;
397 void SetRotation(
float rotation);
408 void Init(
Actor* target)
override;
410 void UpdateTween(
Actor* target,
float frac)
override;
430 float GetTargetRotation()
const;
434 void SetTargetRotation(
float rotation);
444 KGE_ERRORF(
"Reverse() not supported in RotateToAnimation");
449 void Init(
Actor* target)
override;
479 return displacement_;
484 displacement_ = displacement;
494 distination_ = distination;
499 return displacement_;
514 displacement_ = displacement;
534 distination_ = distination;
569 end_val_.x = scale_x;
574 end_val_.y = scale_y;
594 delta_val_ = rotation;
动画
Definition: Animation.h:103
透明度渐变动画
Definition: TweenAnimation.h:341
void SetTargetOpacity(float opacity)
设置目标透明度
Definition: TweenAnimation.h:582
FadeToAnimation * Reverse() const override
获取该动画的倒转
Definition: TweenAnimation.h:363
float GetTargetOpacity() const
获取目标透明度
Definition: TweenAnimation.h:577
相对跳跃动画
Definition: TweenAnimation.h:152
void SetJumpCount(int count)
设置跳跃次数
Definition: TweenAnimation.h:522
void SetDisplacement(const Vec2 &displacement)
设置跳跃位移
Definition: TweenAnimation.h:512
int GetJumpCount() const
获取跳跃次数
Definition: TweenAnimation.h:507
float GetJumpHeight() const
获取跳跃高度
Definition: TweenAnimation.h:502
Vec2 GetDisplacement() const
获取跳跃位移
Definition: TweenAnimation.h:497
void SetJumpHeight(float height)
设置跳跃高度
Definition: TweenAnimation.h:517
跳跃动画
Definition: TweenAnimation.h:210
void SetDistination(const Point &distination)
设置目的坐标
Definition: TweenAnimation.h:532
Point GetDistination() const
获取目的坐标
Definition: TweenAnimation.h:527
JumpToAnimation * Reverse() const override
获取该动画的倒转
Definition: TweenAnimation.h:234
相对位移动画
Definition: TweenAnimation.h:76
Vec2 GetDisplacement() const
获取位移向量
Definition: TweenAnimation.h:477
void SetDisplacement(const Vec2 &displacement)
设置位移向量
Definition: TweenAnimation.h:482
位移动画
Definition: TweenAnimation.h:114
MoveToAnimation * Reverse() const override
获取该动画的倒转
Definition: TweenAnimation.h:136
void SetDistination(const Point &distination)
设置目的坐标
Definition: TweenAnimation.h:492
Point GetDistination() const
获取目的坐标
Definition: TweenAnimation.h:487
相对旋转动画
Definition: TweenAnimation.h:383
void SetRotation(float rotation)
设置角度相对变化值
Definition: TweenAnimation.h:592
float GetRotation() const
获取角度相对变化值
Definition: TweenAnimation.h:587
旋转动画
Definition: TweenAnimation.h:420
RotateToAnimation * Reverse() const override
获取该动画的倒转
Definition: TweenAnimation.h:442
void SetTargetRotation(float rotation)
设置目标角度
Definition: TweenAnimation.h:602
float GetTargetRotation() const
获取目标角度
Definition: TweenAnimation.h:597
相对缩放动画
Definition: TweenAnimation.h:250
void SetScaleX(float scale_x)
设置纵向缩放相对变化值
Definition: TweenAnimation.h:547
float GetScaleX() const
获取横向缩放相对变化值
Definition: TweenAnimation.h:537
float GetScaleY() const
获取横向缩放相对变化值
Definition: TweenAnimation.h:542
void SetScaleY(float scale_y)
设置纵向缩放相对变化值
Definition: TweenAnimation.h:552
缩放动画
Definition: TweenAnimation.h:295
void SetTargetScaleY(float scale_y)
设置纵向缩放目标值
Definition: TweenAnimation.h:572
float GetTargetScaleY() const
获取横向缩放目标值
Definition: TweenAnimation.h:562
float GetTargetScaleX() const
获取横向缩放目标值
Definition: TweenAnimation.h:557
void SetTargetScaleX(float scale_x)
设置纵向缩放目标值
Definition: TweenAnimation.h:567
ScaleToAnimation * Reverse() const override
获取该动画的倒转
Definition: TweenAnimation.h:325
补间动画
Definition: TweenAnimation.h:37
Duration GetDuration() const
获取动画时长
Definition: TweenAnimation.h:462
void SetEaseFunc(const EaseFunc &func)
设置动画速度缓动函数
Definition: TweenAnimation.h:472
const EaseFunc & GetEaseFunc() const
获取动画速度缓动函数
Definition: TweenAnimation.h:457
void SetDuration(Duration duration)
设置动画时长
Definition: TweenAnimation.h:467
时间段
Definition: Duration.h:48