This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-gunner/source/abstract/Sprite.h

47 lines
895 B
C
Raw Normal View History

/*
* Sprite.h
*
* Created on: 22.07.2012
* Author: Felix
*/
#ifndef DG_SPRITE_H_
#define DG_SPRITE_H_
#include <SFML/Graphics.hpp>
#include <Thor/Resources.hpp>
#include "Body.h"
2012-12-22 14:10:26 +00:00
#include <string>
#include "../util/Yaml.h"
class Body;
class Yaml;
/**
* Represents a drawable object.
*
* Handles drawing to world.
*/
class Sprite : public sf::Drawable, public Body {
2012-09-16 18:45:12 +00:00
// Public functions.
public:
2012-12-22 14:10:26 +00:00
Sprite(const Yaml& config, const Data& data, const sf::Vector2i& size = sf::Vector2i());
virtual ~Sprite() = 0;
2012-09-16 18:45:12 +00:00
// Protected functions.
protected:
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
2012-09-16 18:45:12 +00:00
// Private variables.
private:
2012-12-22 14:10:26 +00:00
static const std::string KEY_TEXTURE;
static const std::string DEFAULT_TEXTURE;
std::shared_ptr<sf::Texture> mTexture;
2012-12-22 14:10:26 +00:00
sf::Vector2i mSize;
};
#endif /* DG_SPRITE_H_ */