0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 09:03:42 +00:00

added new Constructor for SpriteComponent as Tiles wont work with enums

This commit is contained in:
freezarite 2024-11-17 17:05:26 +01:00
parent ac217e931b
commit 27a80d9766
2 changed files with 9 additions and 0 deletions

View File

@ -35,9 +35,13 @@ private:
int textureXOffset; int textureXOffset;
int textureYOffset; int textureYOffset;
//should be changed in the future as this is only for the tiles
const char* path;
public: public:
SpriteComponent(Textures texture, int zIndex); SpriteComponent(Textures texture, int zIndex);
SpriteComponent(Textures texture, int xOffset, int yOffset, int zIndex); SpriteComponent(Textures texture, int xOffset, int yOffset, int zIndex);
SpriteComponent(const char* path, int xOffset, int yOffset, int zIndex);
SpriteComponent( SpriteComponent(
Textures texture, Textures texture,
bool isAnimated, bool isAnimated,

View File

@ -25,6 +25,11 @@ SpriteComponent::SpriteComponent(Textures texture, int xOffset, int yOffset, int
this->textureEnum = texture; this->textureEnum = texture;
} }
SpriteComponent::SpriteComponent(const char* path, int xOffset, int yOffset, int zIndex) : RenderObject(zIndex, VEGO_Game().renderManager), textureXOffset(xOffset), textureYOffset(yOffset) {
this->path = path;
}
SpriteComponent::SpriteComponent( SpriteComponent::SpriteComponent(
Textures texture, Textures texture,
bool isAnimated, bool isAnimated,