Platformer
Platformer
|
Struct for a single animation. More...
#include <AnimationRenderComponent.hpp>
Public Member Functions | |
Animation (const std::string &spriteSheet, unsigned int srcX, unsigned int srcY, unsigned int srcW, unsigned int srcH, unsigned int numFrames, unsigned int frameDifference, unsigned int FPS) | |
Constructs a new animation. More... | |
std::shared_ptr< SDL_Rect > | GetRectForFrame (unsigned int frame) |
Gets the rect of the spritesheet representing the current frame. More... | |
Public Attributes | |
std::string | spriteSheet |
The spritesheet for this animation. | |
unsigned int | srcX |
The source rect's x coordinate for this animation. | |
unsigned int | srcY |
The source rect's y coordinate for this animation. | |
unsigned int | srcW |
The source rect's width for this animation. | |
unsigned int | srcH |
The source rect's height for this animation. | |
unsigned int | numFrames |
The number of frames of this animation. | |
unsigned int | frameDifference |
The x-axis distance between each frame of the animation. | |
unsigned int | FPS |
The frames per second of this animation. | |
Struct for a single animation.
Animation::Animation | ( | const std::string & | spriteSheet, |
unsigned int | srcX, | ||
unsigned int | srcY, | ||
unsigned int | srcW, | ||
unsigned int | srcH, | ||
unsigned int | numFrames, | ||
unsigned int | frameDifference, | ||
unsigned int | FPS | ||
) |
Constructs a new animation.
spriteSheet | The spritesheet for this animation |
srcX | The source rect's x coordinate for this animation |
srcY | The source rect's y coordinate for this animation |
srcW | The source rect's width for this animation |
srcH | The source rect's height for this animation |
numFrames | The number of frames of this animation |
frameDifference | The x-axis distance between each frame of the animation |
FPS | The frames per second of this animation |
std::shared_ptr< SDL_Rect > Animation::GetRectForFrame | ( | unsigned int | frame | ) |
Gets the rect of the spritesheet representing the current frame.
frame | The frame of the rect needed |