22 virtual void end(
bool fireCallback ) = 0;
30 Tween(
const T& startVal,
const T& endVal, std::function<
float(
float )>
easeFn )
39 Tween(
const T& startVal,
const T& endVal, std::function<
float(
float )>
easeFn, std::function<
void()> onDone )
52 Tween&
set(
const T& startVal,
const T& endVal, std::function<
float(
float )>
easeFn, std::function<
void()> onDone =
nullptr )
111 virtual void startNow(
long durationMillis )
override
119 auto start = ga::Clock::now() +
ga::Millis( delayMs );
138 const T&
endNow(
bool fireCallback =
true )
156 }
catch ( std::exception& e ) {
161 return ptr !=
nullptr;
164 void end(
bool fireCallback =
true )
override
174 }
catch ( std::exception& e ) {
Definition: timeline_component.h:11
virtual void setEnd(const TimePoint &time)
Definition: timer.cpp:16
virtual bool isActive()
Definition: timer.h:71
virtual bool isDone()
Definition: timer.h:70
virtual void setStart(const TimePoint &time)
Definition: timer.cpp:11
virtual void clear()
Definition: timer.cpp:27
virtual bool isSet()
Definition: timer.h:68
virtual void startNow()
Definition: timer.cpp:33
virtual bool isStarted()
Definition: timer.h:69
double elapsedPercent()
Definition: timer.cpp:61
virtual bool isStarted_()=0
void setName(const std::string &name)
Definition: tween.h:14
virtual void end(bool fireCallback)=0
const std::string & getName()
Definition: tween.h:15
virtual ~TweenBase()=default
std::string m_name
Definition: tween.h:18
void startAfterDelay(long delayMs, long durationMs)
Definition: tween.h:117
const T & update()
Definition: tween.h:125
Tween & unbind()
Definition: tween.h:92
Tween & setEndVal(const T &endVal)
Definition: tween.h:62
virtual void startNow() override
Definition: tween.h:104
T * m_boundPtr
Definition: tween.h:149
T m_val
Definition: tween.h:145
Tween & setEaseFn(ga::EaseType easeFnType)
Definition: tween.h:67
Tween(const T &startVal, const T &endVal, std::function< float(float)> easeFn)
Definition: tween.h:30
T m_endVal
Definition: tween.h:145
bool isStarted_() override
Definition: tween.h:200
Tween & setOnDone(std::function< void()> onDone)
Definition: tween.h:80
const T & getStartVal() const
Definition: tween.h:98
std::function< void()> m_onDone
Definition: tween.h:148
virtual void startNow(long durationMillis) override
Definition: tween.h:111
Tween()
Definition: tween.h:48
const T & endNow(bool fireCallback=true)
Definition: tween.h:138
bool update_() override
Definition: tween.h:181
const T & getEndVal() const
Definition: tween.h:99
Tween & set(const T &startVal, const T &endVal, std::function< float(float)> easeFn, std::function< void()> onDone=nullptr)
Definition: tween.h:52
ga::EaseType m_easeFnType
Definition: tween.h:147
T m_startVal
Definition: tween.h:145
Tween & setEaseFn(std::function< float(float)> easeFn)
Definition: tween.h:73
bool isDone_() override
Definition: tween.h:195
Tween(const T &startVal, const T &endVal, std::function< float(float)> easeFn, std::function< void()> onDone)
Definition: tween.h:39
Tween & bind(T *ptr)
Definition: tween.h:87
const T & getValue() const
Definition: tween.h:101
bool updateBoundPtr()
Definition: tween.h:150
void end(bool fireCallback=true) override
Definition: tween.h:164
std::function< float(float)> m_easeFn
Definition: tween.h:146
Tween & setStartVal(const T &startVal)
Definition: tween.h:57
std::function< float(float)> easeFn(const EaseType &type)
Definition: easing.h:102
T interpolate(const T &a, const T &b, float pct, std::function< float(float)> easeFn, bool bClamp=false)
Definition: math.h:263
std::chrono::milliseconds Millis
Definition: timer.h:15
EaseType
Definition: easing.h:87