Empirical
Classes | Public Member Functions | List of all members
emp::web::Tween Class Reference

#include <Tween.h>

Public Member Functions

 Tween (double d=1.0, const Widget &t=nullptr)
 Build a new tween, specifying the duration it should run for and the widget it should modify. More...
 
 ~Tween ()
 
double GetDuration () const
 Retrieve the full duration of this Tween. More...
 
Widget GetDefaultTarget () const
 Which widget does this Tween modify? More...
 
TweenSetDuration (double d)
 Change the duration of this Tween. More...
 
TweenSetDefaultTarget (const Widget &w)
 Change the target of this tween. More...
 
TweenAddPath (std::function< void(double)> set_fun, double start_val, double end_val, std::function< double(double)> timing=LINEAR)
 Alter the path of the change that this tween should take and the function it should call. More...
 
TweenAddPath (double &set_var, double start_val, double end_val, std::function< double(double)> timing=LINEAR)
 Alter the path of the change that this tween should take and the variable it should modify. More...
 
TweenAddPath (Widget w, std::string setting, double start_val, double end_val)
 
TweenAddUpdate (std::function< void(void)> ud_fun)
 Add an additional function to update as the Tween runs. More...
 
TweenAddDependant (Widget w)
 Add a dependant Widget to update as the Tween runs. More...
 
void Start ()
 Start running this Tween, as configured. More...
 
void Stop ()
 Pause this Tween. More...
 

Constructor & Destructor Documentation

emp::web::Tween::Tween ( double  d = 1.0,
const Widget t = nullptr 
)
inline

Build a new tween, specifying the duration it should run for and the widget it should modify.

emp::web::Tween::~Tween ( )
inline

Member Function Documentation

Tween& emp::web::Tween::AddDependant ( Widget  w)
inline

Add a dependant Widget to update as the Tween runs.

Tween& emp::web::Tween::AddPath ( std::function< void(double)>  set_fun,
double  start_val,
double  end_val,
std::function< double(double)>  timing = LINEAR 
)
inline

Alter the path of the change that this tween should take and the function it should call.

Tween& emp::web::Tween::AddPath ( double &  set_var,
double  start_val,
double  end_val,
std::function< double(double)>  timing = LINEAR 
)
inline

Alter the path of the change that this tween should take and the variable it should modify.

Tween& emp::web::Tween::AddPath ( Widget  w,
std::string  setting,
double  start_val,
double  end_val 
)
inline

Alter the path of the change that this tween should take and the widget setting it should alter. (TODO!)

Tween& emp::web::Tween::AddUpdate ( std::function< void(void)>  ud_fun)
inline

Add an additional function to update as the Tween runs.

Widget emp::web::Tween::GetDefaultTarget ( ) const
inline

Which widget does this Tween modify?

double emp::web::Tween::GetDuration ( ) const
inline

Retrieve the full duration of this Tween.

Tween& emp::web::Tween::SetDefaultTarget ( const Widget w)
inline

Change the target of this tween.

Tween& emp::web::Tween::SetDuration ( double  d)
inline

Change the duration of this Tween.

void emp::web::Tween::Start ( )
inline

Start running this Tween, as configured.

void emp::web::Tween::Stop ( )
inline

Pause this Tween.


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