# SpriteSystem

This class is responsible for managing various aspects of sprite components, such as setting properties, drawing them on the screen, and adjusting their attributes like position, scale, and texture rectangle.

```cpp
class SpriteSystem {
public:
    /**
     * @brief Sets the properties of a sprite component using a given texture.
     * 
     * @param sprite Reference to the SpriteComponent to modify.
     * @param texture Reference to the SFML Texture to apply to the sprite.
     */
    void setSpriteProperties(SpriteComponent& sprite, sf::Texture& texture);

    /**
     * @brief Draws the specified sprite component on the provided SFML RenderWindow.
     * 
     * @param window Pointer to the SFML RenderWindow where the sprite is to be drawn.
     * @param sprite Reference to the SpriteComponent to be drawn.
     */
    void draw(sf::RenderWindow* window, SpriteComponent& sprite);

    /**
     * @brief Sets the texture rectangle for a sprite component, defining the area of the texture to display.
     * 
     * @param sprite Reference to the SpriteComponent to modify.
     * @param rect The SFML IntRect representing the texture area to use for the sprite.
     */
    void setSpriteRect(SpriteComponent& sprite, sf::IntRect rect);

    /**
     * @brief Sets the position of the sprite component.
     * 
     * @param sprite Reference to the SpriteComponent to modify.
     * @param pos The Utils::Vec2 object representing the new position coordinates.
     */
    void setSpritePos(SpriteComponent& sprite, Utils::Vec2& pos);

    /**
     * @brief Sets the scale of the sprite component based on the provided scale component.
     * 
     * @param sprite Reference to the SpriteComponent to modify.
     * @param sc The ScaleComponent containing the scale values to apply to the sprite.
     */
    void setSpriteScale(SpriteComponent& sprite, ScaleComponent& sc);
};
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://r-type-5.gitbook.io/r-type/development-guidelines/ecs/graphicsystem/spritesystem.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
