The Unity 3D Input Field control is also a composite control, including two sub-controls, Placeholder and Text, as shown in the figure below.
Among them, Text is a text control, and the content input by the user when the program is running is saved in the Text control, and Placeholder is a placeholder, which means the prompt information displayed to the user when the program is running when the user has not input content.
Input Field The input field component is the same as other controls. It also has an Image (Script) component. It also includes a Transition property. The default is Color Tint, as shown in the figure below. The specific properties are shown in the table below.
Parameter | Features |
---|---|
Interactable | Set whether to enable the Input Field component. Tick it means the input field can be interactive, otherwise it means it cannot be interactive |
Transition | Set the conversion effect of the input field when it is normally displayed, highlighted, pressed or disabled |
Navigation | Set navigation function |
Text Component | Set the text display component of this input field to display the text box input by the user |
Text | Set the initial value of this input field |
Character Limit | Set the maximum number of input characters for this input field, 0 means unlimited input characters |
Content Type | Enter the content type of this input field, including numbers, passwords, etc. The commonly used types are as follows:
|
Line Type | Set the line break method when the input content exceeds the boundary of the input field:
|
Placeholder | Set the input position control symbol of this input field, this can be set for any object with Text component |
In addition, it has an important Content Type (content type) attribute, as shown in the figure below, and its parameters are shown in the table below.
Parameter | Features | Parameter | Features |
---|---|---|---|
Standard | standard | Name | Personal name |
Autocorrected | Automatic correction | Email Address | mailbox |
Integer Number | Integer | Password | password |
Decimal Number | Decimal fraction | Pin | fixed |
Alphanumeric | letter and number | Custom | Customized |