TextRender

Inherited: None

Description

The TextRender component allows you to display a text in both 2D and 3D scenes.

Public Methods

int

align () const

Vector4

color () const

Font *

font () const

int

fontSize () const

bool

kerning () const

int

layer () const

void

setAlign (int alignment)

void

setColor (const Vector4 & color)

void

setFont (Font * font)

void

setFontSize (int size)

void

setKerning (const bool enable)

void

setLayer (int layer)

void

setMaterial (Material * material)

void

setSize (const Vector2 & boundaries)

void

setText (const TString & text)

void

setTranslated (bool enable)

void

setWordWrap (bool wrap)

Vector2

size () const

TString

text () const

bool

translated () const

bool

wordWrap () const

Static Methods

None

Methods Description

int TextRender::align () const

Returns text alignment policy.

See also setAlign().


Vector4 TextRender::color () const

Returns the color of the text to be drawn.

See also setColor().


Font * TextRender::font () const

Returns the font which will be used to draw a text.

See also setFont().


int TextRender::fontSize () const

Returns the size of the font.

See also setFontSize().


bool TextRender::kerning () const

Returns true if glyph kerning enabled; otherwise returns false.

See also setKerning().


int TextRender::layer () const

Returns the redering layer.

See also setLayer().


void TextRender::setAlign (int alignment)

Sets text alignment policy.

See also align().


void TextRender::setColor (Vector4 & color)

Changes the color of the text to be drawn.

See also color().


void TextRender::setFont (Font * font)

Sets the new font asset used to render a text.

See also font().


void TextRender::setFontSize (int size)

Changes the size of the font.

See also fontSize().


void TextRender::setKerning (bool enable)

Set true to enable glyph kerning and false to disable.

Note: Glyph kerning functionality depends on fonts which you are using. In case of font doesn’t support kerning, you will not see the difference.

See also kerning().


void TextRender::setLayer (int layer)

Sets the redering layer.

See also layer().


void TextRender::setMaterial (Material * material)

Reimplements: Renderable::setMaterial(Material *material).

Creates a new instance of material and assigns it.


void TextRender::setSize (Vector2 & boundaries)

Changes the size of boundaries of the text area. This parameter is involved in Word Wrap calculations.

See also size().


void TextRender::setText (TString & text)

Changes the text which will be drawn.

See also text().


void TextRender::setTranslated (bool enable)

Sets enable or disable translation from dictionary for current text render.

See also translated().


void TextRender::setWordWrap (bool wrap)

Sets the word wrap policy. Set true to enable word wrap and false to disable.

See also wordWrap().


Vector2 TextRender::size () const

Returns the boundaries of the text area. This parameter is involved in Word Wrap calculations.

See also setSize().


TString TextRender::text () const

Returns the text which will be drawn.

See also setText().


bool TextRender::translated () const

Returns true if text in text render must be translated; othewise returns false.

See also setTranslated().


bool TextRender::wordWrap () const

Returns true if word wrap enabled; otherwise returns false.

See also setWordWrap().