|
Osiris Framework
0.2
|
Two-dimensional text handling class. More...
#include <OsirisSDK/OText2D.h>
Public Member Functions | |
| OText2D (OFont *font, unsigned int fontSize, float x, float y, const OVector4 &color=OVector4(1.0f), const char *content=NULL) | |
| Class constructor. More... | |
| virtual | ~OText2D () |
| Class destructor. | |
| void | setFont (OFont *font, unsigned int fontSize) |
| Sets font class and size. | |
| OFont * | font () const |
| Returns the font file being used. | |
| unsigned int | fontSize () const |
| Returns the font size. | |
| void | setFontColor (const OVector4 &color) |
| Set the font color using a OVector4 class object as input. More... | |
| OVector4 | fontColor () const |
| Provides the font color in the form of a four-dimensional vector. More... | |
| void | setPosition (float x, float y) |
| Sets the position of the text box. More... | |
| float | x () const |
| Returns the position of the text box on the X axis in pixels. | |
| float | y () const |
| Returns the position of the text box on the Y axis in pixels. | |
| void | setScale (float sx, float sy) |
| Sets the size of the text box. More... | |
| float | scaleX () const |
| Returns the horizontal size of the text box in pixels. | |
| float | scaleY () const |
| Returns the vertical size of the text box in pixels. | |
| void | setContent (const char *content) |
| Sets the text content of the text box. More... | |
| void | append (const char *content) |
| Adds text to the end of the text box content. More... | |
| const char * | content () const |
| Returns the content of the text box. | |
| void | render () |
| Renders the text string on the screen. | |
| void | onScreenResize (const OResizeEvent *evt) |
| Screen resize event handler. More... | |
Public Member Functions inherited from OObject | |
| OObject () | |
| Class constructor. | |
| virtual | ~OObject () |
| Class destructor. | |
| void | scheduleDelete () |
| Schedule this object for deletion at the end of an application loop. | |
| virtual void | processEvent (const OEvent *evt) |
| Main event handle. More... | |
| virtual void | onKeyboardPress (const OKeyboardPressEvent *evt) |
| Keyboard press event handler. More... | |
| virtual void | onMouseClickEvent (const OMouseClickEvent *evt) |
| Mouse click event handler. More... | |
Two-dimensional text handling class.
This class enabled the rendering of text on the screen.
| OText2D::OText2D | ( | OFont * | font, |
| unsigned int | fontSize, | ||
| float | x, | ||
| float | y, | ||
| const OVector4 & | color = OVector4(1.0f), |
||
| const char * | content = NULL |
||
| ) |
Class constructor.
| font | Object containing font definitions and cache. |
| fontSize | Font height in pixels. |
| x | Position of the beggining of the text box in the X axis. |
| y | Position of the beggining of the text box in the Y axis. |
| content | Text conte |
| void OText2D::append | ( | const char * | content | ) |
Adds text to the end of the text box content.
| content | Content to be appended to the current string. |
| OVector4 OText2D::fontColor | ( | ) | const |
Provides the font color in the form of a four-dimensional vector.
|
virtual |
Screen resize event handler.
This handler is only called if the object is set as an event recipient. By default does nothing.
| evt | Screen resize event object. |
Reimplemented from OObject.
| void OText2D::setContent | ( | const char * | content | ) |
Sets the text content of the text box.
| content | New content of the text box. |
| void OText2D::setFontColor | ( | const OVector4 & | color | ) |
Set the font color using a OVector4 class object as input.
| color | A four-dimensional vector containing the color components in the form (r, g, b, alpha). |
| void OText2D::setPosition | ( | float | x, |
| float | y | ||
| ) |
Sets the position of the text box.
| x | Position of the text box on the X axis in pixels. |
| y | Position of the text box on the Y axis in pixels. |
| void OText2D::setScale | ( | float | sx, |
| float | sy | ||
| ) |
Sets the size of the text box.
| sx | Horizontal scale of the text box. |
| sx | Vertical scale of the text box. |