Class TextInputBaseField<TValueType>.TextInputBase
This is the input text base class visual representation.
Inheritance
TextInputBaseField<TValueType>.TextInputBase
Inherited Members
Namespace: UnityEngine.UIElements
Syntax
protected abstract class TextInputBase : VisualElement, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, ITextInputField, IEventHandler, ITextElement
Properties
cursorColor
Color of the cursor.
Declaration
public Color cursorColor { get; }
Property Value
Type | Description |
---|---|
Color |
cursorIndex
This is the cursor index in the text presented.
Declaration
public int cursorIndex { get; }
Property Value
Type | Description |
---|---|
Int32 |
doubleClickSelectsWord
Indicates if a double click selects or not a word.
Declaration
public bool doubleClickSelectsWord { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
isPasswordField
Returns true if the field is used to edit a password.
Declaration
public virtual bool isPasswordField { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
isReadOnly
Returns true if the field is read only.
Declaration
public bool isReadOnly { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
maskChar
The character used for masking in a password field.
Declaration
public char maskChar { get; set; }
Property Value
Type | Description |
---|---|
Char |
maxLength
Maximum number of characters for the field.
Declaration
public int maxLength { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
selectIndex
This is the selection index in the text presented.
Declaration
public int selectIndex { get; }
Property Value
Type | Description |
---|---|
Int32 |
selectionColor
Background color of selected text.
Declaration
public Color selectionColor { get; }
Property Value
Type | Description |
---|---|
Color |
text
The value of the input field.
Declaration
public string text { get; set; }
Property Value
Type | Description |
---|---|
String |
tripleClickSelectsLine
Indicates if a double click selects or not a line.
Declaration
public bool tripleClickSelectsLine { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
BuildContextualMenu(ContextualMenuPopulateEvent)
Called to construct a menu to show different options.
Declaration
protected virtual void BuildContextualMenu(ContextualMenuPopulateEvent evt)
Parameters
Type | Name | Description |
---|---|---|
ContextualMenuPopulateEvent | evt |
DoMeasure(Single, VisualElement.MeasureMode, Single, VisualElement.MeasureMode)
Declaration
protected override Vector2 DoMeasure(float desiredWidth, VisualElement.MeasureMode widthMode, float desiredHeight, VisualElement.MeasureMode heightMode)
Parameters
Type | Name | Description |
---|---|---|
Single | desiredWidth | |
VisualElement.MeasureMode | widthMode | |
Single | desiredHeight | |
VisualElement.MeasureMode | heightMode |
Returns
Type | Description |
---|---|
Vector2 |
Overrides
ExecuteDefaultAction(EventBase)
Declaration
protected override void ExecuteDefaultAction(EventBase evt)
Parameters
Type | Name | Description |
---|---|---|
EventBase | evt |
Overrides
ExecuteDefaultActionAtTarget(EventBase)
Declaration
protected override void ExecuteDefaultActionAtTarget(EventBase evt)
Parameters
Type | Name | Description |
---|---|---|
EventBase | evt |
Overrides
ResetValueAndText()
Resets the text contained in the field.
Declaration
public void ResetValueAndText()
SelectAll()
Selects all the text contained in the field.
Declaration
public void SelectAll()
StringToValue(String)
Converts a string to a value type.
Declaration
protected virtual TValueType StringToValue(string str)
Parameters
Type | Name | Description |
---|---|---|
String | str | The string to convert. |
Returns
Type | Description |
---|---|
TValueType | The value parsed from the string. |