#include <Animation.h>
Public Types | |
enum | ANIMATION_TYPE { kANIMATION_TYPE_UNKNOWN, kANIMATION_TYPE_NORMAL, kANIMATION_TYPE_REVERSE, kANIMATION_TYPE_LOOP, kANIMATION_TYPE_PINGPONG, kANIMATION_TYPE_MANUAL } |
enum | ANIMATION_FRAMEMODE { kANIMATION_FRAMEMODE_UNKNOWN, kANIMATION_FRAMEMODE_NORMAL, kANIMATION_FRAMEMODE_LIMITS } |
Public Member Functions | |
Animation () | |
virtual | ~Animation () |
virtual bool | Update (float fTimeDelta) |
virtual void | Reset () |
void | SetLoops (unsigned int nLoops) |
unsigned int | GetLoops () |
void | SetFrameRate (float fFrameRate) |
float | GetFrameRate () |
void | SetAnimationType (ANIMATION_TYPE nAnimationType) |
ANIMATION_TYPE | GetAnimationType () |
void | SetFrameMode (ANIMATION_FRAMEMODE nFrameMode) |
ANIMATION_FRAMEMODE | GetFrameMode () |
void | SetRemoveWhenDone (bool bRemoveStatus) |
bool | IsRemoveWhenDoneEnabled () |
bool | IsDone () |
void | SetFrameLimitStart (int nFrame) |
int | GetFrameLimitStart () |
void | SetFrameLimitEnd (unsigned int nFrame) |
unsigned int | GetFrameLimitEnd () |
Protected Member Functions | |
void | StepFrame () |
bool | CheckFrame () |
Protected Attributes | |
bool | m_bRemoveDone |
Flag telling wether the animation should return from false when the end is reached or not. | |
bool | m_bDone |
Flag telling wether the animations has reached the end or not. | |
bool | m_bReverse |
Flag telling if the animation is animating in reverse or not. | |
unsigned int | m_nLoops |
The number of times to loop the animation. | |
unsigned int | m_nFrameLimitStart |
The start frame of the frame limit. | |
unsigned int | m_nFrameLimitEnd |
The end frame of the frame limit. | |
float | m_fFrameTimer |
Counter used to calculate when to present the next frame. | |
float | m_fFrameRate |
The frame rate of the animation. | |
ANIMATION_TYPE | m_nAnimationType |
The animation type used by the animation. | |
ANIMATION_FRAMEMODE | m_nFrameMode |
The frame mode used by the animation. |
Enumeration of animation types
Enumeration of animation frame modes
Animation::Animation | ( | ) |
Contructor Resets all members to the default values
Animation::~Animation | ( | ) | [virtual] |
Destructor
bool Animation::Update | ( | float | fTimeDelta | ) | [virtual] |
Updates the animation
fTimeDelta | the time that has passed since last update, measured in milliseconds |
Reimplemented from EPOC::BaseObject.
void Animation::Reset | ( | ) | [virtual] |
Resets the animation and it's data
void EPOC::Animation::SetLoops | ( | unsigned int | nLoops | ) | [inline] |
Sets the number of times to loop the animation
nLoops | The number of times to loop the animation. 0 = Play animation once, 1 or greater = Loop animation N times |
unsigned int EPOC::Animation::GetLoops | ( | ) | [inline] |
Returns the number of times to loop the animation
void EPOC::Animation::SetFrameRate | ( | float | fFrameRate | ) | [inline] |
Sets the framerate of the animation. The frame rate is described in frames per second
fFrameRate | The number of frames per second of the animation |
float EPOC::Animation::GetFrameRate | ( | ) | [inline] |
Returns the framerate of the animation. The frame rate is described in frames per second
fFrameRate | The number of frames per second of the animation |
void EPOC::Animation::SetAnimationType | ( | ANIMATION_TYPE | nAnimationType | ) | [inline] |
Sets the type of the animation
m_nAnimationType | The animation type to be used by the animation |
ANIMATION_TYPE EPOC::Animation::GetAnimationType | ( | ) | [inline] |
Returns the type of the animation
void EPOC::Animation::SetFrameMode | ( | ANIMATION_FRAMEMODE | nFrameMode | ) | [inline] |
Sets the frame mode used by the animation
nFrameMode | The frame mode to be used by the animation |
ANIMATION_FRAMEMODE EPOC::Animation::GetFrameMode | ( | ) | [inline] |
Returns the frame mode to be used by the animation
nMode | The frame mode to be used by the animation |
void EPOC::Animation::SetRemoveWhenDone | ( | bool | bRemoveStatus | ) | [inline] |
Sets a flag that tells the animation to return false from the update method when the animation has reched the end. When this happens EPOC will delete the animation.
bRemoveStatus | True or false |
bool EPOC::Animation::IsRemoveWhenDoneEnabled | ( | ) | [inline] |
Returns wether the animation is flagged to be removed at the end of the animation or not
bool EPOC::Animation::IsDone | ( | ) | [inline] |
Returns wether the animation has reached the end of the animation
void EPOC::Animation::SetFrameLimitStart | ( | int | nFrame | ) | [inline] |
Sets the start frame of the frame limit
EP_ANIMATION_FRAMEMODE
int EPOC::Animation::GetFrameLimitStart | ( | ) | [inline] |
Returns the start frame of the frame limit
EP_ANIMATION_FRAMEMODE
void EPOC::Animation::SetFrameLimitEnd | ( | unsigned int | nFrame | ) | [inline] |
Sets the end frame of the frame limit
EP_ANIMATION_FRAMEMODE
unsigned int EPOC::Animation::GetFrameLimitEnd | ( | ) | [inline] |
Returns the end frame of the frame limit
EP_ANIMATION_FRAMEMODE
void Animation::StepFrame | ( | ) | [protected] |
Updates the current frame counter. This is done different based on the animation type
bool Animation::CheckFrame | ( | ) | [protected] |
Updates and limits the frame counter and checks wether the animation has finished (inluding loops)
bool EPOC::Animation::m_bRemoveDone [protected] |
Flag telling wether the animation should return from false when the end is reached or not.
bool EPOC::Animation::m_bDone [protected] |
Flag telling wether the animations has reached the end or not.
bool EPOC::Animation::m_bReverse [protected] |
Flag telling if the animation is animating in reverse or not.
unsigned int EPOC::Animation::m_nLoops [protected] |
The number of times to loop the animation.
unsigned int EPOC::Animation::m_nFrameLimitStart [protected] |
The start frame of the frame limit.
unsigned int EPOC::Animation::m_nFrameLimitEnd [protected] |
The end frame of the frame limit.
float EPOC::Animation::m_fFrameTimer [protected] |
Counter used to calculate when to present the next frame.
float EPOC::Animation::m_fFrameRate [protected] |
The frame rate of the animation.
ANIMATION_TYPE EPOC::Animation::m_nAnimationType [protected] |
The animation type used by the animation.
ANIMATION_FRAMEMODE EPOC::Animation::m_nFrameMode [protected] |
The frame mode used by the animation.