Meteor2D
dev internal
Meteor is a lightweight 2D game engine.
|
This class holds the Rects within a texture that form an Animation. More...
#include <spritesheet.h>
Public Member Functions | |
MSpriteSheet (std::string texturePath, std::vector< SRect > rects) | |
Constructor. | |
MTexture * | getTexture () |
Gets the Texture for this sprite-sheet. | |
SRect | sample (int &index, bool loop) |
Sample the sprite-sheet for a animation frame rect. | |
Public Member Functions inherited from meteor::MEntity | |
virtual bool | equals (MEntity *other) |
Checks equality between two entities. | |
std::string | getName () |
void | setName (std::string name) |
Sets name of entity. | |
virtual std::string | toString () |
Get this object as a string. | |
Additional Inherited Members | |
Protected Attributes inherited from meteor::MEntity | |
std::string | name |
This class holds the Rects within a texture that form an Animation.
meteor::MSpriteSheet::MSpriteSheet | ( | std::string | texturePath, |
std::vector< SRect > | rects ) |
Constructor.
texturePath | Path to texture. |
rects | List of rects that form the animation. |
MTexture * meteor::MSpriteSheet::getTexture | ( | ) |
Gets the Texture for this sprite-sheet.
SRect meteor::MSpriteSheet::sample | ( | int & | index, |
bool | loop ) |
Sample the sprite-sheet for a animation frame rect.
index | integer directly mapping to frame number. |
loop | boolean flag to loop over the frames. |