holesome/src/sprites/sprite_sheet.hpp

26 lines
597 B
C++
Raw Normal View History

#ifndef HOLESOME_SPRITE_SHEET_HPP
#define HOLESOME_SPRITE_SHEET_HPP
#include <memory>
#include <SFML/Graphics/Texture.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include "animated_sprite.hpp"
#include "single_sprite.hpp"
class SpriteSheet
{
public:
SpriteSheet(const std::shared_ptr<sf::Texture>& texture, int columns, int rows);
std::shared_ptr<SingleSprite> getSprite(int sequenceIndex) const;
std::shared_ptr<AnimatedSprite> getAnimation(int startingSequenceIndex, int numberOfFrames) const;
private:
std::vector<sf::Sprite> sprites;
};
#endif //HOLESOME_SPRITE_SHEET_HPP