This is a Unity GUI implementation of ITextFieldUI. More...
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... | |
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.
void PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.Awake | ( | ) |
void PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.CancelTextInput | ( | ) |
Cancels the text input by hiding the controls.
true
if this instance cancel text input; otherwise, false
.Implements PixelCrushers.DialogueSystem.ITextFieldUI.
void PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.OnAccept | ( | object | data | ) |
This is received from the Ok/Accept button if it exists.
It simply accepts the text.
void PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.OnCancel | ( | object | data | ) |
This is received from the Cancel button if it exists.
It cancels the input.
void PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.StartTextInput | ( | string | labelText, |
string | text, | ||
int | maxLength, | ||
AcceptedTextDelegate | acceptedText | ||
) |
Sets up the text input controls.
labelText | The label text. |
text | The current value to use for the input field. |
maxLength | Max length, or 0 for unlimited. |
acceptedText | The delegate to call when accepting text. |
Implements PixelCrushers.DialogueSystem.ITextFieldUI.
KeyCode PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.acceptKey = KeyCode.Return |
The accept key.
KeyCode PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.cancelKey = KeyCode.None |
The cancel key.
GUILabel PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.label |
The label that will contain any label text prompting the user what to enter.
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.
GUITextField PixelCrushers.DialogueSystem.UnityGUI.UnityTextFieldUI.textField |
The text field.