6 #ifndef TB_ANIMATION_UTILS_H
7 #define TB_ANIMATION_UTILS_H
9 #include "animation/tb_animation.h"
20 float current_progress;
27 double animation_duration = ANIMATION_DEFAULT_DURATION)
28 : src_val(initial_value), dst_val(initial_value), current_progress(0)
30 TBAnimationObject::animation_curve = animation_curve;
31 TBAnimationObject::animation_duration = animation_duration;
34 float GetValue()
const {
return src_val + (dst_val - src_val) * current_progress; }
35 void SetValueAnimated(
float value) { src_val = GetValue(); dst_val = value; TBAnimationManager::StartAnimation(
this, animation_curve, animation_duration); }
55 double animation_duration = ANIMATION_DEFAULT_DURATION)
64 #endif // TB_ANIMATION_UTILS_H
virtual void OnAnimationUpdate(float progress)
Called on animation update.
Definition: tb_animation_utils.h:39
virtual void OnAnimationUpdate(float progress)
Called on animation update.
Definition: tb_animation_utils.h:59
Definition: tb_animation_utils.h:15
Definition: tb_animation_utils.h:45
virtual void OnAnimationStart()
Called on animation start.
Definition: tb_animation_utils.h:58
virtual void OnAnimationStart()
Called on animation start.
Definition: tb_animation_utils.h:38
static void AbortAnimation(TBAnimationObject *obj, bool delete_animation)
Abort the animation.
Definition: tb_animation.cpp:153
ANIMATION_CURVE
Defines how the animation progress value is interpolated.
Definition: tb_animation.h:17
TBAnimationObject - Base class for all animated object.
Definition: tb_animation.h:72
virtual void OnAnimationStop(bool aborted)
Called on animation stop.
Definition: tb_animation_utils.h:40