TextInputBaseField<TValueType>
Abstract base class used for all text-based fields.
Read time 10 minutesLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: BaseField<T>
- Implements: IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, IMixedValueSupport, INotifyValueChanged<T>
[UxmlElement]public abstract class TextInputBaseField<TValueType> : BaseField<TValueType>, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, IMixedValueSupport, INotifyValueChanged<TValueType>
Static Fields
Value | Description |
|---|---|
| inputUssClassName | USS class name of input elements in elements of this type. |
| labelUssClassName | USS class name of labels in elements of this type. |
| multilineInputUssClassName | USS class name of multiline input elements in elements of this type. |
| placeholderUssClassName | USS class name of input elements when placeholder text is shown |
| singleLineInputUssClassName | USS class name of single line input elements in elements of this type. |
| textInputUssName | USS class name of input elements in elements of this type. |
| ussClassName | USS class name of elements of this type. |
Properties
Property | Description |
|---|---|
| autoCorrection | Determines if the touch screen keyboard auto correction is turned on or off. |
| cursorIndex | This is the cursor index in the text presented. |
| cursorPosition | The position of the text cursor inside the element. |
| doubleClickSelectsWord | Controls whether double-clicking selects the word under the mouse pointer. |
| emojiFallbackSupport | Specifies the order in which the system should look for Emoji characters when rendering text. If this setting is enabled, the global Emoji Fallback list will be searched first for characters defined as Emoji in the Unicode 14.0 standard. |
| hideMobileInput | Hides the mobile input field shown in the OS soft keyboard. |
| hideSoftKeyboard | Prevents the OS soft keyboard from opening |
| isDelayed | If set to true, the value property isn't updated until either the user presses Enter or the text field loses focus. |
| isPasswordField | Returns true if the field is used to edit a password. |
| isReadOnly | Returns true if the field is read only. |
| keyboardType | The type of mobile keyboard that will be used. |
| maskChar | The character used for masking in a password field. |
| maxLength | Maximum number of characters for the field. |
| onIsReadOnlyChanged | Calls the methods in its invocation list when _isReadOnly changes. |
| selectAllOnFocus | Controls whether the element's content is selected upon receiving focus. |
| selectAllOnMouseUp | Controls whether the element's content is selected when you mouse up for the first time. |
| selectIndex | This is the selection index in the text presented. |
| text | The value of the input field. |
| textEdition | Retrieves this Field's TextElement ITextEdition |
| textSelection | Retrieves this Field's TextElement ITextSelection |
| touchScreenKeyboard | The active touch keyboard being displayed. |
| tripleClickSelectsLine | Controls whether triple clicking selects the entire line under the mouse pointer or not. |
| verticalScrollerVisibility | Option for controlling the visibility of the vertical scroll bar in the TextInputBaseField<TValueType>. |
Methods
Method | Description |
|---|---|
| MeasureTextSize | Computes the size needed to display a text string based on element style values such as font, font-size, and word-wrap. |
| SelectAll | Selects all the text contained in the field. |
| SelectNone | Remove selection |
| SelectRange | Select text between cursorIndex and selectIndex. |
| SetValueWithoutNotify | Allow to set the value without being notified. |
| StringToValue | Converts a string to the value of the specified generic type from the subclass. |
| ValueToString | Converts a value of the specified generic type from the subclass to a string representation. |