Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Animation Class Reference

Animation contains a pointer to a current set of animation frames that are obtained from the animation manager, it uses those to animate the object( character or bombs ). More...

#include <Animation.h>

Inheritance diagram for Animation:

GameDXListener List of all members.

Public Methods

void draw (const Point &anchor)
 Draws the current position of the character in the animation.

void update (float dt)
 Updates the animation to the next frame and keeps track of when the animation should have ended.

int getNumTextures ()
 Returns the nubmer of textures in the animation.

AnimationFramesgetAnimationFrames ()
 Returns the current animation frames.

void setAnimationFrames (AnimationFrames *frames)
 Sets the current animation frames.

float getAnimRuntime ()
 Returns the runtime for the animation.

void setAnimRuntime (float runtime)
 Sets the animation runtim.

void setScaleFactor (float factor)
 Sets the scale factore of the sprite.

void stop ()
 Stops the animation, animStopped = true.

void start ()
 Starts the animation, animStopped = false.

void setOffsets (int x, int y)
 Sets the offset of the image.

bool isAnimStopped ()
 Returns true if the animation has finished, used so explosion entities will be destroyed.

void setUsingAlpha (bool alpha)
 Turns alpha blending on or off.

void setAlphaBlendSpeed (float speed)
 1.0 would be the alpha goes from its starting value to 0 over the course of all the frames in the animation.

void setStartAlphaValue (int a)
 Sets the starting value from alpha, it defaults to 255, which is no alpha, can be set to anything from 0 - 255.

void setAlphaValue (int a)
 Sets an alpha value to apply to all frames of the animation.

void setColor (int r, int g, int b)
 Sets the color to use when drawing the sprite.

 Animation ()
 Super IsoBomb.

 ~Animation ()
void init ()
 Inititalizes the animation object.

virtual void OnLostDevice ()
 Event called when device is lost.

virtual void OnResetDevice ()
 Event called when device is reset.


Detailed Description

Animation contains a pointer to a current set of animation frames that are obtained from the animation manager, it uses those to animate the object( character or bombs ).

The update function is used to keep the animation running at a constant speed no matter what the framerate is and it updates the current texture, which is then drawn in the draw method. Also implements the GameDXListener, which is used when switching modes, the device will be lost, and the OnLostDevice and OnREsetDevice handles those problems.


Constructor & Destructor Documentation

Animation::Animation  
 

Super IsoBomb.

Authors: Jim Clase, Jonathan Hilliker, Jason Winnebeck

Animation::~Animation  
 


Member Function Documentation

void Animation::draw const Point   anchor
 

Draws the current position of the character in the animation.

Parameters:
anchor  point to attach

AnimationFrames * Animation::getAnimationFrames  
 

Returns the current animation frames.

Returns:
a pointer to the current animation frames

float Animation::getAnimRuntime  
 

Returns the runtime for the animation.

Returns:
the runtime

int Animation::getNumTextures  
 

Returns the nubmer of textures in the animation.

Returns:
Total number of textures

void Animation::init  
 

Inititalizes the animation object.

bool Animation::isAnimStopped  
 

Returns true if the animation has finished, used so explosion entities will be destroyed.

Returns:
True if explosion is over

void Animation::OnLostDevice   [virtual]
 

Event called when device is lost.

Implements GameDXListener.

void Animation::OnResetDevice   [virtual]
 

Event called when device is reset.

Implements GameDXListener.

void Animation::setAlphaBlendSpeed float    speed
 

1.0 would be the alpha goes from its starting value to 0 over the course of all the frames in the animation.

ams speed the speed to blend at

void Animation::setAlphaValue int    a
 

Sets an alpha value to apply to all frames of the animation.

Parameters:
a  alpha value

void Animation::setAnimationFrames AnimationFrames   frames
 

Sets the current animation frames.

ams frames the pointer to the new animation frames

void Animation::setAnimRuntime float    runtime
 

Sets the animation runtim.

ams runtime The total time the animation taeks to run

void Animation::setColor int    r,
int    g,
int    b
 

Sets the color to use when drawing the sprite.

Parameters:
r  red value
g  green value
b  blue value

void Animation::setOffsets int    x,
int    y
 

Sets the offset of the image.

ams x the x offset
ams y the y offset

void Animation::setScaleFactor float    factor
 

Sets the scale factore of the sprite.

ams factor the factor to scale the sprite by

void Animation::setStartAlphaValue int    a
 

Sets the starting value from alpha, it defaults to 255, which is no alpha, can be set to anything from 0 - 255.

ams a The new value to start alpha blending from

void Animation::setUsingAlpha bool    alpha
 

Turns alpha blending on or off.

ams alpha True to use alpha blending

void Animation::start  
 

Starts the animation, animStopped = false.

void Animation::stop  
 

Stops the animation, animStopped = true.

void Animation::update float    dt
 

Updates the animation to the next frame and keeps track of when the animation should have ended.

Used the time since the last frame to know when to move onto the next frame based on the length of each frame.

ams dt The time since the last frame


The documentation for this class was generated from the following files:
Generated on Tue Mar 4 02:29:26 2003 for SuperIsoBomb by doxygen1.2.18