Q::TextLayer Struct Reference
[User Interface]
On screen text.
More...
#include <Q/q.h>
Inheritance diagram for Q::TextLayer:
List of all members.
Detailed Description
On screen text.
A TextLayer renders a text string with a given size and color. The background of the text is transparent. The layer can contain multiple lines of text simply by including newline characters in the string. The text can be left, right or center justified within its extent rectangle. The extent rectangle for a text layer is not set explicitly - it is calculated by measuring the extent of the given string when rendered in the text font.
If alwaysTop is set true, the layer is treated in a special way by the screen. It will always be rendered last (i.e. appear on top). The alwaysTop layer will receive a copy of all mouse and keyboard events after they have been sent to the layer(s) that has(have) the mouse and keyboard focus (except MouseFocus and KeyboardFocus events).
Constructor & Destructor Documentation
| Q::TextLayer::TextLayer |
( |
|
) |
|
|
|
|
Create a null text layer handle. |
|
|
Destroy the layer, removing it from its parent screen. |
Member Function Documentation
|
|
If the object referenced by obj is a textlayer, then return a suitable reference to the object. |
| ClassType Q::TextLayer::classType |
( |
|
) |
[static] |
|
|
|
Return the type of this class. |
|
|
Return the color of the layer. |
|
|
Create a text layer with the given dimensions and position. The specified font is used to render the text. The text displayed by the layer is determined by s and color. The value of pointSize is the height of an individual character of text in the screen's virtual coordinate system. Note that the layer takes a copy of the text pointed to by s. The text inside the layer is offset from the edge of the layer by the margin.
- Parameters:
-
| justification | The justification to use for the text. This has most meaning for multi-line text, as a single line of text will define the layer extent and so there is no justification to be done. |
| center | The center of the layer. It determines the location of the rectangle in the screen's virtual coordinate system. |
| alignment | The alignment of the layer. It determines the location of the origin of the layer's local coordinate system. An alignment of (0,0) places the origin at the bottom left of the layer and an alignment of (1,1) places it at the top right. |
| isAlwaysTop | If true, the layer is treated in a special way by the screen. It will always be rendered last (i.e. appear on top). |
|
| Font Q::TextLayer::font |
( |
|
) |
const |
|
|
|
Return the font used to render the text. |
|
|
Return the justification of the text. |
| unsigned int Q::TextLayer::pointSize |
( |
|
) |
const |
|
|
|
Return the point size of the text. |
|
|
Set the color of the layer. |
|
|
Set the justification of the text. |
| Utils::Result Q::TextLayer::setPointSize |
( |
unsigned int |
pointSize |
) |
|
|
|
|
Set the point size of the text. |
|
|
Set the text contents of the layer. |
| Text Q::TextLayer::text |
( |
|
) |
const |
|
|
|
Return the text contents of the layer. |