Abstract base class for objects that can generate a useful series of values to drive UI animations.
More...
#include <animatedValue.h>
|
| AnimatedValue (float startVal_, float endVal_) |
| Base class init for the animated value classes.
|
|
virtual float | getNextValue (int msElapsed, int msSinceLastUpdate)=0 |
|
float | getEndValue () const |
| get the ending state of this value object. When we cancel an in-progress animation, we may need to snap to the end value, and this gives a way to get there immediately.
|
|
virtual bool | isFinished ()=0 |
|
virtual bool | updateTarget (float) |
| Attempt to change the end value of an animation that's currently in process.
|
|
void | cancel (bool moveToEndPosition) |
| Cancel an in-progress animation.
|
|
|
float | startVal |
|
float | endVal |
|
float | currentVal |
|
bool | canceled { false } |
|
bool | finished { false } |
|
|
virtual void | doCancel (bool moveToEndPosition) |
|
Abstract base class for objects that can generate a useful series of values to drive UI animations.
◆ AnimatedValue()
friz::AnimatedValue::AnimatedValue |
( |
float |
startVal_, |
|
|
float |
endVal_ |
|
) |
| |
|
inline |
Base class init for the animated value classes.
- Parameters
-
startVal | Initial Value |
endVal | Target/end value. |
◆ cancel()
void friz::AnimatedValue::cancel |
( |
bool |
moveToEndPosition | ) |
|
|
inline |
Cancel an in-progress animation.
- Parameters
-
moveToEndPosition | If true, will immediately take the ending value; otherwise cancels at its current value. |
◆ doCancel()
virtual void friz::AnimatedValue::doCancel |
( |
bool |
moveToEndPosition | ) |
|
|
inlineprivatevirtual |
Override in derived classes to perform any unusual cancellation logic.
◆ getEndValue()
float friz::AnimatedValue::getEndValue |
( |
| ) |
const |
|
inline |
get the ending state of this value object. When we cancel an in-progress animation, we may need to snap to the end value, and this gives a way to get there immediately.
- Returns
- float
◆ getNextValue()
virtual float friz::AnimatedValue::getNextValue |
( |
int |
msElapsed, |
|
|
int |
msSinceLastUpdate |
|
) |
| |
|
pure virtual |
Derived classes should do whatever is needed to generate and return the next value.
- Parameters
-
msElapsed | time since this value started running. (used by 'time-based' values) |
msSinceLastUpdate | time since we were last evaluated (used by threshold-based values) |
- Returns
- next value (or last value if we're finished)
Implemented in friz::TimedValue, and friz::ToleranceValue.
◆ isFinished()
virtual bool friz::AnimatedValue::isFinished |
( |
| ) |
|
|
pure virtual |
Have we reached the end of this animation sequence? By default, we're done when the current value is within tolerance
of the endValue (or if we've been canceled...)
- Returns
- true if this value has reached the end of its animation.
Implemented in friz::ToleranceValue, and friz::TimedValue.
◆ updateTarget()
virtual bool friz::AnimatedValue::updateTarget |
( |
float |
| ) |
|
|
inlinevirtual |
Attempt to change the end value of an animation that's currently in process.
- Parameters
-
- Returns
- true If the value type supports this and the operation succeeded.
Reimplemented in friz::SmoothedValue.
The documentation for this class was generated from the following file: