An interpolation between two values.
More...
#include <gf/Tween.h>
|
using | Setter = std::function< void(const T &)> |
| A setter function. More...
|
|
template<typename T>
class gf::Tween< T >
An interpolation between two values.
- See also
- Inbetweening - Wikipedia
◆ Setter
template<typename T >
using gf::Tween< T >::Setter = std::function<void(const T&)> |
◆ Tween() [1/2]
Constructor with a setter.
- Parameters
-
origin | The origin value |
target | The target value |
setter | The setter |
duration | The duration of the tween |
easing | The easing for the interpolation |
◆ Tween() [2/2]
Constructor with a reference.
- Parameters
-
origin | The origin value |
target | The target value |
value | A reference on the value |
duration | The duration of the tween |
easing | The easing for the interpolation |
◆ getDuration()
Get the duration of the tween.
- Returns
- The current duration
◆ getOrigin()
template<typename T >
constexpr T gf::Tween< T >::getOrigin |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the origin of the tween.
- Returns
- The current origin
◆ getTarget()
template<typename T >
constexpr T gf::Tween< T >::getTarget |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Get the target of the tween.
- Returns
- The current target
◆ getValue()
Get the current value of the tween.
- Returns
- The interpolated value
◆ isFinished()
Check if the tween is finished.
- Returns
- True if the tween is finished
◆ restart()
◆ setDuration()
Change the duration of the tween.
- Parameters
-
◆ setOrigin()
Change the origin of the tween.
- Parameters
-
◆ setTarget()
Change the target of the tween.
- Parameters
-
◆ update()
Update the tween.
- Parameters
-
time | The time since the last update |