A single delta-time value animation. More...
#include <Malena/Animation/Tweener.h>
Public Member Functions | |
| Tweener ()=default | |
| Tweener (T from, T to, float duration, Easing::Fn easing=Easing::Linear) | |
| void | complete () |
| Jump to the end immediately, firing onUpdate(end) + onComplete once. | |
| Tweener & | delay (float seconds) |
| bool | done () const |
| Tweener & | easing (Easing::Fn fn) |
| Tweener & | loop (bool on=true) |
| Tweener & | onComplete (std::function< void()> cb) |
| Tweener & | onUpdate (std::function< void(const T &)> cb) |
| Tweener & | pingPong (bool on=true) |
| void | stop () |
| Stop where it is — no onComplete. (Used by cancel paths.). | |
| void | update (float dt) |
Advance by dt seconds. Safe to keep calling after completion (no-op). | |
| const T & | value () const |
A single delta-time value animation.
Drive it by calling update(dt) each frame with the elapsed seconds. The interpolated value is delivered through onUpdate; onComplete fires once when a non-looping tween finishes. Timing is real-time (seconds), so animation speed is independent of framerate.
| T | A type with a detail::lerp overload (float, Vector2f, Color). |
|
default |
|
inline |
|
inline |
|
inline |
|
inlinenodiscard |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenodiscard |