90 virtual void update()
override;
95 virtual void render()
override;
Base class for all game components, providing basic component functionalities.
Component for handling textures in the game engine.
virtual void update() override
Updates texture properties, used mainly for animations or transformations.
bool m_flipHorizontal
Flag for horizontal flipping of the texture.
virtual void setTexture(SDL_Texture *texture)
Sets the SDL_Texture object.
float m_angle
Rotation angle of the texture in degrees.
SDL_Rect * m_spriteClip
Source rectangle in the sprite sheet for slicing the texture.
virtual void setAngle(float angle)
Sets the rotation angle of the texture.
virtual void setPositionInSpriteMap(int x, int y)
Sets the position of the sprite in the sprite map.
SDL_Texture * m_texture
Pointer to the SDL_Texture object.
Texture()
Default constructor for the Texture class, initializes an empty texture.
virtual void setFlipHorizontal(bool flip)
Sets horizontal flip status.
SDL_Texture * getTexture()
Retrieves the SDL_Texture object.
void setColorMod(const SDL_Color &color)
Sets the color modulation for the texture.
virtual void render() override
Renders the texture to the screen based on current properties.
SDL_Rect * m_spriteBox
Destination rectangle on the screen for rendering the texture.
virtual void setFlipVertical(bool flip)
Sets vertical flip status.
bool m_flipVertical
Flag for vertical flipping of the texture.
SDL_Renderer * m_renderer
Pointer to the SDL_Renderer associated with this texture.
virtual void setSizeInSpriteMap(int w, int h)
Sets the size of the sprite in the sprite map.
Defines the Component base class for all components in the game engine.