FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
Implements an icon capable of displaying an animation. More...
#include <animationicon.h>
Inherits Icon.
Public Member Functions | |
AnimationIcon () | |
Default constructor. More... | |
AnimationIcon (FIFE::AnimationPtr animation) | |
Constructor. More... | |
virtual | ~AnimationIcon () |
Destructor. More... | |
void | setAnimation (FIFE::AnimationPtr animation) |
Sets the animation to display. More... | |
FIFE::AnimationPtr | getAnimation () const |
Gets the current animation. More... | |
void | setRepeating (bool repeat) |
Sets repeating of the animation. More... | |
bool | isRepeating () const |
Gets repeating of the animation. More... | |
void | play () |
Starts the animation from beginning. More... | |
bool | isPlaying () const |
Gets if the animation is playing. More... | |
void | pause () |
Stops the animation at the current frame. More... | |
void | stop () |
Stops the animation and sets the current frame to the first frame. More... | |
virtual void | logic () |
Protected Attributes | |
FIFE::TimeManager * | mTimemanager |
Holds pointer to Fifes TimeManager. More... | |
FIFE::AnimationPtr | mAnimation |
The animation to display. More... | |
const Image * | mCurrentImage |
Currently used image. More... | |
uint32_t | mAnimtime |
The time as the animation was started. More... | |
int32_t | mFrameIndex |
The last used frame index from the animation. More... | |
bool | mRepeat |
True if the animation should be repeating, otherwise false. More... | |
bool | mPlay |
True if the animation was started, otherwise false. More... | |
Implements an icon capable of displaying an animation.
Definition at line 48 of file animationicon.h.
fcn::AnimationIcon::AnimationIcon | ( | ) |
Default constructor.
Definition at line 38 of file animationicon.cpp.
fcn::AnimationIcon::AnimationIcon | ( | FIFE::AnimationPtr | animation | ) |
Constructor.
animation | The animation to display. |
Definition at line 53 of file animationicon.cpp.
References FIFE::Animation::getFrame(), FIFE::Animation::getFrameCount(), mAnimation, mCurrentImage, and mFrameIndex.
|
virtual |
FIFE::AnimationPtr fcn::AnimationIcon::getAnimation | ( | ) | const |
Gets the current animation.
Definition at line 98 of file animationicon.cpp.
References mAnimation.
bool fcn::AnimationIcon::isPlaying | ( | ) | const |
Gets if the animation is playing.
Definition at line 115 of file animationicon.cpp.
References mPlay.
Referenced by logic().
bool fcn::AnimationIcon::isRepeating | ( | ) | const |
Gets repeating of the animation.
Definition at line 106 of file animationicon.cpp.
References mRepeat.
Referenced by logic().
|
virtual |
Definition at line 133 of file animationicon.cpp.
References FIFE::Animation::getDuration(), FIFE::Animation::getFrame(), FIFE::Animation::getFrameIndex(), FIFE::TimeManager::getTime(), isPlaying(), isRepeating(), mAnimation, mAnimtime, mCurrentImage, mFrameIndex, and mTimemanager.
void fcn::AnimationIcon::pause | ( | ) |
Stops the animation at the current frame.
Definition at line 119 of file animationicon.cpp.
References mPlay.
void fcn::AnimationIcon::play | ( | ) |
Starts the animation from beginning.
Definition at line 110 of file animationicon.cpp.
References FIFE::TimeManager::getTime(), mAnimtime, mPlay, and mTimemanager.
void fcn::AnimationIcon::setAnimation | ( | FIFE::AnimationPtr | animation | ) |
Sets the animation to display.
animation | The animation to display. |
Definition at line 78 of file animationicon.cpp.
References FIFE::Animation::getFrame(), FIFE::Animation::getFrameCount(), FIFE::TimeManager::getTime(), mAnimation, mAnimtime, mCurrentImage, mFrameIndex, mPlay, and mTimemanager.
void fcn::AnimationIcon::setRepeating | ( | bool | repeat | ) |
Sets repeating of the animation.
repeat | True if the animation repeating is enabled, otherwise false. |
Definition at line 102 of file animationicon.cpp.
References mRepeat.
void fcn::AnimationIcon::stop | ( | ) |
Stops the animation and sets the current frame to the first frame.
Definition at line 123 of file animationicon.cpp.
References FIFE::Animation::getFrame(), FIFE::Animation::getFrameCount(), mAnimation, mCurrentImage, mFrameIndex, and mPlay.
|
protected |
The animation to display.
Definition at line 131 of file animationicon.h.
Referenced by AnimationIcon(), getAnimation(), logic(), setAnimation(), and stop().
|
protected |
The time as the animation was started.
Definition at line 142 of file animationicon.h.
Referenced by logic(), play(), and setAnimation().
|
protected |
Currently used image.
It's the current frame from the animation encapsulated in a GuiImage.
Definition at line 137 of file animationicon.h.
Referenced by AnimationIcon(), logic(), setAnimation(), stop(), and ~AnimationIcon().
|
protected |
The last used frame index from the animation.
Definition at line 147 of file animationicon.h.
Referenced by AnimationIcon(), logic(), setAnimation(), and stop().
|
protected |
True if the animation was started, otherwise false.
Definition at line 157 of file animationicon.h.
Referenced by isPlaying(), pause(), play(), setAnimation(), and stop().
|
protected |
True if the animation should be repeating, otherwise false.
Definition at line 152 of file animationicon.h.
Referenced by isRepeating(), and setRepeating().
|
protected |
Holds pointer to Fifes TimeManager.
Definition at line 126 of file animationicon.h.
Referenced by logic(), play(), and setAnimation().