An Input Field is a way to make the text of a Text Control editable. Like the other interaction controls, it’s not a visible UI(User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
See in Glossary element in itself and must be combined with one or more visual UI elements in order to be visible.
Property: | Function: | |
---|---|---|
Interactable | A boolean that determines if the Input Field can be interacted with or not. | |
Transition | TransitionsThe blend from one state to another in a state machine, such as transitioning a character from a walk to a jog animation. Transitions define how long the blend between states should take, and the conditions that activate the blend. More info See in Glossary are used to set how the input field transitions when Normal, Highlighted, Pressed or Disabled. |
|
Navigation | Properties that determine the sequence of controls. See Navigation Options. | |
TextComponent | A reference to the TextA non-interactive piece of text to the user. This can be used to provide captions or labels for other GUI controls or to display instructions or other text. More info See in Glossary element used as the contents of the Input Field |
|
Text | Starting Value. The initial text placed in the field before editing begins. | |
Character Limit | The value of the maximum number of characters that can be entered into the input field. | |
Content Type | Define the type(s) of characters that your input field accepts | |
Standard | Any character can be entered. | |
Autocorrected | The autocorrection determines whether the input tracks unknown words and suggests a more suitable replacement candidate to the user, replacing the typed text automatically unless the user explicitly overrides the action. | |
Integer Number | Allow only whole numbers to be entered. | |
Decimal Number | Allow only numbers and a single decimal point to be entered. | |
Alphanumeric | Allow both letters and numbers. Symbols cannot be entered. | |
Name | Automatically capitalizes the first letter of each word. Note that the user can circumvent the capitalization rules using the Delete key. | |
Email Address | Allows you to enter an Alphanumeric string consisting of a maximum of one @ sign. periods/baseline dots cannot be entered next to each other. | |
Password* | Conceals the characters inputed with an asterisk. Allows symbols. | |
Pin | Conceals the characters inputed with an asterisk. Only allows only whole numbers to be entered. | |
Custom | Allows you to customise the Line Type, Input Type, Keyboard Type and Character Validation. | |
Line Type | Defines how text is formatted inside the text field. | |
Single Line | Only allows text to be on a single line. | |
Multi Line Submit | Allows text to use multiple lines. Only uses a new line when needed. | |
Multi Line Newline | Allows text to use multiple lines. User can use a newline by pressing the return key. | |
Placeholder | This is an optional ‘empty’ Graphic to show that the Input Field is empty of text. Note that this ‘empty’ graphic still displays even when the Input Field is selected (that is; when there is focus on it). eg; “Enter text…”. | |
Caret Blink Rate | Defines the blink rate for the mark placed on the line to indicate a proposed insertion of text. | |
Selection Color | The background color of the selected portion of text. | |
Hide Mobile Input (iOS only) | Hides the native input field attached to the onscreen keyboard on mobile devices. Note that this only works on iOS devices. | |
Property: | Function: |
---|---|
On Value Change | A UnityEvent that is invoked when the text content of the Input Field changes. The event can send the current text content as a string type dynamic argument. |
End Edit | A UnityEvent that is invoked when the user finishes editing the text content either by submitting or by clicking somewhere that removes the focus from the Input Field. The event can send the current text content as a string type dynamic argument. |
The Input Field script can be added to any existing Text control object from the menu (Component > UI > Input Field). Having done this, you should also drag the object to the Input Field’s Text property to enable editing.
The Text property of the Text control itself will change as the user types and the value can be retrieved from a script after editing. Note that Rich Text is intentionally not supported for editable Text controls; the field will apply any Rich Text markup instantly when typed but the markup essentially “disappears” and there is no subsequent way to change or remove the styling.
InputField
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.