claw::tween::single_tweener Class Reference

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>`

Inheritance diagram for claw::tween::single_tweener:

## Public Types

typedef boost::function< void(double)> | update_function
| The type of the function called when the single_tweener is updated.
typedef boost::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 boost::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. More...
| single_tweener (double &val, double end, double duration, easing_function e)
| Constructor. More...
double | get_init () const
| Gets the initial value.
void | set_init (double v)
| Sets the initial value. More...
double | get_end () const
| Gets the final value.
void | set_end (double v)
| Sets the final value. More...
double | get_duration () const
| Gets the total duration.
void | set_duration (double v)
| Sets the total duration. More...
void | set_callback (update_function f)
| The function called when the single_tweener is updated. More...
void | set_easing (easing_function f)
| The function used to compute the new value. More...
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. More...
void | on_finished (finish_callback f)
| Execute the callbacks notifying about the finish of the tweener.

## Detailed Description

A single_tweener makes a value to evolve through time from a initial value to an end value according to a given function.

Author
  Julien Jorge

See also
  tweeners

Definition at line 48 of file single_tweener.hpp.

## Constructor & Destructor Documentation

## single_tweener() [1/2]

claw::tween::single_tweener::single_tweener | ( | double | init,
|  | double | end,
|  | double | duration,
|  | update_function | callback,
|  | easing_function | e
| ) |  |

Constructor.

Parameters

  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 105 of file single_tweener.cpp.

References single_tweener().

## single_tweener() [2/2]

claw::tween::single_tweener::single_tweener | ( | double & | val,
|  | double | end,
|  | double | duration,
|  | easing_function | e
| ) |  |

Constructor.

Parameters

  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 122 of file single_tweener.cpp.

## Member Function Documentation

## set_callback()

void claw::tween::single_tweener::set_callback | ( | update_function | f | ) |

The function called when the single_tweener is updated.

Parameters

  f | The function.

Definition at line 190 of file single_tweener.cpp.

## set_duration()

void claw::tween::single_tweener::set_duration | ( | double | v | ) |

Sets the total duration.

Parameters

  v | The value.

Definition at line 180 of file single_tweener.cpp.

## set_easing()

void claw::tween::single_tweener::set_easing | ( | easing_function | f | ) |

The function used to compute the new value.

Parameters

  f | The function.

Definition at line 200 of file single_tweener.cpp.

## set_end()

void claw::tween::single_tweener::set_end | ( | double | v | ) |

Sets the final value.

Parameters

  v | The value.

Definition at line 161 of file single_tweener.cpp.

## set_init()

void claw::tween::single_tweener::set_init | ( | double | v | ) |

Sets the initial value.

Parameters

  v | The value.

Definition at line 142 of file single_tweener.cpp.

The documentation for this class was generated from the following files:

- tween/single_tweener.hpp
- code/tween/single_tweener.cpp