29#include <TGUI/Font.hpp>
30#include <TGUI/Color.hpp>
31#include <TGUI/Vector2f.hpp>
32#include <TGUI/TextStyle.hpp>
33#include <SFML/Graphics/Text.hpp>
34#include <SFML/Graphics/Transformable.hpp>
42 class TGUI_API
Text :
public sf::Transformable
46#ifndef TGUI_REMOVE_DEPRECATED_CODE
50 TGUI_DEPRECATED(
"Use as (non-static) member function instead") static
float getExtraHorizontalPadding(const
Text& text);
74#ifndef TGUI_REMOVE_DEPRECATED_CODE
78 TGUI_DEPRECATED(
"Use as (non-static) member function instead") static
float getLineHeight(const
Text& text);
86#ifndef TGUI_REMOVE_DEPRECATED_CODE
90 TGUI_DEPRECATED(
"Use as (non-static) member function instead") static
float getLineWidth(const
Text& text);
129 static sf::String
wordWrap(
float maxWidth,
const sf::String& text,
Font font,
unsigned int textSize,
bool bold,
bool dropLeadingSpace =
true);
310 void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
347 void recalculateSize();
357 Color m_outlineColor;
Wrapper for colors.
Definition: Color.hpp:49
Wrapper for text styles.
Definition: TextStyle.hpp:47
static float getExtraHorizontalPadding(Font font, unsigned int characterSize, TextStyle textStyle={})
Returns a small distance that text should be placed from the side of a widget as padding.
static float getExtraHorizontalOffset(Font font, unsigned int characterSize, TextStyle textStyle={})
Returns an extra distance that text should be placed from the side of a widget as padding.
float getOutlineThickness() const
Returns the text outline thickness.
void setCharacterSize(unsigned int size)
Changes the character size of the text.
static unsigned int findBestTextSize(Font font, float height, int fit=0)
Finds the best character size for the text.
Color getColor() const
Returns the text fill color.
Font getFont() const
Returns the font of the text.
void setColor(Color color)
Changes the text fill color.
void setOutlineThickness(float thickness)
Changes the text outline thickness.
static float getLineHeight(Font font, unsigned int characterSize, TextStyle textStyle={})
Returns the height of a single line of text.
void setString(const sf::String &string)
Changes the text.
static float getExtraVerticalPadding(unsigned int characterSize)
Returns the distance that text should be placed from the bottom of the widget as padding.
unsigned int getCharacterSize() const
Returns the character size of the text.
float getLineHeight() const
Returns the height of a single line of text.
float getLineWidth() const
Returns the width of a single line of text.
void setOutlineColor(Color color)
Changes the text outline color.
Vector2f findCharacterPos(std::size_t index) const
Return the position of the index-th character.
void setStyle(TextStyle style)
Changes the style of the text.
float getExtraHorizontalOffset() const
Returns an extra distance that text should be placed from the side of a widget as padding.
float getExtraHorizontalPadding() const
Returns a small distance that text should be placed from the side of a widget as padding.
Color getOutlineColor() const
Returns the text outline color.
static float calculateExtraVerticalSpace(Font font, unsigned int characterSize, TextStyle style={})
Vector2f getSize() const
Returns the size of the text.
void draw(sf::RenderTarget &target, sf::RenderStates states) const
Draw the text to a render target.
TextStyle getStyle() const
Returns the style of the text.
float getOpacity() const
Returns the opacity of the text.
void setOpacity(float opacity)
Changes the opacity of the text.
static sf::String wordWrap(float maxWidth, const sf::String &text, Font font, unsigned int textSize, bool bold, bool dropLeadingSpace=true)
static float getLineWidth(const sf::String &text, Font font, unsigned int characterSize, TextStyle textStyle={})
Returns the width of a single line of text.
const sf::String & getString() const
Returns the text.
void setFont(Font font)
Changes the font used for the text.
Definition: Vector2f.hpp:39
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37