Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
Public Member Functions | Public Attributes

Text Class Reference

A Text is used to render text. More...

#include <header.hpp>

Inheritance diagram for Text:
Drawable Object

List of all members.

Public Member Functions

nil SetText (string text)
 Set text.
string GetText ()
 Get text.
Vector2D GetTextSize ()
 Return the size of the texte (the size of the rectangle containing the text)
nil SetMaxWidth (number maxWidth)
 Set the maximum text width.
number GetMaxWidth ()
 Get the maximum text width.
nil SetCutWords (bool cutWords)
 Set if words can be cut if a maximum width is set.
bool IsCutWords ()
 Return true if words can be cut.
nil SetColor (Color Col)
 Set object's color.
Color GetColor ()
 Get object's color.
Vector2D GetScale ()
 Get object's scale.
nil SetScaleX (number FactorX)
 Set object's scale (x)
nil SetScaleY (number FactorY)
 Set object's scale (y)
nil SetScale (Vector2D scale)
nil SetCenter (Vector2D center)
 Set object's center.
Vector2D GetCenter ()
 Get object's center.
nil SetFont (Font numberFont)
 Set the Font of the text.
ProtectedPtr< FontGetFont ()
 Get the Font of the text.
nil SetSize (number size)
 Set the font size of the text (same as Text::SetFontSize)
number GetSize ()
 Get the font size of the text (same as Text::GetFontSize)
nil SetFontSize (number size)
 Set the font size of the text.
number GetFontSize ()
 Get the font size of the text.
nil SetBold (bool isBold)
 Set if the Text should be rendered bold.
bool GetBold ()
 Tells if the Text should be rendered bold.
nil SetItalic (bool isItalic)
 Set if the Text should be rendered italic.
bool GetItalic ()
 Tells if the Text should be rendered italic.
nil SetUnderligned (bool isUnderligned)
 Set if the Text should be rendered underligned.
bool GetUnderligned ()
 Tells if the Text should be rendered underligned.
Vector2D GetCharacterPos (number index)
 Get the position of the character index in the text.

Public Attributes

std::string text
 Access text.
float maxWidth
 Access the text max width (see SetMaxWidth)
bool canCutWords
 Get / Set if words can be cut if a maximum width is set.
Color color
 Acces object's color.
bool bold
 Acces bold parameter.
bool italic
 Acces bold parameter.
bool underligned
 Acces bold parameter.

Detailed Description

A Text is used to render text.

Font, style and size can be changed. It is also posible to enable auto line return. It should be created using Group::CreateText.


Member Function Documentation

bool Text::GetBold ( )

Tells if the Text should be rendered bold.

Vector2D Text::GetCenter ( )

Get object's center.

Vector2D Text::GetCharacterPos ( number  index)

Get the position of the character index in the text.

Color Text::GetColor ( )

Get object's color.

ProtectedPtr<Font> Text::GetFont ( )

Get the Font of the text.

number Text::GetFontSize ( )

Get the font size of the text.

bool Text::GetItalic ( )

Tells if the Text should be rendered italic.

number Text::GetMaxWidth ( )

Get the maximum text width.

Vector2D Text::GetScale ( )

Get object's scale.

number Text::GetSize ( )

Get the font size of the text (same as Text::GetFontSize)

string Text::GetText ( )

Get text.

Vector2D Text::GetTextSize ( )

Return the size of the texte (the size of the rectangle containing the text)

bool Text::GetUnderligned ( )

Tells if the Text should be rendered underligned.

bool Text::IsCutWords ( )

Return true if words can be cut.

Default is false.

nil Text::SetBold ( bool  isBold)

Set if the Text should be rendered bold.

nil Text::SetCenter ( Vector2D  center)

Set object's center.

nil Text::SetColor ( Color  Col)

Set object's color.

nil Text::SetCutWords ( bool  cutWords)

Set if words can be cut if a maximum width is set.

Default is false.

nil Text::SetFont ( Font  numberFont)

Set the Font of the text.

nil Text::SetFontSize ( number  size)

Set the font size of the text.

nil Text::SetItalic ( bool  isItalic)

Set if the Text should be rendered italic.

nil Text::SetMaxWidth ( number  maxWidth)

Set the maximum text width.

It means that if a line width is greater than maxWidth, then some line return will be added. maxWidth <= 0 means no limit (default).

nil Text::SetScale ( Vector2D  scale)
nil Text::SetScaleX ( number  FactorX)

Set object's scale (x)

nil Text::SetScaleY ( number  FactorY)

Set object's scale (y)

nil Text::SetSize ( number  size)

Set the font size of the text (same as Text::SetFontSize)

nil Text::SetText ( string  text)

Set text.

nil Text::SetUnderligned ( bool  isUnderligned)

Set if the Text should be rendered underligned.


Member Data Documentation

bool Text::bold

Acces bold parameter.

Get / Set if words can be cut if a maximum width is set.

Default is false.

Acces object's color.

Acces bold parameter.

Access the text max width (see SetMaxWidth)

std::string Text::text

Access text.

Acces bold parameter.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables