uui/include/uui/opengl/label.hpp
2022-10-01 05:03:16 +09:00

44 lines
1 KiB
C++

#pragma once
#include <string>
#include <tuple>
#include "uui/opengl/component.hpp"
#include "uui/opengl/container.hpp"
namespace uui
{
class GlFlex;
class GlStack;
class GlLabel: public GlComponent
{
friend class GlWindow;
friend class GlFlex;
friend class GlStack;
std::size_t font_index;
float get_width() const;
float get_height() const;
protected:
std::string text;
std::tuple<float, float, float, float> text_color;
int text_width;
int text_height;
GlLabel(
std::shared_ptr<GlWindow> window, std::size_t window_index, std::shared_ptr<GlContainer> parent,
std::size_t parent_index, const position_t x, const position_t y, const std::string& text,
const std::tuple<float, float, float, float>& text_color);
GlLabel(
std::shared_ptr<GlWindow> window, std::size_t window_index, const position_t x, const position_t y,
const std::string& text, const std::tuple<float, float, float, float>& text_color):
GlLabel(window, window_index, window, window_index, x, y, text, text_color)
{}
void render();
};
} // namespace uui