aboutsummaryrefslogtreecommitdiff
path: root/include/gui/Label.hpp
blob: 3cb91de7104b9092157a946072e62be7f465a546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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() override;
    private:
        mgl::Text text;
    };
}