Overview
The Text Field control type provides both single-line and multi-line text input functionality. Note that if you only want to display text, use a SpriteText (or "Label" control from the component menu) as the Text Field is interactive.
Class
Interactivity
You can set/retrieve the textual contents of the control by accessing its .Text property from script. Additionally, you can specify a delegate to be called when the return key is pressed, or the "Done" button is pressed on the iOS on-screen keyboard:
public UITextField txtField;        // The text field control

...

// Registers our delegate to be called when the
// player commits input to a text field:
txtField.SetCommitDelegate(MyCommitDelegate);

...

// A sample commit delegate.
// Prints a string to the console when the player
// commits input to a text field.
void MyCommitDelegate(IKeyFocusable field)
{
    Debug.Log("The player pressed the return key or the Done button!");
    Debug.Log("Here is what they typed: " + field.Content);
}
var txtField : UITextField;        // The text field control

...

// Registers our delegate to be called when the
// player commits input to a text field:
txtField.SetCommitDelegate(MyCommitDelegate);

...

// A sample commit delegate.
// Prints a string to the console when the player
// commits input to a text field.
function MyCommitDelegate(field : IKeyFocusable)
{
    Debug.Log("The player pressed the return key or the Done button!");
    Debug.Log("Here is what they typed: " + field.Content);
}
Validation
You can easily validate input to the text field, for example if you only want to allow numeric characters, etc, by using a validation delegate. A validation delegate gets called every time the contents of the text field changes. The delegate should then return the validated string which will become the new contents of the field. Use this to filter out content you don't consider valid for your text field. See below for an example:
using System.Text.RegularExpressions;

public UITextField txtField;        // The text field control

...

// Registers our delegate to be called when the
// content of the text field changes:
txtField.SetValidationDelegate(MyValidator);

...

// A sample validation delegate.
// Removes non-numeric characters
string MyValidator(UITextField field, string text)
{
    // Remove non-numeric characters:
    Regex.Replace(text,
"[^0-9]" , "");
    return text;
}
var txtField : UITextField;        // The text field control

...

// Registers our delegate to be called when the
// content of the text field changes:
txtField.SetValidationDelegate(MyValidator);

...

// A sample validation delegate.
// Removes non-numeric characters
function MyValidator(field : UITextField, text : string) : string
{
    // Remove non-numeric characters:
    return Regex.Replace(text, "[^0-9]", "");
}
Control-specific Properties
Margins
The distance in from the edges of the control that the text content will be clipped to. This is visualized in the editor as a magenta box, much like the viewable area of the Scroll List control. Note that positive values will place the margins further inward, and negative values will expand the margins outward from the edge of the control. In short, this defines where the edges of the text area are and the text will not be allowed outside of this area.

NOTE: If your text is not appearing, make sure the width and height settings of the control are set to appropriate values, or else the text will get clipped to the edges defined by the width/height settings. If your control uses no background graphic, then width and height may be 0. In this case, your text will not be visible. Either set the width and height settings to some appropriate value, or assign negative values to the margins to define a clipping area where you want the text to be clipped.
Max Length
The maximum number of characters allowed in the field.
Multiline
When false, all text entered will be displayed on a single line and clipped within the margins (see above). When true, text that hits the edge of the margins will be wrapped to the next line down, so be sure to size your margins to take multiple lines into account. However, if text extends beyond the bottom margin, the text will just be repositioned to keep the insertion point/caret visible.
Password
When set to true, all text in this control will be masked using the specified maskingCharacter.
Masking Character
Holds the character to be used to mask password text. Defaults to asterisk (*).
Caret Size
The size, in local units, of the caret sprite. This can be left at default if using pixel-perfect.
Caret Anchor
The anchor method to be used by the caret.
Caret Offset
The distance, in local units, that the caret will be offset from the insertion point (located at the lower-left corner of where the next character should appear). This defaults to 0,0,-0.1. The -0.1 on the z axis avoids the caret from getting "hidden" behind the text, so it is recommended to keep it at some similar value to this.
Show Caret On Mobile
When true, the caret will be displayed on mobile devices. This is disabled by default since, for example, the iOS keyboard has its own separate method of controlling the text insertion point, which cannot be communicated to EZ GUI, resulting in a situation where the EZ GUI caret will not be in synch with the iOS insertion point. It is recommended to keep this value at the default (unchecked).
Allow Click Caret Placement
When true, the caret/insertion point is moved to the position clicked by the user. This is ignored if there is no caret, or if the platform is a mobile device which does not support programmatic placement of the insertion point.
Type (iOS)
iOS only: This determines the type of keyboard that will be displayed when the text field is selected.
Auto Correct (iOS)
iOS only: Whether autocorrection should take place.
Alert (iOS)
iOS only: Whether the keyboard will be displayed in alert mode.
Hide Input (iOS)
iOS only: Specifies if text input field above the keyboard will be hidden when the keyboard is on screen.
Typing Sound Effect
The sound effect that will be played whenever a new character is typed.
Field Full Sound
The sound effect that will be played whenever a character is typed when the field has reached the max length.
Custom Keyboard
When set to true, the field will not respond to the hardware or OS-provided keyboards. This allows you to exclusively interface with it using a custom keyboard of your own design.
Commit On Lost Focus
When set to true, the commit delegate/method to invoke will be called when the field loses focus.
Custom Focus Event
This specifies the event that, when it occurs to the field, should be considered to give the field focus. NOTE: This only has effect when using a custom keyboard, and controls when your focus delegate is called. (See the scripting reference under SetFocusDelegate).
States
Field graphic
The is the image to be displayed behind the text field. Use this to visually frame the text.
Caret
This allows you to define the appearance of your caret: either a single-frame, or if using SpriteManager 2, it can be a complete animation.

In addition, you can cause your caret to flash (or do other neat things) by using the "Caret Flash" transition available. For example, add an element and set the Type to FadeSprite. Then set the duration to -0.5 (0.5 is how long it will take to fade, and the negative symbol is to make it repeat infinitely). Check the "PingPong" box to cause it to go back and forth. Set the Mode to FromTo, and then set the start color to full white opaque, and the end color to full white transparent (0 alpha).