Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TextInputBaseField<TValueType>

Abstract base class used for all text-based fields.
Read time 10 minutesLast updated 4 days ago

Definition

[UxmlElement]public abstract class TextInputBaseField<TValueType> : BaseField<TValueType>, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, IMixedValueSupport, INotifyValueChanged<TValueType>

Static Fields

Value

Description

inputUssClassNameUSS class name of input elements in elements of this type.
labelUssClassNameUSS class name of labels in elements of this type.
multilineInputUssClassNameUSS class name of multiline input elements in elements of this type.
placeholderUssClassNameUSS class name of input elements when placeholder text is shown
singleLineInputUssClassNameUSS class name of single line input elements in elements of this type.
textInputUssNameUSS class name of input elements in elements of this type.
ussClassNameUSS class name of elements of this type.

Properties

Property

Description

autoCorrectionDetermines if the touch screen keyboard auto correction is turned on or off.
cursorIndexThis is the cursor index in the text presented.
cursorPositionThe position of the text cursor inside the element.
doubleClickSelectsWordControls whether double-clicking selects the word under the mouse pointer.
emojiFallbackSupportSpecifies 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.
hideMobileInputHides the mobile input field shown in the OS soft keyboard.
hideSoftKeyboardPrevents the OS soft keyboard from opening
isDelayedIf set to true, the value property isn't updated until either the user presses Enter or the text field loses focus.
isPasswordFieldReturns true if the field is used to edit a password.
isReadOnlyReturns true if the field is read only.
keyboardTypeThe type of mobile keyboard that will be used.
maskCharThe character used for masking in a password field.
maxLengthMaximum number of characters for the field.
onIsReadOnlyChangedCalls the methods in its invocation list when _isReadOnly changes.
selectAllOnFocusControls whether the element's content is selected upon receiving focus.
selectAllOnMouseUpControls whether the element's content is selected when you mouse up for the first time.
selectIndexThis is the selection index in the text presented.
textThe value of the input field.
textEditionRetrieves this Field's TextElement ITextEdition
textSelectionRetrieves this Field's TextElement ITextSelection
touchScreenKeyboardThe active touch keyboard being displayed.
tripleClickSelectsLineControls whether triple clicking selects the entire line under the mouse pointer or not.
verticalScrollerVisibilityOption for controlling the visibility of the vertical scroll bar in the TextInputBaseField<TValueType>.

Methods

Method

Description

MeasureTextSizeComputes the size needed to display a text string based on element style values such as font, font-size, and word-wrap.
SelectAllSelects all the text contained in the field.
SelectNoneRemove selection
SelectRangeSelect text between cursorIndex and selectIndex.
SetValueWithoutNotifyAllow to set the value without being notified.
StringToValueConverts a string to the value of the specified generic type from the subclass.
ValueToStringConverts a value of the specified generic type from the subclass to a string representation.

Inheritance

Inherited Members