31#include <SFML/Graphics/Export.hpp>
32#include <SFML/Graphics/Drawable.hpp>
33#include <SFML/Graphics/Transformable.hpp>
34#include <SFML/Graphics/Font.hpp>
35#include <SFML/Graphics/Rect.hpp>
36#include <SFML/Graphics/VertexArray.hpp>
37#include <SFML/System/String.hpp>
62 StrikeThrough = 1 << 3
88 Text(
const String&
string,
const Font& font,
unsigned int characterSize = 30);
433 void ensureGeometryUpdate()
const;
440 unsigned int m_characterSize;
441 float m_letterSpacingFactor;
442 float m_lineSpacingFactor;
445 Color m_outlineColor;
446 float m_outlineThickness;
450 mutable bool m_geometryNeedUpdate;
451 mutable Uint64 m_fontTextureId;
Utility class for manipulating RGBA colors.
Abstract base class for objects that can be drawn to a render target.
Class for loading and manipulating character fonts.
Define the states used for drawing to a RenderTarget.
Base class for all render targets (window, texture, ...)
Utility string class that automatically handles conversions between types and encodings.
Graphical text that can be drawn to a render target.
float getLetterSpacing() const
Get the size of the letter spacing factor.
Uint32 getStyle() const
Get the text's style.
const Color & getFillColor() const
Get the fill color of the text.
void setFont(const Font &font)
Set the text's font.
Vector2f findCharacterPos(std::size_t index) const
Return the position of the index-th character.
FloatRect getLocalBounds() const
Get the local bounding rectangle of the entity.
unsigned int getCharacterSize() const
Get the character size.
Text(const String &string, const Font &font, unsigned int characterSize=30)
Construct the text from a string, font and size.
float getLineSpacing() const
Get the size of the line spacing factor.
void setString(const String &string)
Set the text's string.
void setOutlineColor(const Color &color)
Set the outline color of the text.
Style
Enumeration of the string drawing styles.
void setOutlineThickness(float thickness)
Set the thickness of the text's outline.
const String & getString() const
Get the text's string.
const Color & getColor() const
Get the fill color of the text.
void setLetterSpacing(float spacingFactor)
Set the letter spacing factor.
void setFillColor(const Color &color)
Set the fill color of the text.
FloatRect getGlobalBounds() const
Get the global bounding rectangle of the entity.
void setStyle(Uint32 style)
Set the text's style.
const Font * getFont() const
Get the text's font.
const Color & getOutlineColor() const
Get the outline color of the text.
void setCharacterSize(unsigned int size)
Set the character size.
void setLineSpacing(float spacingFactor)
Set the line spacing factor.
float getOutlineThickness() const
Get the outline thickness of the text.
void setColor(const Color &color)
Set the fill color of the text.
Text()
Default constructor.
Define a set of one or more 2D primitives.