The Game Engine  1
Animation Class Reference

An Animation for 2D assets (expand for 3d?) More...

#include <Animation.h>

+ Collaboration diagram for Animation:

Public Member Functions

 Animation ()
 
 Animation (string animFile)
 
 Animation (string animFile, string name)
 
void clear ()
 This removes all the data within an Animation (should only be called when animation is no longer in use) More...
 
bool operator== (Animation a)
 
bool operator!= (Animation a)
 

Public Attributes

bool Built
 Tells if loading the Animation was successful. More...
 
unsigned int NumFrames
 Number of frames in this Animation. More...
 
string Name
 The name of the Animation. More...
 
vector< SpriteFrame * > Frames
 The frames of the animation. More...
 

Protected Member Functions

bool loadAnimation (string animFile)
 Loads the Animations from a file in the specified format. More...
 

Detailed Description

An Animation for 2D assets (expand for 3d?)

This class is tasked with the following:

  • loading sets of images into an animation set.

Definition at line 17 of file Animation.h.

Constructor & Destructor Documentation

Animation::Animation ( )

Definition at line 17 of file Animation.cpp.

Animation::Animation ( string  animFile)

Definition at line 20 of file Animation.cpp.

+ Here is the call graph for this function:

Animation::Animation ( string  animFile,
string  name 
)

Definition at line 26 of file Animation.cpp.

+ Here is the call graph for this function:

Member Function Documentation

void Animation::clear ( )

This removes all the data within an Animation (should only be called when animation is no longer in use)

Todo:
remove hotspots

Definition at line 32 of file Animation.cpp.

+ Here is the call graph for this function:

bool Animation::loadAnimation ( string  animFile)
protected

Loads the Animations from a file in the specified format.

Image File name

Pause time

transparency #'s R G B

AnimationPeg

Collision data

Load image for Frame

Set transparent color

Loads image into animation

sets frame delay and makes sure height and width are correct

Set the animation Peg

Todo:
Set hotspots

Definition at line 49 of file Animation.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Animation::operator!= ( Animation  a)
inline

Definition at line 39 of file Animation.h.

bool Animation::operator== ( Animation  a)
inline

Definition at line 38 of file Animation.h.

Member Data Documentation

bool Animation::Built

Tells if loading the Animation was successful.

Definition at line 21 of file Animation.h.

vector<SpriteFrame*> Animation::Frames

The frames of the animation.

Definition at line 27 of file Animation.h.

string Animation::Name

The name of the Animation.

Definition at line 25 of file Animation.h.

unsigned int Animation::NumFrames

Number of frames in this Animation.

Definition at line 23 of file Animation.h.


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