#include <textbox.h>
Inheritance diagram for KrTextBox::
Public Methods | |
KrTextBox (KrFontResource *resource, int width, int height, int lineSpacing, Alignment alignment=LEFT) | |
Create a box that contains text. More... | |
KrFontResource * | FontResource () |
Get the resource for this TextBox. | |
int | Width () const |
Size, untransformed, of this box:. | |
int | Height () const |
Size, untransformed, of this box:. | |
int | NumLines () const |
Number of lines of text in this text box. | |
int | GetLineY (int lineNum) const |
Get the y offset to a given line. | |
void | SetText16 (const U16 *text, int lineNum) |
Set the text of a given linenumber, in 16 bit characters. | |
const U16 * | GetText16 (int lineNum) const |
Get the text of a given linenumber, in 16 bit characters. | |
const GlDynArray< U16 > & | GetText16Array (int lineNum) const |
A slightly faster way to get the 16 bit text. | |
void | SetTextChar (const std::string &text, int lineNum) |
Set the text of a given linenumber, in 8 bit characters. | |
void | GetTextChar (std::string *buffer, int lineNum) |
Get the text of a given linenumber, in 8 bit characters. | |
int | GetLineLength (int lineNum=0) |
Return the length of the line, without counting the terminator. | |
virtual KrImNode * | Clone () |
Return a copy if this object, not in a Tree(). More... | |
virtual KrTextBox * | ToTextBox () |
Return a pointer if this is a text box. |
Created from a font resource.
Note that this is a container class; it does not draw. It will create sprites -- as children -- for the letters of text. The sprites will be fully managed by the text box and should not be changed by the client.
If hit testing, it may be necessary to check the Parent's parent to see if it is a text box.
|
Create a box that contains text.
|
|
Return a copy if this object, not in a Tree(). It is return untransformed. In the case of a sprite, the action and frame will be set to the current value. Reimplemented from KrImNode. |