Class: Form

Form()

Base form helper class contains utility methods for creation of UI elements - text blocks, checkboxes, text input etc. All elements share the same style defined in constructor. Every property of the form or element can be overriden with properties of passed params object. UI elements need to be named; this name is used to create a speech command that activates the element. E.g. if the element is checkbox named 'rigged', it can be (de)selected by speaking 'rigged on' or 'rigged off'. HUD delegates gamepad events to appropriate form methods, making form elements usable.

Constructor

new Form()

Source:

Classes

Form

Methods

activateCurrent()

Input delegate method used for gamepad input, or programatic control of the form. Activates currently selected control, equivalent to clicking/tapping it. E.g. (de)select a checkbox, press a button, etc.
Source:

addControl()

Add control to the panel
Source:

adjustKeyboardColumn()

Internal virtual keyboard method, keeps column index in range
Source:

checkbox()

Creates and returns a named Checkbox
Source:

createPanel()

Returns new StackPanel with 1 height and width and aligned to center both vertically and horizontally
Source:

createPlane()

Creates a plane and advanced dynamic texture to hold the panel and all controlls. At this point all UI elements should be created. TODO Form should estimate required texture width/height from elements
Source:

dispose()

Dispose of all created elements.
Source:

down()

Input delegate method used for gamepad input, or programatic control of the form. Processes down key: move down a row in virtual keyboard
Source:

getActiveControl()

Input delegate method used for gamepad input, or programatic control of the form.
Source:
Returns:
currently active control, or in the keyboard if it's active

getClassName()

Returns Form, required by HUD
Source:

getControls()

Input delegate method used for gamepad input, or programatic control of the form.
Source:
Returns:
all controls in this form, or in the keyboard if it's active

inputFocused(input, focused)

Connects the keyboard to given input, or hides it
Parameters:
Name Type Description
input InputText to (dis)connect
focused true = connect the keyboard, false = disconnect and hide
Source:

inputText(name, params)

Creates and returns a named InputText, registers this.inputFocus() as focus/blur listener
Parameters:
Name Type Description
name identifier used for speech input
params optional object to override InputText field values
Source:

isSelectableMesh()

XR selection support
Source:

keyboard()

Creates and returns a VirtualKeyboard, bound to given AdvancedDynamicTexture. A form can only have one keyboard, shared by all InputText elements. Currently selected InputText takes keyboard input.
Source:

nameToCommand()

Internal voice input method: converts a control (button,checkbox...) name (label) to voice command
Source:

noMatch()

Called by default on speech recognition mismatch
Source:

radio()

Creates and returns a named RadioButton
Source:

selectCurrent()

Internal virtual keyboard method, selects current row at given index
Source:

setActiveControl()

Input delegate method used for gamepad input, or programatic control of the form. Sets currently active control.
Source:

setupButton()

Common code for submitButton() and textButton()
Source:

submitButton()

Ceates and returns a named submit image-only Button.
Source:

textBlock()

Creates and returns a textblock with given text
Source:

textButton()

Creates and returns button showing both text and image
Source:

unselectCurrent()

Deselects current control, i.e. changes the background color
Source:

up()

Input delegate method used for gamepad input, or programatic control of the form. Processes up key: activate current element, or move up a row in virtual keyboard
Source: