// Copyright (c) 2023 Dominic Masters // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #pragma once #include "ui/UIComponent.hpp" #include "display/font/TrueTypeTexture.hpp" namespace Dawn { class UILabel final : public UIComponent { private: std::shared_ptr<TrueTypeTexture> texture = nullptr; std::wstring text = L"Hello World"; protected: void getSelfQuads(UICanvas &ctx) override; public: bool_t wordWrap = true; /** * Returns the font used for this label. * * @return The font used for this label. */ std::shared_ptr<TrueTypeTexture> getFont(); /** * Returns the text used for this label. * * @return The text used for this label. */ std::wstring getText(); /** * Sets the font to use for this label. * * @param texture TrueType texture to use for this label. */ void setFont(std::shared_ptr<TrueTypeTexture> texture); /** * Sets the text to use for this label. * * @param text The text to use for this label. */ void setText(const std::wstring &text); }; }