]> git.localhorst.tv Git - blobs.git/blob - src/ui/Label.hpp
track a few things
[blobs.git] / src / ui / Label.hpp
1 #ifndef BLOBS_UI_LABEL_HPP_
2 #define BLOBS_UI_LABEL_HPP_
3
4 #include "Widget.hpp"
5 #include "../graphics/Texture.hpp"
6
7 #include <string>
8
9
10 namespace blobs {
11 namespace graphics {
12         class Font;
13 }
14 namespace ui {
15
16 class Label
17 : public Widget {
18
19 public:
20         explicit Label(const graphics::Font &);
21         ~Label() override;
22
23 public:
24         Label *Text(const std::string &);
25         Label *Font(const graphics::Font &);
26         Label *Foreground(const glm::vec4 &);
27         Label *Background(const glm::vec4 &);
28
29         glm::vec2 Size() override;
30         void Draw(app::Assets &, graphics::Viewport &) noexcept override;
31
32 private:
33         void Update();
34
35 private:
36         const graphics::Font *font;
37         std::string text;
38         graphics::Texture tex;
39         glm::vec4 fg_color;
40         glm::vec4 bg_color;
41         bool dirty;
42
43 };
44
45 }
46 }
47
48 #endif