Display, manage, and manipulate text in the GUI. More...
#include <gui.h>
Public Member Functions | |
GuiText (const char *t, int s, GXColor c) | |
GuiText (const char *t) | |
~GuiText () | |
Destructor. | |
void | SetText (const char *t) |
void | SetPresets (int sz, GXColor c, int w, u16 s, int h, int v) |
void | SetFontSize (int s) |
void | SetMaxWidth (int width) |
void | SetScroll (int s) |
void | SetWrap (bool w, int width=0) |
void | SetColor (GXColor c) |
void | SetStyle (u16 s) |
void | SetAlignment (int hor, int vert) |
void | Draw () |
Constantly called to draw the text. | |
Protected Attributes | |
char * | origText |
Original text data. | |
wchar_t * | text |
Unicode text value. | |
int | size |
Font size. | |
int | maxWidth |
Maximum width of the generated text object (for text wrapping). | |
bool | wrap |
Wrapping toggle. | |
wchar_t * | textDyn |
Wrapped text value. | |
int | textScroll |
Scrolling toggle. | |
int | textScrollPos |
Current starting index of text string for scrolling. | |
int | textScrollInitialDelay |
Delay to wait before starting to scroll. | |
int | textScrollDelay |
Scrolling speed. | |
u16 | style |
FreeTypeGX style attributes. | |
GXColor | color |
Font color. |
Display, manage, and manipulate text in the GUI.
Definition at line 598 of file gui.h.
GuiText::GuiText | ( | const char * | t, | |
int | s, | |||
GXColor | c | |||
) |
Constructor
t | Text | |
s | Font size | |
c | Font color |
Constructor for the GuiText class.
Definition at line 44 of file gui_text.cpp.
GuiText::GuiText | ( | const char * | t | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. SetPresets() has been called to setup preferred text attributes
t | Text |
Constructor for the GuiText class, uses presets
Definition at line 73 of file gui_text.cpp.
GuiText::~GuiText | ( | ) |
void GuiText::Draw | ( | ) | [virtual] |
Constantly called to draw the text.
Draw the text on screen
Reimplemented from GuiElement.
Definition at line 223 of file gui_text.cpp.
void GuiText::SetAlignment | ( | int | hor, | |
int | vert | |||
) | [virtual] |
Sets the text alignment
hor | Horizontal alignment (ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTRE) | |
vert | Vertical alignment (ALIGN_TOP, ALIGN_BOTTOM, ALIGN_MIDDLE) |
Reimplemented from GuiElement.
Definition at line 187 of file gui_text.cpp.
void GuiText::SetColor | ( | GXColor | c | ) |
void GuiText::SetFontSize | ( | int | s | ) |
void GuiText::SetMaxWidth | ( | int | width | ) |
Sets the maximum width of the drawn texture image
w | Maximum width |
Definition at line 149 of file gui_text.cpp.
void GuiText::SetPresets | ( | int | sz, | |
GXColor | c, | |||
int | w, | |||
u16 | s, | |||
int | h, | |||
int | v | |||
) |
Sets up preset values to be used by GuiText(t) Useful when printing multiple text elements, all with the same attributes set
sz | Font size | |
c | Font color | |
w | Maximum width of texture image (for text wrapping) | |
s | Font size | |
h | Text alignment (horizontal) | |
v | Text alignment (vertical) |
Definition at line 134 of file gui_text.cpp.
void GuiText::SetScroll | ( | int | s | ) |
Enables/disables text scrolling
s | Scrolling on/off |
Definition at line 160 of file gui_text.cpp.
void GuiText::SetStyle | ( | u16 | s | ) |
Sets the FreeTypeGX style attributes
s | Style attributes |
Definition at line 182 of file gui_text.cpp.
void GuiText::SetText | ( | const char * | t | ) |
Sets the text of the GuiText element
t | Text |
Definition at line 112 of file gui_text.cpp.
void GuiText::SetWrap | ( | bool | w, | |
int | width = 0 | |||
) |
Enables/disables text wrapping
w | Wrapping on/off | |
width | Maximum width (0 to disable) |
Definition at line 154 of file gui_text.cpp.