Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
|
A Text is used to render text. More...
#include <header.hpp>
Public Member Functions | |
Text | Clone () |
Create a clone of the object and return an handler to the clone. | |
Text | CloneToGroup (Group newParent) |
Create a clone of the object, change the parent and return an handler to the clone. | |
nil | SetText (string text) |
Set text. | |
string | GetText () |
Get text. | |
Vector2D | GetTextSize () |
Return the size of the texte. | |
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. | |
nil | SetScale (Vector2D Scale) |
Set object's scale. | |
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 | SetCenter (Vector2D Center) |
Set object's center. | |
Vector2D | GetCenter () |
Get object's center. | |
nil | SetFont (Font numberFont) |
Set the Font of the string. | |
Font | GetFont () |
Get the Font of the string. | |
nil | SetSize (number size) |
Set the text size of the string. | |
number | GetSize () |
Get the text size of the string. | |
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 (size_t 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. |
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.
Text Text::Clone | ( | ) |
Create a clone of the object and return an handler to the clone.
Reimplemented from Object.
Create a clone of the object, change the parent and return an handler to the clone.
Reimplemented from Object.
bool Text::GetBold | ( | ) |
Tells if the Text should be rendered bold.
Vector2D Text::GetCenter | ( | ) |
Get object's center.
Vector2D Text::GetCharacterPos | ( | size_t | Index | ) |
Get the position of the character Index in the text.
Color Text::GetColor | ( | ) |
Get object's color.
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 text size of the string.
string Text::GetText | ( | ) |
Get text.
Vector2D Text::GetTextSize | ( | ) |
Return the size of the texte.
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::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 | ) |
Set object's 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 text size of the string.
nil Text::SetText | ( | string | text | ) |
Set text.
nil Text::SetUnderligned | ( | bool | isUnderligned | ) |
Set if the Text should be rendered underligned.
bool Text::bold |
Acces bold parameter.
bool Text::canCutWords |
Get / Set if words can be cut if a maximum width is set.
Default is false.
Acces object's color.
bool Text::italic |
Acces bold parameter.
float Text::maxWidth |
Access the text max width (see SetMaxWidth)
std::string Text::text |
Access text.
bool Text::underligned |
Acces bold parameter.