Gamedev Framework (gf)  0.6.0
A C++11 framework for 2D games
Public Member Functions | List of all members
gf::ColorActivity Class Reference

An activity for a change of color. More...

#include <gf/Activities.h>

Inheritance diagram for gf::ColorActivity:
Inheritance graph
[legend]

Public Member Functions

 ColorActivity (Color4f origin, Color4f target, Color4f &color, Time duration, Easing easing=Ease::linear)
 Constructor. More...
 
void setOrigin (Color4f origin)
 Change the origin of the activity. More...
 
Color4f getOrigin () const noexcept
 Get the origin of the activity. More...
 
void setTarget (Color4f target)
 Change the target of the activity. More...
 
Color4f getTarget () const noexcept
 Get the target of the activity. More...
 
void setDuration (Time duration)
 Change the duration of the activity. More...
 
Time getDuration () const noexcept
 Get the duration of the activity. More...
 
virtual ActivityStatus run (Time time) override
 Run the activity. More...
 
virtual void restart () override
 Restart the activity. More...
 
- Public Member Functions inherited from gf::Activity
virtual ~Activity ()
 Destructor. More...
 

Detailed Description

An activity for a change of color.

See also
gf::Tween

Constructor & Destructor Documentation

◆ ColorActivity()

gf::ColorActivity::ColorActivity ( Color4f  origin,
Color4f  target,
Color4f color,
Time  duration,
Easing  easing = Ease::linear 
)

Constructor.

Parameters
originThe origin value
targetThe target value
colorA reference on the value
durationThe duration of the tween
easingThe easing for the interpolation

Member Function Documentation

◆ getDuration()

Time gf::ColorActivity::getDuration ( ) const
inlinenoexcept

Get the duration of the activity.

Returns
The current duration

◆ getOrigin()

Color4f gf::ColorActivity::getOrigin ( ) const
inlinenoexcept

Get the origin of the activity.

Returns
The current origin

◆ getTarget()

Color4f gf::ColorActivity::getTarget ( ) const
inlinenoexcept

Get the target of the activity.

Returns
The current target

◆ restart()

virtual void gf::ColorActivity::restart ( )
overridevirtual

Restart the activity.

Reimplemented from gf::Activity.

◆ run()

virtual ActivityStatus gf::ColorActivity::run ( Time  time)
overridevirtual

Run the activity.

Parameters
timeThe time since the last run
Returns
The status of the activity (running or finished)

Implements gf::Activity.

◆ setDuration()

void gf::ColorActivity::setDuration ( Time  duration)
inline

Change the duration of the activity.

Parameters
durationThe new duration

◆ setOrigin()

void gf::ColorActivity::setOrigin ( Color4f  origin)
inline

Change the origin of the activity.

Parameters
originThe new origin

◆ setTarget()

void gf::ColorActivity::setTarget ( Color4f  target)
inline

Change the target of the activity.

Parameters
targetThe new target