persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
UIPropertyAnimation< T > Class Template Reference

Interpolates *target from fromVal to toVal over duration seconds. More...

#include <UIPropertyAnimation.hpp>

Inheritance diagram for UIPropertyAnimation< T >:
Collaboration diagram for UIPropertyAnimation< T >:

Public Member Functions

 UIPropertyAnimation (T *tgt, const T &fromVal, const T &toVal, ae::q20_12_t durationSec, UIEase easeMode)
void reverse () override
void reset () override
 Resets runtime state so the animation can play again (used by Loop).
Public Member Functions inherited from UIAnimation
virtual ~UIAnimation ()=default
 UIAnimation (const UIAnimation &)=delete
UIAnimation & operator= (const UIAnimation &)=delete
 UIAnimation (UIAnimation &&)=delete
UIAnimation & operator= (UIAnimation &&)=delete
bool tick (ae::q20_12_t dt)
 Advances the animation by dt seconds (Q20.12).
void pause ()
void resume ()
void cancel ()
bool isCancelled () const
bool isPaused () const
bool isDone () const
void setRepeat (UIRepeatMode mode, int count=-1)

Protected Member Functions

bool onUpdate (ae::q20_12_t dt) override
 Per-frame update.
Protected Member Functions inherited from UIAnimation
 UIAnimation ()=default
bool applyRepeat ()
 Applies repeat policy after a completed cycle.

Static Private Member Functions

static T lerpValue (const T &a, const T &b, ae::q20_12_t t)

Private Attributes

T * target
T from
T to
ae::q20_12_t duration {0}
UIEase ease = UIEase::Linear

Additional Inherited Members

Protected Attributes inherited from UIAnimation
bool paused = false
bool cancelled = false
bool done = false
ae::q20_12_t elapsed {0}
UIRepeatMode repeatMode = UIRepeatMode::Once
int remainingRepeats = -1
 -1 = infinite when mode is not Once.

Detailed Description

template<typename T>
class UIPropertyAnimation< T >

Interpolates *target from fromVal to toVal over duration seconds.

Definition at line 25 of file UIPropertyAnimation.hpp.

Constructor & Destructor Documentation

◆ UIPropertyAnimation()

template<typename T>
UIPropertyAnimation< T >::UIPropertyAnimation ( T * tgt,
const T & fromVal,
const T & toVal,
ae::q20_12_t durationSec,
UIEase easeMode )
inline

Definition at line 28 of file UIPropertyAnimation.hpp.

Member Function Documentation

◆ lerpValue()

template<typename T>
T UIPropertyAnimation< T >::lerpValue ( const T & a,
const T & b,
ae::q20_12_t t )
inlinestaticprivate

Definition at line 62 of file UIPropertyAnimation.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onUpdate()

template<typename T>
bool UIPropertyAnimation< T >::onUpdate ( ae::q20_12_t dt)
inlineoverrideprotectedvirtual

Per-frame update.

Returns
true when this cycle has completed.

Implements UIAnimation.

Definition at line 47 of file UIPropertyAnimation.hpp.

Here is the call graph for this function:

◆ reset()

template<typename T>
void UIPropertyAnimation< T >::reset ( )
inlineoverridevirtual

Resets runtime state so the animation can play again (used by Loop).

Reimplemented from UIAnimation.

Definition at line 41 of file UIPropertyAnimation.hpp.

Here is the call graph for this function:

◆ reverse()

template<typename T>
void UIPropertyAnimation< T >::reverse ( )
inlineoverridevirtual

Reimplemented from UIAnimation.

Definition at line 33 of file UIPropertyAnimation.hpp.

Member Data Documentation

◆ duration

template<typename T>
ae::q20_12_t UIPropertyAnimation< T >::duration {0}
private

Definition at line 91 of file UIPropertyAnimation.hpp.

◆ ease

template<typename T>
UIEase UIPropertyAnimation< T >::ease = UIEase::Linear
private

Definition at line 92 of file UIPropertyAnimation.hpp.

◆ from

template<typename T>
T UIPropertyAnimation< T >::from
private

Definition at line 89 of file UIPropertyAnimation.hpp.

◆ target

template<typename T>
T* UIPropertyAnimation< T >::target
private

Definition at line 88 of file UIPropertyAnimation.hpp.

◆ to

template<typename T>
T UIPropertyAnimation< T >::to
private

Definition at line 90 of file UIPropertyAnimation.hpp.


The documentation for this class was generated from the following file: