29 #ifndef DOXYGEN_SHOULD_SKIP_THIS    45     using Setter = std::function<
void(
const T&)>;
    79     , m_setter([&value](
const T& newValue) { value = newValue; })
   129       m_duration = duration;
   147       return gf::lerp(m_origin, m_target, m_easing(m_elapsed.asSeconds() / m_duration.asSeconds()));
   156       return m_elapsed >= m_duration;
   167       if (m_elapsed >= m_duration) {
   168         m_elapsed = m_duration;
   178       m_elapsed = Time::zero();
   190 #ifndef DOXYGEN_SHOULD_SKIP_THIS void setOrigin(T origin)
Change the origin of the tween. 
Definition: Tween.h:92
 
Tween(T origin, T target, Setter setter, Time duration, Easing easing=Ease::linear)
Constructor with a setter. 
Definition: Tween.h:56
 
void restart()
Restart the tween. 
Definition: Tween.h:177
 
bool isFinished() const
Check if the tween is finished. 
Definition: Tween.h:155
 
void setDuration(Time duration)
Change the duration of the tween. 
Definition: Tween.h:128
 
constexpr T getOrigin() const noexcept
Get the origin of the tween. 
Definition: Tween.h:101
 
void setTarget(T target)
Change the target of the tween. 
Definition: Tween.h:110
 
The namespace for gf classes. 
Definition: Action.h:34
 
static float linear(float t)
Linear easing. 
 
constexpr T getTarget() const noexcept
Get the target of the tween. 
Definition: Tween.h:119
 
constexpr Time getDuration() const noexcept
Get the duration of the tween. 
Definition: Tween.h:137
 
Tween(T origin, T target, T &value, Time duration, Easing easing=Ease::linear)
Constructor with a reference. 
Definition: Tween.h:76
 
Predefined easing functions. 
Definition: Easings.h:239
 
void update(Time time)
Update the tween. 
Definition: Tween.h:164
 
An interpolation between two values. 
Definition: Tween.h:40
 
T getValue() const
Get the current value of the tween. 
Definition: Tween.h:146