PowerQuest 0.20.6
Loading...
Searching...
No Matches
ITextField Interface Reference

Detailed Description

Gui Text Field - Text fields allow users to type in a string on their keyboard.

    Display: You typed in {TextField.FullName.Text}         
    TextField.Parser.HasKeyboardFocus = true;

Inherits IGuiControl.

Properties

new string Description [get, set]
 Gets/Sets the description text shown to players when they hover the mouse over the control.
 
new string Cursor [get, set]
 Gets or sets the cursor to show when hovering over the object. If empty, default active cursor will be used.
 
new string Text [get, set]
 Gets/Sets the current text in the text field.
 
bool Clickable [get, set]
 Gets or Sets whether clicking on the object triggers an event.
 
- Properties inherited from IGuiControl
MonoBehaviour Instance [get]
 Access to the actual game object component in the scene. Note that controls themselves can be cast to their component type if known.
 
bool Visible [get, set]
 Sets the control visible invisible the control.
 
Vector2 Position [get, set]
 Gets/Sets the position of the control. Note that this will be overridden if using AlignTo or FitTo component.
 
bool Focused [get]
 Gets/Sets whether this control is focused (ie: the mouse is hovering over it, or it's selected with keyboard)
 
bool HasKeyboardFocus [get, set]
 Gets/Sets whether this control has the current keyboard focus (can also be used for specifying which control has 'controller' focus)
 
string Anim [get, set]
 Gets/Sets the Sprite (or animation) for the control. (if applicable). Note, that by default gui Image controls may not have a "Power Sprite Animation" component, and this needs to be added for them to play animations.
 
Color Color [get, set]
 Gets/Sets the color for the control (if applicable)
 

Public Member Functions

void FocusKeyboard ()
 Causes the TextField to become the focus for keyboard input. When focused, any keys typed will be typed into the text field until the return key is pressed.
 
- Public Member Functions inherited from IGuiControl
void Show ()
 Shows the control.
 
void Hide ()
 Hides the control.
 
void SetPosition (float x, float y)
 Sets the position of the control. Note that this will be overridden if using AlignTo or FitTo component.
 
GuiControl DuplicateControl (string name=null, IGuiControl parent=null)
 Duplicates the control. Useful for adding elements dynamically to a gui. You can optionally specify a new name for the control, and a parent object (such as a grid container)
 

Property Documentation

◆ Description

new string Description
getset

Gets/Sets the description text shown to players when they hover the mouse over the control.

Implements IGuiControl.

◆ Cursor

new string Cursor
getset

Gets or sets the cursor to show when hovering over the object. If empty, default active cursor will be used.

Implements IGuiControl.

◆ Text

new string Text
getset

Gets/Sets the current text in the text field.

Eg. TextFields.FullName.Text = "Enter thy name";

if ( TextFields.Code.Text = "1234" ) Display: Correct code!

Implements IGuiControl.

◆ Clickable

bool Clickable
getset

Gets or Sets whether clicking on the object triggers an event.

Member Function Documentation

◆ FocusKeyboard()

void FocusKeyboard ( )

Causes the TextField to become the focus for keyboard input. When focused, any keys typed will be typed into the text field until the return key is pressed.