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 | |
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< Font > | GetFont () |
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. |
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.
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.
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::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.
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.