Text

Graphical text that can be drawn to a render target.

Constructors

this
this()

Default constructor

this
this(const(T)[] text, Font font, uint characterSize)

Construct the text from a string, font and size

this
this(const(dchar)[] text, Font font, uint characterSize)

Construct the text from a string, font and size

Destructor

~this
~this()

Destructor.

Members

Enums

Style
enum Style

Enumeration of the string drawing styles.

Functions

draw
void draw(RenderTarget renderTarget, RenderStates renderStates)

Draw the object to a render target.

findCharacterPos
Vector2f findCharacterPos(size_t index)

Return the position of the index-th character.

getCharacterSize
uint getCharacterSize()

Get the character size.

getColor
Color getColor()

Get the fill color of the text.

getFont
const(Font) getFont()

Get thet text's font.

getGlobalBounds
FloatRect getGlobalBounds()

Get the global bounding rectangle of the entity.

getLocalBounds
FloatRect getLocalBounds()

Get the local bounding rectangle of the entity.

getString
const(T)[] getString()

Get a copy of the text's string.

getStyle
Style getStyle()

Get the text's style.

setCharacterSize
void setCharacterSize(uint size)

Set the character size.

setColor
void setColor(Color color)

Set the fill color of the text.

setFont
void setFont(Font newFont)

Set the text's font.

setString
void setString(const(T)[] text)

Set the text's string.

setStyle
void setStyle(Style newStyle)

Set the text's style.

Mixins

__anonymous
mixin NormalTransformable
Undocumented in source.

Properties

characterSize
uint characterSize [@property setter]
uint characterSize [@property getter]

The character size in pixels.

fillColor
Color fillColor [@property setter]
Color fillColor [@property getter]

The fill color of the text.

font
Font font [@property setter]
const(Font) font [@property getter]

The text's font.

globalBounds
FloatRect globalBounds [@property getter]

Get the global bounding rectangle of the entity.

localBounds
FloatRect localBounds [@property getter]

Get the local bounding rectangle of the entity.

outlineColor
Color outlineColor [@property setter]
Color outlineColor [@property getter]

The outline color of the text.

outlineThickness
float outlineThickness [@property setter]
float outlineThickness [@property getter]

The outline color of the text.

string
const(T)[] string [@property setter]

The text's string.

string
const(T)[] string [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
style
Style style [@property setter]
Style style [@property getter]

The text's style.

Mixed In Members

From mixin NormalTransformable

origin
Vector2f origin [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
origin
Vector2f origin [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
position
Vector2f position [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
position
Vector2f position [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
rotation
float rotation [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
rotation
float rotation [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
scale
Vector2f scale [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
scale
Vector2f scale [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
getInverseTransform
const(Transform) getInverseTransform()
Undocumented in source. Be warned that the author may not have intended to support it.
getTransform
const(Transform) getTransform()
Undocumented in source. Be warned that the author may not have intended to support it.
move
void move(Vector2f offset)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From Drawable

draw
void draw(RenderTarget renderTarget, RenderStates renderstates)
Undocumented in source.

From Transformable

origin
Vector2f origin [@property setter]
Vector2f origin [@property getter]

The local origin of the object.

position
Vector2f position [@property setter]
Vector2f position [@property getter]

The position of the object. The default is (0, 0).

rotation
float rotation [@property setter]
float rotation [@property getter]

The orientation of the object, in degrees. The default is 0 degrees.

scale
Vector2f scale [@property setter]
Vector2f scale [@property getter]

The scale factors of the object. The default is (1, 1).

getTransform
const(Transform) getTransform()

Get the inverse of the combined transform of the object.

getInverseTransform
const(Transform) getInverseTransform()

Get the combined transform of the object.

move
void move(Vector2f offset)

Move the object by a given offset.

Meta