-
Notifications
You must be signed in to change notification settings - Fork 0
/
drawable.cpp
48 lines (38 loc) · 982 Bytes
/
drawable.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "drawable.hpp"
namespace loopline
{
Drawable::Drawable()
{
}
Drawable::~Drawable()
{
}
void Drawable::setSprite(sf::Texture const &tex, sf::IntRect const &rect, sf::Vector2f const &origin)
{
sprite.setTexture(tex);
sprite.setTextureRect(rect);
sprite.setOrigin(origin);
}
void Drawable::setSpritePosition(sf::Vector2f const &worldPos)
{
sprite.setPosition(worldPos);
}
void Drawable::setSpriteRotation(float angle)
{
sprite.setRotation(angle);
}
void Drawable::setSpriteScale(sf::Vector2f const &scale)
{
sprite.setScale(scale);
}
void Drawable::draw(sf::RenderWindow &window) const
{
window.draw(this->sprite);
}
void Drawable::drawInfo(sf::RenderWindow &window, sf::Font const &font) const
{
}
void Drawable::drawUI(sf::RenderWindow &window, sf::Font const &font) const
{
}
} // namespace loopline