Unity 3D Input Field control

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.

image


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.

image


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:
  • Standard: Allow any character to be input, as long as it is supported by the current font.

  • Autocorrected: Automatically correct the input unknown words and suggest more suitable replacement candidates. Unless the user explicitly overrides the operation, the input text will be automatically replaced.

  • Integer Number: Only integers are allowed.

  • Decimal Number: Allows input of integers or decimals.

  • Alpha numeric: Allows input of numbers and letters.

  • Name: English and other characters are allowed, and the spelling of the name can be automatically prompted when the person is input in English.

  • Email Address: It is allowed to input an alphanumeric string consisting of at most one @ symbol.

  • Password: The entered characters are hidden and only 7K asterisks are displayed.

  • Pin: Only integers are allowed. The entered characters are hidden and only asterisks are displayed.

  • Custom: Allow users to customize line type, input type, keyboard type and character verification

Line Type Set the line break method when the input content exceeds the boundary of the input field:
  • Single Line: Do not wrap the line beyond the boundary, continue to extend this line to the right, that is, the content in the input field is only one line

  • Muhi Line Submit: Allow text to wrap. Wrap lines only when needed.

  • Multi Line Newline: Allow text to wrap. The user can press the enter key to wrap

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.

image


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



image


Guess you like

Origin blog.51cto.com/15065850/2580924