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

int

font () const

int

fontSize () const

bool

kerning () const

void

setAlign (int alignment)

void

setColor (const Vector4 color)

void

setFontSize (int size)

void

setKerning (const bool kerning)

void

setMaterial (Material * material)

void

setSize (const Vector2 boundaries)

void

setText (const std::string text)

void

setWordWrap (bool wrap)

Vector2

size () const

std::string

text () 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().


int TextRender::font () const

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


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().


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::setFontSize (int size)

Changes the size of the font.

See also fontSize().


void TextRender::setKerning (bool kerning)

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::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 (std::string text)

Changes the text which will be drawn.

See also *text*().


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().


std::string TextRender::text () const

Returns the text which will be drawn.

See also setText().


bool TextRender::wordWrap () const

Returns true if word wrap enabled; otherwise returns false.

See also setWordWrap().