-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sprites.hpp
39 lines (23 loc) · 833 Bytes
/
Sprites.hpp
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
#pragma once
#include "ResourceIdentifiers.hpp"
#include "SpritesData.hpp"
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/System/NonCopyable.hpp>
#include <memory>
class Sprites final : public sf::Drawable, public sf::Transformable, private sf::NonCopyable
{
public:
using Ptr = std::unique_ptr<Sprites>;
public:
explicit Sprites(const TextureHolder& textures, const sf::IntRect& rect, float offset);
float getOffset() const;
sf::FloatRect getBoundingRect() const;
void update(float width, float roadWidth, float scaleXY, float destX, float destY, float offsetX, float offsetY, float clip);
private:
void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
private:
sf::Sprite mSprite;
SpritesData mSpritesData;
mutable bool mIsDrawing;
float mOffset;
};