FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
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

◆ AnimationIcon() [1/2]

fcn::AnimationIcon::AnimationIcon ( )

Default constructor.

Definition at line 38 of file animationicon.cpp.

◆ AnimationIcon() [2/2]

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.

◆ ~AnimationIcon()

fcn::AnimationIcon::~AnimationIcon ( )
virtual

Destructor.

Definition at line 74 of file animationicon.cpp.

References mCurrentImage.

Member Function Documentation

◆ getAnimation()

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

Gets the current animation.

Returns
The current animation.

Definition at line 98 of file animationicon.cpp.

References mAnimation.

◆ isPlaying()

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:

◆ isRepeating()

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:

◆ logic()

◆ pause()

void fcn::AnimationIcon::pause ( )

Stops the animation at the current frame.

Definition at line 119 of file animationicon.cpp.

References mPlay.

◆ play()

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.

◆ setAnimation()

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.

◆ setRepeating()

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.

◆ stop()

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

◆ mAnimation

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().

◆ mAnimtime

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().

◆ mCurrentImage

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().

◆ mFrameIndex

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().

◆ mPlay

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().

◆ mRepeat

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().

◆ mTimemanager

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: