Polycode
Polycode::Tween Class Reference

Tween animation class. More...

Inherits Polycode::EventDispatcher.

Inherited by Polycode::BezierPathTween, and Polycode::QuaternionTween.

List of all members.

Public Member Functions

 Tween (Number *target, int easeType, Number startVal, Number endVal, Number time, bool repeat=false, bool deleteOnComplete=false)
 Constructor.
void handleEvent (Event *event)
 This method gets called by an EventDispatcher that the handler is listening to if the dispatching event's code matches the code that handler is listening for.
void Pause (bool pauseVal)
 Pauses and resumes the tween.
void Reset ()
 Resets the tween to starting position.

Detailed Description

Tween animation class.

This class lets you tween a floating point value over a period of time with different easing types.


Constructor & Destructor Documentation

Tween::Tween ( Number *  target,
int  easeType,
Number  startVal,
Number  endVal,
Number  time,
bool  repeat = false,
bool  deleteOnComplete = false 
)

Constructor.

Parameters:
targetPointer to the Number to tween
easeTypeEasing type. See the static members of this class for the different types of easing you can use.
startValStarting value of the number at tween's start.
endValThe value to tween the number to.
timeThe duration of the tween.
repeatIf true, this tween will repeat over and over.

Member Function Documentation

void Tween::handleEvent ( Event event) [virtual]

This method gets called by an EventDispatcher that the handler is listening to if the dispatching event's code matches the code that handler is listening for.

Typically, you subclass EventHandler and implement the handleEvent method to handle specific events.

See also:
EventDispatcher

Reimplemented from Polycode::EventHandler.

void Tween::Pause ( bool  pauseVal)

Pauses and resumes the tween.

Parameters:
pauseValIf true, pauses the tweem, if false, resumes it.