overview wiki api reference download
 All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Static Public Member Functions
gameplay::Form Class Reference

#include <Form.h>

Inheritance diagram for gameplay::Form:
gameplay::Drawable gameplay::Container gameplay::Control gameplay::Ref gameplay::AnimationTarget gameplay::ScriptTarget

List of all members.

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 Formcreate (const char *url)
static Formcreate (const char *id, Theme::Style *style, Layout::Type layoutType=Layout::LAYOUT_ABSOLUTE)
static FormgetForm (const char *id)
static ControlgetActiveControl (unsigned int touchIndex=0)
static ControlgetFocusControl ()
static void clearFocus ()

Detailed Description

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.

See also:

Member Function Documentation

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.

urlThe URL pointing to the Properties object defining the form.
The new form or NULL if there was an error.
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.

idThe Form's ID.
styleThe Form's custom style (optional - may be NULL).
layoutTypeThe form's layout type (optional).
The new Form.

Reimplemented from gameplay::Container.

unsigned int gameplay::Form::draw ( bool  wireframe = false) [virtual]

Draws this form.

The nubmer of draw calls issued to draw the 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.

touchIndexOptional touch point index to retrieve the active control for.
The currently active control, or NULL if no controls are currently active.

Returns the current control that is in focus.

The current control in focus, or NULL if no controls are in focus.
static Form* gameplay::Form::getForm ( const char *  id) [static]

Get a form from its ID.

idThe ID of the form to search for.
A form with the given ID, or null if one was not found.
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.

The type name of this class: "Form"
See also:

Reimplemented from gameplay::Container.

Determines whether batching is enabled for this form.

True if batching is enabled for this form, false otherwise.
bool gameplay::Form::isForm ( ) const [virtual]
See also:

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.

enabledTrue to enable batching (default), false otherwise.
void gameplay::Form::update ( float  elapsedTime) [virtual]
See also:

Reimplemented from gameplay::Container.

 All Classes Functions Variables Typedefs Enumerations Enumerator