|
psychic-ui 0.0.0
|
#include <Animation.hpp>
Public Member Functions | |
| Animated (Div *owner, T value, Timing timing={}) | |
| Animated (const Animated &)=delete | |
| Animated & | operator= (const Animated &)=delete |
| Animated (Animated &&)=delete | |
| Animated & | operator= (Animated &&)=delete |
| Animated & | to (T target) |
| Animated & | jump (T value) |
| Animated & | timing (Timing timing) |
| const Timing & | timing () const |
| T | value () const |
| const T & | target () const |
| bool | animating () const |
A value that moves to its targets with a timing instead of jumping, for what a component draws itself (style properties have transition). Keep it as a member of the div it belongs to:
Animated<float> _offset{this, 0.0f, Timing{200ms, Ease::Out}};
_offset.to(row.y()); // From where it is now
float y = _offset.value(); // In draw()
Its owner's window advances it every frame (Window::updateAnimations) and draws while it moves. It jumps when its owner isn't in a window, or the window reduces motion. It ends with its owner, the window only holds it weakly.
|
inlinenodiscard |
Whether it is on its way
|
inline |
Set the value at once
|
inlinenodiscard |
Where it goes
|
inline |
How the next to moves (a theme's motion token, read in styleUpdated); a move in progress keeps its own
|
inline |
Move to target from the current value (a spring keeps its velocity)
|
inlinenodiscard |
Where it is, as of the window's last updateAnimations