PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI Class Reference

This is a Unity GUI implementation of ITextFieldUI. More...

Inheritance diagram for PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI:
Collaboration diagram for PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI:

Public Member Functions

void Awake ()
 
void StartTextInput (string labelText, string text, int maxLength, AcceptedTextDelegate acceptedText)
 Sets up the text input controls. More...
 
void CancelTextInput ()
 Cancels the text input by hiding the controls. More...
 
void OnAccept (object data)
 This is received from the Ok/Accept button if it exists. More...
 
void OnCancel (object data)
 This is received from the Cancel button if it exists. More...
 

Public Attributes

GUIControl panel
 The (optional) panel. More...
 
GUILabel label
 The label that will contain any label text prompting the user what to enter. More...
 
GUITextField textField
 The text field. More...
 
KeyCode acceptKey = KeyCode.Return
 The accept key. More...
 
KeyCode cancelKey = KeyCode.None
 The cancel key. More...
 

Detailed Description

This is a Unity GUI implementation of ITextFieldUI.

It uses GUITextField for text input. It also supports a panel that can contain the text field and other controls such as Ok and Cancel buttons. The Ok button should send an OnAccept message to this object. The Cancel button should send OnCancel.

Member Function Documentation

◆ Awake()

void PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.Awake ( )

◆ CancelTextInput()

void PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.CancelTextInput ( )

Cancels the text input by hiding the controls.

Returns
true if this instance cancel text input; otherwise, false.

Implements PixelCrushers.DialogueSystem.ITextFieldUI.

◆ OnAccept()

void PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.OnAccept ( object  data)

This is received from the Ok/Accept button if it exists.

It simply accepts the text.

◆ OnCancel()

void PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.OnCancel ( object  data)

This is received from the Cancel button if it exists.

It cancels the input.

◆ StartTextInput()

void PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.StartTextInput ( string  labelText,
string  text,
int  maxLength,
AcceptedTextDelegate  acceptedText 
)

Sets up the text input controls.

Parameters
labelTextThe label text.
textThe current value to use for the input field.
maxLengthMax length, or 0 for unlimited.
acceptedTextThe delegate to call when accepting text.

Implements PixelCrushers.DialogueSystem.ITextFieldUI.

Member Data Documentation

◆ acceptKey

KeyCode PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.acceptKey = KeyCode.Return

The accept key.

◆ cancelKey

KeyCode PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.cancelKey = KeyCode.None

The cancel key.

◆ label

GUILabel PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.label

The label that will contain any label text prompting the user what to enter.

◆ panel

GUIControl PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.panel

The (optional) panel.

If your text field UI contains more than a label and text field, you should assign the panel, too.

◆ textField

GUITextField PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.textField

The text field.


The documentation for this class was generated from the following file: