Skip to content

File SpriteComponent.hpp

File List > Components > SpriteComponent.hpp

Go to the documentation of this file

#ifndef ENGINE_COMPONENTS_SPRITECOMPONENT_HPP_
#define ENGINE_COMPONENTS_SPRITECOMPONENT_HPP_

#include "Assets/Sprites.hpp"
#include <memory>
#include <string>

namespace Engine {
struct SpriteComponent {
    std::shared_ptr<Sprite> sprite;

    std::string assetPath;

    float offsetX;

    float offsetY;

    float scaleX = 1.0f;

    float scaleY = 1.0f;

    bool flipX = false;

    bool flipY = false;

    SpriteComponent(std::shared_ptr<Sprite> spritePtr = nullptr, const std::string& path = "",
                    float offsetX = 0.0f, float offsetY = 0.0f, float scaleX = 1.0f,
                    float scaleY = 1.0f, bool flipX = false, bool flipY = false)
        : sprite(spritePtr), assetPath(path), offsetX(offsetX), offsetY(offsetY), scaleX(scaleX),
          scaleY(scaleY), flipX(flipX), flipY(flipY) {}
};
} // namespace Engine

#endif // ENGINE_COMPONENTS_SPRITECOMPONENT_HPP_