-
Notifications
You must be signed in to change notification settings - Fork 0
/
AnimatedLabel.hpp
41 lines (32 loc) · 925 Bytes
/
AnimatedLabel.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
40
41
#ifndef ANIMATEDLABEL_HPP
#define ANIMATEDLABEL_HPP
#include <SFML/Graphics.hpp>
namespace gui {
class AnimatedLabel : public sf::Drawable
{
public:
AnimatedLabel(const sf::Font & font);
AnimatedLabel(const sf::Font & font,
const sf::IntRect & layout);
void setLayout(const sf::IntRect & layout);
void setFont(const sf::Font & font);
void setString(const sf::String & string);
void setLoop(bool loop);
void update(const sf::Time & elapsed);
private:
void init();
void innerUpdate();
void draw(sf::RenderTarget &target, sf::RenderStates states) const;
sf::Sprite mFinalSprite;
sf::RenderTexture mRenderTexture;
sf::Text mTextSprite;
sf::Font mFont;
float mHorizontalPosition;
// degrade stuff
sf::VertexArray mDegradeQuad;
sf::RenderStates mDegradeLeft;
sf::RenderStates mDegradeRight;
bool mDoLoop;
};
}
#endif // ANIMATEDLABEL_HPP