claw 1.9.0
 
Loading...
Searching...
No Matches
claw::tween::tweener Class Reference

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

#include <tweener.hpp>

Public Types

typedef std::function< void()> finish_callback
 The type of the function called to notify the end of the tweener.
 

Public Member Functions

 tweener ()
 Default constructor.
 
 tweener (const tweener &that)
 Copy constructor.
 
 tweener (const base_tweener &that)
 Constructor from a base_tweener.
 
 ~tweener ()
 Destructor.
 
tweeneroperator= (const tweener &that)
 Assignment operator.
 
void swap (tweener &that) throw ()
 Swap this instance with a given instance.
 
bool is_finished () const
 Tell if the tweener has reached his total duration.
 
double update (double dt)
 Update the tweener of a given amount of time.
 
void on_finished (finish_callback f)
 Execute the callbacks notifying about the finish of the tweener.
 

Detailed Description

A 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
C++ Tweeners

Definition at line 47 of file tweener.hpp.

Member Typedef Documentation

◆ finish_callback

typedef std::function<void()> claw::tween::tweener::finish_callback

The type of the function called to notify the end of the tweener.

Definition at line 54 of file tweener.hpp.

Constructor & Destructor Documentation

◆ tweener() [1/3]

claw::tween::tweener::tweener ( )

Default constructor.

Definition at line 36 of file tweener.cpp.

◆ tweener() [2/3]

claw::tween::tweener::tweener ( const tweener & that)

Copy constructor.

Parameters
thatThe instance to copy from.

Definition at line 44 of file tweener.cpp.

◆ tweener() [3/3]

claw::tween::tweener::tweener ( const base_tweener & that)

Constructor from a base_tweener.

Parameters
thatThe instance to use for the implementation.

Definition at line 52 of file tweener.cpp.

◆ ~tweener()

claw::tween::tweener::~tweener ( )

Destructor.

Definition at line 59 of file tweener.cpp.

Member Function Documentation

◆ is_finished()

bool claw::tween::tweener::is_finished ( ) const

Tell if the tweener has reached his total duration.

Definition at line 87 of file tweener.cpp.

◆ on_finished()

void claw::tween::tweener::on_finished ( finish_callback f)

Execute the callbacks notifying about the finish of the tweener.

Definition at line 110 of file tweener.cpp.

◆ operator=()

claw::tween::tweener & claw::tween::tweener::operator= ( const tweener & that)

Assignment operator.

Parameters
thatThe instance to copy from.

Definition at line 68 of file tweener.cpp.

◆ swap()

void claw::tween::tweener::swap ( tweener & that)
throw ( )

Swap this instance with a given instance.

Parameters
thatThe instance to swap with.

Definition at line 79 of file tweener.cpp.

◆ update()

double claw::tween::tweener::update ( double dt)

Update the tweener of a given amount of time.

Parameters
dtThe duration of the update in time units since the last call.

Definition at line 99 of file tweener.cpp.


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