Meteor2D  dev internal
Meteor is a lightweight 2D game engine.
Loading...
Searching...
No Matches
spritesheet.h
1#pragma once
2#include <meteorutils/rect.h>
3#include <2d/texture.h>
4
5namespace meteor {
9 class MSpriteSheet : public MEntity {
10 public:
16 MSpriteSheet(std::string texturePath, std::vector<SRect> rects);
28 SRect sample(int& index, bool loop);
29 private:
30 MTexture* spriteTex;
31 std::vector<SRect> spriteRects;
32 };
33}
An Entity is the base class for all data and behaviour oriented objects in meteor....
Definition entity.h:9
This class holds the Rects within a texture that form an Animation.
Definition spritesheet.h:9
SRect sample(int &index, bool loop)
Sample the sprite-sheet for a animation frame rect.
MTexture * getTexture()
Gets the Texture for this sprite-sheet.
MSpriteSheet(std::string texturePath, std::vector< SRect > rects)
Constructor.
This class holds an image that can be rendererd to the screen.
Definition texture.h:12
A struct representing rectangle.
Definition rect.h:8