16class SpriteComponent :
public Component,
public RenderObject
19 int animationIndex = 0;
21 std::map<std::string, std::unique_ptr<Animation>>* animations =
nullptr;
26 SDL_FRect srcRect, destRect;
30 bool animated =
false;
44 Textures getTexture() {
return this->textureEnum; }
48 SpriteComponent(
Textures texture,
int zIndex);
49 SpriteComponent(
Textures texture,
int xOffset,
int yOffset,
int zIndex);
50 SpriteComponent(
const char* path,
int xOffset,
int yOffset,
int zIndex);
54 std::map<std::string, std::unique_ptr<Animation>>* animationList,
55 std::string defaultAnimation,
60 void setMapTileTexture(
const char* path);
63 void update(uint_fast16_t diffTime)
override;
65 void playAnimation(std::string type);
66 void setDirection(Direction direction);
Forward declaration of the Textures enum class.