A single_tweener makes a value to evolve through time from a initial value to an end value according to a given function. More...
#include <single_tweener.hpp>


Public Types | |
| typedef std::function< void(double)> | update_function |
| The type of the function called when the single_tweener is updated. | |
| typedef std::function< double(double)> | easing_function |
| The type of the function used to compute the new value. | |
Public Types inherited from claw::tween::base_tweener | |
| typedef std::function< void()> | finish_callback |
| The type of the function called to notify the end of the tweener. | |
Public Member Functions | |
| single_tweener () | |
| Default constructor. | |
| single_tweener (double init, double end, double duration, update_function callback, easing_function e) | |
| Constructor. | |
| single_tweener (double &val, double end, double duration, easing_function e) | |
| Constructor. | |
| double | get_init () const |
| Gets the initial value. | |
| void | set_init (double v) |
| Sets the initial value. | |
| double | get_end () const |
| Gets the final value. | |
| void | set_end (double v) |
| Sets the final value. | |
| double | get_duration () const |
| Gets the total duration. | |
| void | set_duration (double v) |
| Sets the total duration. | |
| void | set_callback (update_function f) |
| The function called when the single_tweener is updated. | |
| void | set_easing (easing_function f) |
| The function used to compute the new value. | |
| double | get_value () const |
| Gets the current value of the tweener. | |
Public Member Functions inherited from claw::tween::base_tweener | |
| virtual | ~base_tweener () |
| Destructor. | |
| base_tweener * | clone () const |
| Create a copy of this allocated with new. | |
| bool | is_finished () const |
| Tell if the tweener has reached his total duration. | |
| double | update (double dt) |
| Update the base_tweener of a given amount of time. | |
| void | on_finished (finish_callback f) |
| Execute the callbacks notifying about the finish of the tweener. | |
A single_tweener makes a value to evolve through time from a initial value to an end value according to a given function.
Definition at line 48 of file single_tweener.hpp.
| typedef std::function<double(double)> claw::tween::single_tweener::easing_function |
The type of the function used to compute the new value.
Definition at line 56 of file single_tweener.hpp.
| typedef std::function<void(double)> claw::tween::single_tweener::update_function |
The type of the function called when the single_tweener is updated.
Definition at line 53 of file single_tweener.hpp.
| claw::tween::single_tweener::single_tweener | ( | ) |
Default constructor.
Definition at line 36 of file single_tweener.cpp.
| claw::tween::single_tweener::single_tweener | ( | double | init, |
| double | end, | ||
| double | duration, | ||
| update_function | callback, | ||
| easing_function | e ) |
Constructor.
| init | The initial value. |
| end | The final value. |
| duration | The total duration. |
| callback | The function called when the single_tweener is updated. |
| e | The function used to compute the new value. |
Definition at line 49 of file single_tweener.cpp.
| claw::tween::single_tweener::single_tweener | ( | double & | val, |
| double | end, | ||
| double | duration, | ||
| easing_function | e ) |
Constructor.
| val | The value to tween (and to use as the The initial value). |
| end | The final value. |
| duration | The total duration. |
| e | The function used to compute the new value. |
Definition at line 68 of file single_tweener.cpp.
| double claw::tween::single_tweener::get_duration | ( | ) | const |
Gets the total duration.
Definition at line 119 of file single_tweener.cpp.
| double claw::tween::single_tweener::get_end | ( | ) | const |
Gets the final value.
Definition at line 102 of file single_tweener.cpp.
| double claw::tween::single_tweener::get_init | ( | ) | const |
Gets the initial value.
Definition at line 85 of file single_tweener.cpp.
| double claw::tween::single_tweener::get_value | ( | ) | const |
Gets the current value of the tweener.
Definition at line 154 of file single_tweener.cpp.
| void claw::tween::single_tweener::set_callback | ( | update_function | f | ) |
The function called when the single_tweener is updated.
| f | The function. |
Definition at line 137 of file single_tweener.cpp.
| void claw::tween::single_tweener::set_duration | ( | double | v | ) |
| void claw::tween::single_tweener::set_easing | ( | easing_function | f | ) |
The function used to compute the new value.
| f | The function. |
Definition at line 146 of file single_tweener.cpp.
| void claw::tween::single_tweener::set_end | ( | double | v | ) |
| void claw::tween::single_tweener::set_init | ( | double | v | ) |