Lightweight, embeddable value animator for widget members. More...
#include <animation.hpp>
Public Member Functions | |
| ValueAnimation ()=default | |
| ValueAnimation (float initial) | |
| void | animate_to (float target, float duration, EasingFunction ease=easing::ease_out_quad) |
| Set a new target. | |
| void | set (float value) |
| Snap to value immediately (no animation). | |
| bool | advance (float dt) |
| Advance by dt. Returns true if still animating. | |
| float | value () const |
| float | target () const |
| bool | animating () const |
| void | cancel () |
| Cancel in-flight animation, keep current value. | |
Lightweight, embeddable value animator for widget members.
No heap allocation. Designed to be a member variable.
|
default |
|
inlineexplicit |
|
inline |
Advance by dt. Returns true if still animating.
|
inline |
Set a new target.
Starts animating from current value.
Honors MotionPreferences::current() at start:
|
inline |
|
inline |
Cancel in-flight animation, keep current value.
|
inline |
Snap to value immediately (no animation).
|
inline |
|
inline |