Enumeration of the string drawing styles.
Draw the object to a render target.
Return the position of the index-th character.
Get the character size.
Get the global color of the text.
Get thet text's font.
Get the global bounding rectangle of the entity.
Get the local bounding rectangle of the entity.
Get the text's string.
Get the text's style.
Set the character size.
Set the global color of the text.
Set the text's font.
Set the text's string.
Set the text's style.
The local origin of the object.
The position of the object. The default is (0, 0).
The orientation of the object, in degrees. The default is 0 degrees.
The scale factors of the object. The default is (1, 1).
Get the inverse of the combined transform of the object.
Get the combined transform of the object.
Move the object by a given offset.
Draw the object to a render target.
The local origin of the object.
The position of the object. The default is (0, 0).
The orientation of the object, in degrees. The default is 0 degrees.
The scale factors of the object. The default is (1, 1).
Get the inverse of the combined transform of the object.
Get the combined transform of the object.
Move the object by a given offset.
Graphical text that can be drawn to a render target.
Text is a drawable class that allows to easily display some text with custom style and color on a render target.
It inherits all the functions from Transformable: position, rotation, scale, origin. It also adds text-specific properties such as the font to use, the character size, the font style (bold, italic, underlined), the global color and the text to display of course. It also provides convenience functions to calculate the graphical size of the text, or to get the global position of a given character.
Text works in combination with the Font class, which loads and provides the glyphs (visual characters) of a given font.
The separation of Font and Text allows more flexibility and better performances: indeed a Font is a heavy resource, and any operation on it is slow (often too slow for real-time applications). On the other side, a Text is a lightweight object which can combine the glyphs data and metrics of a Font to display any text on a render target.
It is important to note that the Text instance doesn't copy the font that it uses, it only keeps a reference to it. Thus, a Font must not be destructed while it is used by a Text (i.e. never write a function that uses a local Font instance for creating a text).