FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
fcn::AnimationIcon Class Reference

Implements an icon capable of displaying an animation. More...

#include <animationicon.h>

Inherits Icon.

+ Collaboration diagram for fcn::AnimationIcon:

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::TimeManagermTimemanager
 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...
 

Detailed Description

Implements an icon capable of displaying an animation.

Definition at line 48 of file animationicon.h.

Constructor & Destructor Documentation

fcn::AnimationIcon::AnimationIcon ( )

Default constructor.

Definition at line 38 of file animationicon.cpp.

fcn::AnimationIcon::AnimationIcon ( FIFE::AnimationPtr  animation)

Constructor.

Parameters
animationThe animation to display.

Definition at line 53 of file animationicon.cpp.

References FIFE::Animation::getFrame(), FIFE::Animation::getFrameCount(), mAnimation, mCurrentImage, and mFrameIndex.

fcn::AnimationIcon::~AnimationIcon ( )
virtual

Destructor.

Definition at line 74 of file animationicon.cpp.

References mCurrentImage.

Member Function Documentation

FIFE::AnimationPtr fcn::AnimationIcon::getAnimation ( ) const

Gets the current animation.

Returns
The current animation.

Definition at line 98 of file animationicon.cpp.

References mAnimation.

bool fcn::AnimationIcon::isPlaying ( ) const

Gets if the animation is playing.

Returns
True if the animation is playing, otherwise false.

Definition at line 115 of file animationicon.cpp.

References mPlay.

Referenced by logic().

+ Here is the caller graph for this function:

bool fcn::AnimationIcon::isRepeating ( ) const

Gets repeating of the animation.

Returns
True if the animation repeating is enabled, otherwise false.

Definition at line 106 of file animationicon.cpp.

References mRepeat.

Referenced by logic().

+ Here is the caller graph for this function:

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.

Parameters
animationThe 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.

Parameters
repeatTrue 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.

Member Data Documentation

FIFE::AnimationPtr fcn::AnimationIcon::mAnimation
protected

The animation to display.

Definition at line 131 of file animationicon.h.

Referenced by AnimationIcon(), getAnimation(), logic(), setAnimation(), and stop().

uint32_t fcn::AnimationIcon::mAnimtime
protected

The time as the animation was started.

Definition at line 142 of file animationicon.h.

Referenced by logic(), play(), and setAnimation().

const Image* fcn::AnimationIcon::mCurrentImage
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().

int32_t fcn::AnimationIcon::mFrameIndex
protected

The last used frame index from the animation.

Definition at line 147 of file animationicon.h.

Referenced by AnimationIcon(), logic(), setAnimation(), and stop().

bool fcn::AnimationIcon::mPlay
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().

bool fcn::AnimationIcon::mRepeat
protected

True if the animation should be repeating, otherwise false.

Definition at line 152 of file animationicon.h.

Referenced by isRepeating(), and setRepeating().

FIFE::TimeManager* fcn::AnimationIcon::mTimemanager
protected

Holds pointer to Fifes TimeManager.

Definition at line 126 of file animationicon.h.

Referenced by logic(), play(), and setAnimation().


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