#include <aurore/core/animation.hpp>
◆ Animatable()
| aurore::Animatable::Animatable |
( |
float |
value = 0.0f | ) |
|
Creates an animatable with the given initial value.
◆ addStep()
| void aurore::Animatable::addStep |
( |
float |
targetValue, |
|
|
int32_t |
duration, |
|
|
EasingFunction |
easing = EasingFunction::linear |
|
) |
| |
Adds an animation step to the target value, lasting the specified duration in milliseconds.
An animation can have multiple steps. Target value can be greater and lower than the previous step (it can go forwards or backwards). Easing function is optional, default is EasingFunction::linear.
Duration is int32_t due to internal limitations, so a step cannot last for longer than 2 147 483 647ms. The sum of the duration of all steps cannot exceed 71582min.
◆ getProgress()
| float aurore::Animatable::getProgress |
( |
| ) |
|
Returns the progress of the animation between 0.0f and 1.0f.
◆ getValue()
| float aurore::Animatable::getValue |
( |
| ) |
|
Returns the current animatable value.
◆ onReset()
| void aurore::Animatable::onReset |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ onRewind()
| void aurore::Animatable::onRewind |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ onUpdate()
| bool aurore::Animatable::onUpdate |
( |
Time |
delta | ) |
|
|
overrideprotectedvirtual |
Executed every frame while the ticking lives. Delta is the time difference in ms between the last frame and the current one. Must return false if the ticking is finished and should be removed from the list of active tickings. The end callback will automatically be called then.
Implements aurore::Ticking.
◆ operator float() [1/2]
| aurore::Animatable::operator float |
( |
| ) |
|
◆ operator float() [2/2]
| aurore::Animatable::operator float |
( |
| ) |
const |
◆ operator=()
| void aurore::Animatable::operator= |
( |
const float |
value | ) |
|
◆ operator==()
| bool aurore::Animatable::operator== |
( |
const float |
value | ) |
|
◆ reset() [1/2]
| void aurore::Animatable::reset |
( |
| ) |
|
Stops and resets the animation. The value will stay where it's at. All steps are removed. If an animation was already ongoing for that animatable, its end callback will be called.
◆ reset() [2/2]
| void aurore::Animatable::reset |
( |
float |
initialValue | ) |
|
Stops and resets the animation, going back to the given initial value. All steps are removed. If an animation was already ongoing for that animatable, its end callback will be called.
The documentation for this class was generated from the following file: