#include <Form.h>
Public Member Functions | |
const char * | getTypeName () const |
bool | isForm () const |
void | update (float elapsedTime) |
unsigned int | draw (bool wireframe=false) |
bool | isBatchingEnabled () const |
void | setBatchingEnabled (bool enabled) |
Static Public Member Functions | |
static Form * | create (const char *url) |
static Form * | create (const char *id, Theme::Style *style, Layout::Type layoutType=Layout::LAYOUT_ABSOLUTE) |
static Form * | getForm (const char *id) |
static Control * | getActiveControl (unsigned int touchIndex=0) |
static Control * | getFocusControl () |
static void | clearFocus () |
Defines a form that is a root container that contains zero or more controls.
This can also be attached on a scene Node to support 3D forms.
static void gameplay::Form::clearFocus | ( | ) | [static] |
Removes focus from any currently focused UI control.
static Form* gameplay::Form::create | ( | const char * | url | ) | [static] |
Creates a form from a .form properties file.
url | The URL pointing to the Properties object defining the form. |
static Form* gameplay::Form::create | ( | const char * | id, |
Theme::Style * | style, | ||
Layout::Type | layoutType = Layout::LAYOUT_ABSOLUTE |
||
) | [static] |
Create a new Form.
The specified style defines the visual style for the form. If NULL is passed for the style, the default UI theme is used. All controls attached to this form will inherit the theme that contains the form's style.
id | The Form's ID. |
style | The Form's custom style (optional - may be NULL). |
layoutType | The form's layout type (optional). |
Reimplemented from gameplay::Container.
unsigned int gameplay::Form::draw | ( | bool | wireframe = false | ) | [virtual] |
Draws this form.
Implements gameplay::Drawable.
static Control* gameplay::Form::getActiveControl | ( | unsigned int | touchIndex = 0 | ) | [static] |
Returns the currently active control within the UI system.
An active control is a control that is currently pressed or hovered over. On a multi-touch system, it is possible for several controls to be active at once (one for each touch point). However, only a single control can have focus at once.
touchIndex | Optional touch point index to retrieve the active control for. |
static Control* gameplay::Form::getFocusControl | ( | ) | [static] |
Returns the current control that is in focus.
static Form* gameplay::Form::getForm | ( | const char * | id | ) | [static] |
Get a form from its ID.
id | The ID of the form to search for. |
const char* gameplay::Form::getTypeName | ( | ) | const [virtual] |
Extends ScriptTarget::getTypeName() to return the type name of this class.
Child controls should override this function to return the correct type name.
Reimplemented from gameplay::Container.
bool gameplay::Form::isBatchingEnabled | ( | ) | const |
Determines whether batching is enabled for this form.
bool gameplay::Form::isForm | ( | ) | const [virtual] |
Reimplemented from gameplay::Container.
void gameplay::Form::setBatchingEnabled | ( | bool | enabled | ) |
Turns batching on or off for this form.
By default, forms enable batching as a way to optimize performance. However, on certain complex forms that contain multiple layers of overlapping text and transparent controls, batching may cause some visual artifacts due alpha blending issues. In these cases, turning batching off usually fixes the issue at a slight performance cost.
enabled | True to enable batching (default), false otherwise. |
void gameplay::Form::update | ( | float | elapsedTime | ) | [virtual] |
Reimplemented from gameplay::Container.