Sprite Resource.
More...
#include <Sprite.h>
List of all members.
Detailed Description
Sprite Resource.
The Sprite Class is a self-contained group of Image Resource's that displays Image's at a specified screen coordinate in sequence to display an animation.
Member Typedef Documentation
Constructor & Destructor Documentation
| Sprite::Sprite |
( |
const std::string & |
filePath |
) |
|
| Sprite::Sprite |
( |
const Sprite & |
sprite |
) |
|
Clean up memory allocated for animation frames and such.
Member Function Documentation
| void Sprite::addDefaultAction |
( |
|
) |
[private] |
Adds a 'default' action to the action list.
- Note:
- This function will not override a 'default' action if one has has already been specified.
| void Sprite::addDefaultFrame |
( |
FrameList & |
frmList, |
|
|
Uint |
frmDelay = 25 | |
|
) |
| | [private] |
Adds a default frame image to a frame list.
- Parameters:
-
| frmList | A reference to a FrameList. |
| frmDelay | Frame delay, in miliseconds. Default: 25. |
- Note:
- This function does not check for validity of parameters passed in.
Spits out a bit of debug info on the Sprite.
| Image * Sprite::getCurrentFrameImage |
( |
|
) |
|
Gets a pointer to the current frame image.
- Warning:
- Returned pointer is owned by the Sprite. Do not free it.
| const int Sprite::getHeight |
( |
|
) |
const [inline] |
| const int Sprite::getOriginX |
( |
int |
x |
) |
const [inline] |
| const int Sprite::getOriginY |
( |
int |
y |
) |
const [inline] |
| const int Sprite::getWidth |
( |
|
) |
const [inline] |
| bool Sprite::parseActions |
( |
TiXmlElement * |
root |
) |
[private] |
Parses through and interpretes <action> tags within a Sprite XML Definition File.
- Todo:
- Make use of mErrorMessage.
| void Sprite::parseFrames |
( |
TiXmlNode * |
node, |
|
|
const std::string & |
action | |
|
) |
| | [private] |
| bool Sprite::parseImageSheets |
( |
TiXmlElement * |
root |
) |
[private] |
Parses through and interpretes <imagesheet> tags within a Sprite XML Definition File.
- Todo:
- Make use of mErrorMessage.
| bool Sprite::parseXml |
( |
const std::string & |
filePath |
) |
[private] |
| void Sprite::pause |
( |
bool |
pause |
) |
|
Pauses animation for this Sprite.
| void Sprite::play |
( |
const std::string & |
action |
) |
|
| void Sprite::setAlpha |
( |
int |
alpha |
) |
[inline] |
| void Sprite::update |
( |
int |
x, |
|
|
int |
y | |
|
) |
| | |
Instructs the Sprite to update itself.
Updates the internal state of the Sprite, pushing forward animation frames as necessary.
- Parameters:
-
| x | X-Screen Coordinate to render the Sprite. |
| y | X-Screen Coordinate to render the Sprite. |
Member Data Documentation
A list of Actions and their associated Frames.
Alpha value to draw the sprite.
The current Action being performed.
The current frame index in the current Action's frame list.
The last error that occured with this Sprite.
The last tick in which the frame was updated.
Indicate whether or not the animation for this Sprite is paused.
A pointer to the current action being played.
Collection of sprite sheets.
The documentation for this class was generated from the following files:
- C:/Development/LoM/client/src/Resources/Sprite.h
- C:/Development/LoM/client/src/Resources/Sprite.cpp