25#ifndef TGUI_RICH_TEXT_LABEL_HPP
26#define TGUI_RICH_TEXT_LABEL_HPP
28#include <TGUI/Widgets/Label.hpp>
32TGUI_MODULE_EXPORT
namespace tgui
52 using Ptr = std::shared_ptr<RichTextLabel>;
53 using ConstPtr = std::shared_ptr<const RichTextLabel>;
55 static constexpr const char StaticWidgetType[] =
"RichTextLabel";
64 RichTextLabel(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
122 float calculateLineSpacing(
const std::vector<Text::Blueprint>& line,
float defaultLineSpacing);
127 float calculateTextHeight(
const std::vector<std::vector<Text::Blueprint>>& textPiecesLines,
float defaultLineSpacing);
137 std::vector<Sprite> m_images;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
Label widget.
Definition Label.hpp:41
RichTextLabel widget.
Definition RichTextLabel.hpp:49
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
static RichTextLabel::Ptr create(const String &text="")
Creates a new label widget.
void draw(BackendRenderTarget &target, RenderStates states) const override
Draw the widget to a render target.
void rendererChanged(const String &property) override
Function called when one of the properties of the renderer is changed.
virtual void constructRichLineBlueprints(std::vector< std::vector< Text::Blueprint > > &textPiecesLines, std::vector< Texture > &images)
Helper function used by rearrangeText() to create the lines before word-wrapping is applied.
std::shared_ptr< const RichTextLabel > ConstPtr
Shared constant widget pointer.
Definition RichTextLabel.hpp:53
static RichTextLabel::Ptr copy(const RichTextLabel::ConstPtr &label)
Makes a copy of another label.
void rearrangeText() override
Rearrange the text (recreates m_textPieces), making use of the given size of maximum text width.
std::shared_ptr< RichTextLabel > Ptr
Shared widget pointer.
Definition RichTextLabel.hpp:52
Wrapper class to store strings.
Definition String.hpp:96
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38
States used for drawing.
Definition RenderStates.hpp:38