JNGL
Label.hpp
Go to the documentation of this file.
1 // Copyright 2020-2021 Jan Niklas Hasse <[email protected]>
2 // For conditions of distribution and use, see copyright notice in LICENSE.txt
5 #pragma once
6 
7 #include "Color.hpp"
8 #include "Widget.hpp"
9 #include "text.hpp"
10 
11 namespace jngl {
12 
13 class Label : public Widget {
14 public:
15  explicit Label(const std::string& str, Font&, Color, Vec2 position);
16 
17  void drawSelf() const override;
18 
19 private:
20  jngl::Text text;
21  jngl::Color color;
22 };
23 
24 } // namespace jngl
Contains jngl::Color class.
Contains jngl::Container class.
Object representing a RGB color.
Definition: Color.hpp:25
Font loaded from a TTF or OTF file.
Definition: font.hpp:18
void drawSelf() const override
Override this function to draw the widget.
Rectangle shaped text block.
Definition: text.hpp:23
Two-dimensional vector.
Definition: Vec2.hpp:35
jngl::Vec2 position
Center.
Definition: Widget.hpp:54
JNGL's main namespace.
Definition: App.hpp:10