37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
107 Text(std::string string,
Font& font,
unsigned characterSize = 30);
153 return m_characterSize;
198 void setColor(
const Color4f& color);
230 return m_outlineColor;
252 return m_outlineThickness;
272 return m_paragraphWidth;
345 void updateGeometry();
349 std::vector<std::u32string> words;
351 float spacing = 0.0f;
355 std::vector<Line> lines;
358 float getWordWidth(
const std::u32string& word);
360 std::vector<Paragraph> makeParagraphs(
const std::string& str,
float spaceWidth);
363 std::string m_string;
365 unsigned m_characterSize;
370 Color4f m_outlineColor;
371 float m_outlineThickness;
374 float m_paragraphWidth;
378 #ifndef DOXYGEN_SHOULD_SKIP_THIS
void setAnchor(Anchor anchor)
Set the anchor origin of the entity.
float getOutlineThickness()
Get the outline thickness of the text.
Definition: Text.h:251
void setColor(const Color4f &color)
Set the fill color of the text.
void setFont(Font &font)
Set the text's font.
A set of primitives.
Definition: VertexArray.h:65
Text()
Default constructor.
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:65
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:82
const Color4f & getColor() const
Get the fill color of the text.
Definition: Text.h:207
unsigned getCharacterSize() const
Get the character size.
Definition: Text.h:152
virtual void draw(RenderTarget &target, RenderStates states) override
Draw the object to a render target.
Data in the graphics memory.
Definition: VertexBuffer.h:70
void setOutlineThickness(float thickness)
Set the thickness of the text's outline.
RectF getLocalBounds() const
Get the local bounding rectangle of the entity.
Definition: Text.h:306
void setOutlineColor(const Color4f &color)
Set the outline color of the text.
void setAlignment(Alignment align)
Set the alignement of the text.
Alignment getAlignment() const
Get the alignment of the text.
Definition: Text.h:291
Graphical text that can be drawn to a render target.
Definition: Text.h:91
VertexBuffer commitGeometry() const
Create a buffer with the current geometry.
const std::string & getString() const
Get the text's string.
Definition: Text.h:130
void setParagraphWidth(float paragraphWidth)
Set the paragraph width for aligned text.
void setString(std::string string)
Set the text's string.
Text(std::string string, Font &font, unsigned characterSize=30)
Construct the text from a string, font and size.
A character font.
Definition: Font.h:130
float getParagraphWidth() const
Get the paragraph width.
Definition: Text.h:271
const Color4f & getOutlineColor() const
Get the outline color of the text.
Definition: Text.h:229
Anchor
The origin anchor of the transformable object.
Definition: Transformable.h:45
const Font * getFont() const
Get the text's font.
Definition: Text.h:183
Alignment
The alignement of a text.
Definition: Alignment.h:33
#define GF_API
Definition: Portability.h:35
VertexBuffer commitOutlineGeometry() const
Create a buffer with the current outline geometry.
void setCharacterSize(unsigned characterSize)
Set the character size.