Text

Text defines a graphical 2D text, that can be drawn on screen. - The default foreground color is <code>Color.Black</code> - The default background color is <code>Color.White</code>

Constructors

this
this(Font font, string text)

CTor

this
this(Font font, string text)

CTor: Rvalue version

Members

Functions

_render
void _render()
Undocumented in source.
calculateCenter
const(Vector2s) calculateCenter()

Calculate, store and return the center point.

collideWith
bool collideWith(Text rhs)

Check whether the bounding box of this Text collide with the bounding box of another Text

collideWith
bool collideWith(FloatRect rect)

Check whether the bounding box of this Sprite collide with the given Rect

collideWith
bool collideWith(FloatRect rect)

Rvalue version

forceUpdate
void forceUpdate()

Activate an update. The current image will be updated. In most cases, this happens automatically, but sometimes it is usefull.

format
void format(string text, Args args)

Format a given string and draw it then on the image

getBackgroundColor
const(Color) getBackgroundColor()

Returns the background color.

getBlend
inout(Blend) getBlend()

Returns the current Blend instance, or null.

getBoundingBox
FloatRect getBoundingBox()

Returns the bounding box, the area which will be drawn on the screen.

getColor
const(Color) getColor()

Returns the (foreground) color.

getFont
inout(Font) getFont()

Returns the current Font object.

getString
string getString()

Returns the current string.

getTexture
inout(Texture) getTexture()

Get the image containing the rendered characters.

opBinary
Text opBinary(string text)

Concatenate the current string with another.

opBinary
Text opBinary(Text t)

Concatenate the current string with another.

opCall
void opCall(string text)

Replace the current string.

opCall
void opCall(Text t)

Replace the current string.

replaceFont
void replaceFont(Font font)

Replace the current Font.

replaceFont
void replaceFont(Font font)

Rvalue version

setBackgroundColor
void setBackgroundColor(Color col)

Set the background color. Only needed if your Font.Mode is not Font.Mode.Solid.

setBackgroundColor
void setBackgroundColor(Color col)

Rvalue version

setBlend
void setBlend(Blend blend)

Set (or reset) the current Blend instance.

setColor
void setColor(Color col)

Set the (foreground) color.

setColor
void setColor(Color col)

Rvalue version

Properties

height
ushort height [@property getter]

Returns the height of the Text Texture

width
ushort width [@property getter]

Returns the width of the Text Texture

Variables

_bg
Color _bg;
Undocumented in source.
_blend
Blend _blend;
Undocumented in source.
_fg
Color _fg;
Undocumented in source.
_font
Font _font;
Undocumented in source.
_needUpdate
bool _needUpdate;
Undocumented in source.
_tex
Texture _tex;
Undocumented in source.
_text
string _text;
Undocumented in source.

Inherited Members

From Transformable

_applyTranslation
void _applyTranslation()

Apply translation to the object.

calculateCenter
const(Vector2s) calculateCenter()

Calculate, store and return the center point.

resetTranslation
void resetTranslation()

Reset the translation.

setCenter
void setCenter(Vector2s center)

Set the rotation center.

setCenter
void setCenter(short x, short y)

Set the rotation center.

getCenter
const(Vector2s) getCenter()

Returns the rotation center.

setRotation
void setRotation(short rotAngle)

Set a (new) rotation.

rotate
void rotate(short rotAngle)

Increase/Decrease the rotation.

getRotation
short getRotation()

Returns the current rotation.

setScale
void setScale(float zoom)

Set a new scale.

scale
void scale(float zoom)

Increase/Decrease the scale/zoom.

getScale
float getScale()

Returns the current scale/zoom.

From Drawable

_render
void _render()
Undocumented in source.
render
void render()

Render method

From Blendable

setBlend
void setBlend(Blend blend)

Set (or reset) the current Blend instance.

getBlend
inout(Blend) getBlend()

Returns the current Blend instance, or null.

Meta

Authors

rschuett