aboutsummaryrefslogtreecommitdiff
path: root/include/gui
diff options
context:
space:
mode:
Diffstat (limited to 'include/gui')
-rw-r--r--include/gui/Label.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/gui/Label.hpp b/include/gui/Label.hpp
new file mode 100644
index 0000000..a94ff96
--- /dev/null
+++ b/include/gui/Label.hpp
@@ -0,0 +1,23 @@
+#pragma once
+
+#include "Widget.hpp"
+
+#include <mglpp/graphics/Color.hpp>
+#include <mglpp/graphics/Text.hpp>
+
+namespace gsr {
+ class Label : public Widget {
+ public:
+ // TODO: Allow specifying max width, at which either a line-break should occur or elipses should show
+ Label(mgl::Font *font, const char *text, mgl::Color color);
+ Label(const Label&) = delete;
+ Label& operator=(const Label&) = delete;
+
+ bool on_event(mgl::Event &event, mgl::Window &window, mgl::vec2f offset) override;
+ void draw(mgl::Window &window, mgl::vec2f offset) override;
+
+ mgl::vec2f get_size();
+ private:
+ mgl::Text text;
+ };
+} \ No newline at end of file