TextMeshProInputField

Inherits from InputField


Description

Text input using Text Mesh Pro

View Fields

NameTypeDescription
AdjustToText AdjustToTextAdjusts the input field to the text.
An enum indiciating how the input field should adjust its size to the label text.

Enum Values
NameDescription
NoneNeither width nor height should be adjusted to text.
WidthAdjust width to text.
HeightAdjust height to text.
WidthAndHeightAdjust width and height to text.
AlignmentElementAlignmentView alignment.
Used to align the view relative to the layout parent region it resides in.

Enum Values
NameDescription
CenterElement centered horizontally and vertically.
LeftElement aligned to the left horizontally and centered vertically.
TopElement aligned to the top vertically and centered horizontally.
RightElement aligned to the right horizontally and centered vertically.
BottomElement aligned to the bottom vertically and centered horizontally.
TopLeftElement aligned to the top vertically and to the left horizontally.
TopRightElement aligned to the top vertically and to the right horizontally.
BottomLeftElement aligned to the bottom vertically and to the left horizontally.
BottomRightAlement aligned to the bottom vertically and to the right horizontally.
AlphafloatAlpha value.
Can be used to adjust the alpha color of this view and all its children. E.g. used for fade in/out animations. Is separate from and different from the background color of the view as it affects the children as well.
AsteriskChar CharCharacter used for password fields.
The character used for password fields.
AutoSizeTextContainer boolIndicates if size of text container adjusts to match text object.
Indicates if size of text container adjusts to match text object.
BackgroundColor Color Background color of the view.
Background color of the view.
BackgroundImageSpriteAssetBackground image sprite.
The sprite that will be rendered.
BackgroundImageEventAlphaThreshold floatAlpha threshold for letting through events.
The alpha threshold specifying the minimum alpha a pixel must have for the event to be passed through.
BackgroundImageFillAmount floatBackground image fill amount.
Amount of the Image shown when the Image.type is set to Image.Type.Filled.
BackgroundImageFillCenter boolIndicates if center should be filled.
Boolean indicating whether or not to render the center of a Tiled or Sliced image.
BackgroundImageFillClockwise boolIndicates if the image should be filled clockwise.
Whether the Image should be filled clockwise (true) or counter-clockwise (false).
BackgroundImageFillMethod FillMethod Background image fill method.
Indicates what type of fill method should be used.

Enum Values
NameDescription
Horizontal
Vertical
Radial90
Radial180
Radial360
BackgroundImageFillOrigin intBackground image fill origin.
Controls the origin point of the Fill process. Value means different things with each fill method.
BackgroundImageMaskable boolIndicates if the image is maskable.
Indicates if the background image graphic is to be maskable.
BackgroundImageOverrideSpriteSpriteAssetBackground image override sprite.
Set an override sprite to be used for rendering. If set the override sprite is used instead of the regular image sprite.
BackgroundImagePreserveAspect boolPreserve aspect ratio.
Indicates whether this image should preserve its Sprite aspect ratio.
BackgroundImageType Type Type of background image.
The type of the image sprite that is to be rendered.

Enum Values
NameDescription
Simple
Sliced
Tiled
Filled
BackgroundMaterial Material Background image material.
Background image material.
BaseDirectorystringBase directory.
Specifies the base directory to be used by the view and its children. The base directory is used when loading resources such as sprites, fonts, etc.
BasedOnstringBased on style.
Used in style definition to specify which style it's based on.
CaretBlinkRate floatCaret blinks per second.
The blinking rate of the input caret, defined as the number of times the blink cycle occurs per second.
CaretColor Color Caret color.
The custom caret color used if customCaretColor is set.
CaretPosition intCurrent caret position.
Current InputField caret position (also selection tail).
CaretWidth intCaret width.
The width of the caret in pixels.
CharacterLimit intCharacter limit.
How many characters the input field is limited to. 0 = infinite.
CharacterSpacing floatAdditional spacing between characters.
Additional spacing between characters.
CharacterValidation CharacterValidationCharacter input validation.
The type of validation to perform on the input.

Enum Values
NameDescription
None
Integer
Decimal
Alphanumeric
Name
EmailAddress
CharacterWidthAdjustment floatPercentage of character width can be adjusted before auto-sizing reduces point size.
Percentage of character width can be adjusted before auto-sizing reduces point size.
ColorGradient VertexGradientSpecifies the colors for the four vertices of the character quads.
Specifies the colors for the four vertices of the character quads.
ColorGradientPreset TMP_ColorGradientPreset specifying the color gradient.
Preset specifying the color gradient.
ContentType ContentTypeType of input content (standard, password, etc).
Type of input field content.

Enum Values
NameDescription
Standard
Autocorrected
IntegerNumber
DecimalNumber
Alphanumeric
Name
EmailAddress
Password
Pin
Custom
EnableAdaptiveJustification boolIndicates if justification should be adaptive.
Boolean indicating if justification should be adaptive.
EnableAutoSizing boolEnables text auto-sizing.
Boolean indicating if text auto-sizing should be enabled.
EnableCulling boolEnables culling on the shaders.
Enables culling on the shaders. Note changing this value will result in an instance of the material.
EnableKerning boolIndicates if kerning is enabled.
Boolean indicating if kerning is enabled.
EnableVertexGradient boolIndicates if text vertex color gradient should be used.
Boolean indicating if text vertex color gradient should be used.
EnableWordWrapping boolIndicates if words should be wrapped.
Boolean indicating if words should be wrapped.
ExtraPadding boolIndicates if extra padding around characters should be added.
Boolean indicating if extra padding around characters should be added. This may be necessary when the displayed text is very small to prevent clipping.
FaceColor Color32 Face color property of the assigned material.
_FaceColor property of the assigned material. Changing face color will result in an instance of the material.
Font TMP_FontAssetInput field text font.
The font of the input field label.
FontColor Color Input field text font color.
The font color of the input field label.
FontMaterial Material Text font material.
Text font material.
FontMaterials Material[] Text font materials.
Text font materials.
FontSharedMaterial Material Text font shared material.
Text font shared material.
FontSharedMaterials Material[] Text font shared materials.
Text font shared materials.
FontSize floatInput field text font size.
The font size of the input field label.
FontSizeMax floatMaximum point size of font when auto-sizing is enabled.
Maximum point size of font when auto-sizing is enabled through the EnableAutoSizing field.
FontSizeMin floatMinimum point size of font when auto-sizing is enabled.
Minimum point size of font when auto-sizing is enabled through the EnableAutoSizing field.
FontStyle FontStylesInput field text font style.
The font style of the input field label.

Enum Values
NameDescription
Normal
Bold
Italic
Underline
LowerCase
UpperCase
SmallCaps
Strikethrough
Superscript
Subscript
FontWeight intWeight of the font.
Controls the weight of the font if an alternative font asset is assigned for the given weight in the font asset editor.
HeightElementSizeThe height of the view.
Specifies the height of the view either in pixels or percents.
HideFlags HideFlags Hide flags for the game object.
Bit mask that controls object destruction, saving and visibility in editor.

Enum Values
NameDescription
None
HideInHierarchy
HideInInspector
DontSaveInEditor
NotEditable
DontSaveInBuild
DontUnloadUnusedAsset
DontSave
HideAndDontSave
HorizontalMapping TextureMappingOptionsControls how face and outline textures are applied to text object.
Controls how face and outline textures are applied to text object.

Enum Values
NameDescription
Character
Line
Paragraph
MatchAspect
IdstringThe ID of the view.
Specifies a unique ID for the view. Used to map the view to reference fields on the parent view model. Provides a way to reference the view in data bindings. Is used as selectors in styles.
IgnoreVisibility boolIndicates if non-visible objects should be refreshed.
Boolean indicating if non-visible objects should be refreshed.
InputFieldComponentWrapperInputFieldComponentWrapperWrapper for the unity text component.
InputTextMargin Vector4 Margin of text object.
Margin of text object.
InputType InputTypeType of input expected.
Enum indicating what type of input is expected.

Enum Values
NameDescription
Standard
AutoCorrect
Password
IsActiveboolIndicates if the view is enabled.
Activates/deactivates the view. If set to false in this or in any parent view, all components are disabled, attached renderers are turned off, etc. Any components attached will no longer have Update() called.
IsDestroyedboolIndicates if the view has been destroyed by GameObject.Destroy().
IsDynamicboolIndicates if the view has been created dynamically.
IsInitializedboolGets or sets bool indicating if the view has been initialized.
IsOrthographic bool
IsOverlay boolIndicates if text should be rendered last on top of scene elements.
Boolean indicating if text should be rendered last on top of scene elements.
IsReadOnly boolIndicates if input field is read-only.
Boolean indicating if input field is read-only.
IsRightToLeftText boolIndicates if text goes right to left.
Boolean indicating if text goes right to left.
IsTemplateboolIndicates if this view is to be used as a template.
A template view is used to create dynamic instances of the view. Used by certain views such as the List and TabPanel.
IsVisibleboolIndicate if the view is visible.
Can be used to adjust the visiblity of the view. If set to false the view is made invisible but unlike when deactivating the view, invisible views are still is active and takes up space.
IsVolumetricText boolIndicates if geometry of characters are volumetric (cubes) rather than quads.
Indicates if geometry of characters are volumetric (cubes) rather than quads.
ItemobjectItem data.
Provides a mechanism to bind to dynamic list data. The item is set, e.g. by the List view on the child views it generates for its dynamic list data. The Item points to the list item data the view is associated with.
KeyboardType TouchScreenKeyboardType Type of touch screen keyboard.
The type of touch screen keyboard that will be used.

Enum Values
NameDescription
Default
ASCIICapable
NumbersAndPunctuation
URL
NumberPad
PhonePad
NamePhonePad
EmailAddress
NintendoNetworkAccount
LayoutRootUserInterfaceGets layout root canvas.
LineSpacing floatInput field text line spacing.
The line spacing of the input field label.
LineType LineTypeInput field line type.
Enum indicating line type of the input field.

Enum Values
NameDescription
SingleLine
MultiLineSubmit
MultiLineNewline
MarginElementMarginView margin
Determines the size of the content region relative the view's width and height. Adding margins to a view does not change its width or height.
MaxVisibleCharacters intMaximum number of characters visible.
Maximum number of characters visible.
MaxVisibleLines intMaximum number of lines visible.
Maximum number of lines visible.
MaxVisibleWords intMaximum number of words visible.
Maximum number of words visible.
OffsetElementMarginView offset.
Determines the offset of the content region relative to the view's position.
OffsetFromParentElementMarginView offset from parent.
Used by parent views to adjust the positioning of its children without affecting the internal offset of the children.
OnlyTriggerValueChangedFromUIboolIndicates that the value changed action is only to be triggered from changes made to the text in the UI.
OutlineColor Color32 Input field text outline color.
The outline color of the input field label.
OutlineDistance Vector2 Input field text outline distance.
The distance of the input field label outline.
OutlineWidth floatThickness of the font outline.
Thickness of the font outline. Setting this will result in an instance of the material.
OverflowMode TextOverflowModesSpecifies text overflow mode.
Enum specifying text overflow mode.

Enum Values
NameDescription
Overflow
Ellipsis
Masking
Truncate
ScrollRect
Page
OverrideColorTags boolIndicates if color tags should be ignored and default font color should be used.
Boolean indicating if color tags should be ignored and default font color should be used.
OverrideHeightElementSizeOverride height.
Used to override the layouting logic of inherited views and set the specified height.
OverrideWidthElementSizeOverride width.
Used to override the layouting logic of inherited views and set the specified width.
PageToDisplay intIndicates which page of the text is displayed.
Indicates which page of the text is displayed (starting at 1).
ParagraphSpacing floatAdditional spacing between paragraphs.
Additional spacing between paragraphs.
ParseCtrlCharacters boolIndicates if CTRL characters should be parsed.
Boolean indiciating if CTRL characters should be parsed.
Pivot Vector2 View pivot position.
The normalized position that the view rect transform rotates around.
Position Vector3 Position of the view.
The local position of the view in relation to the layout parent view transform.
PropagateChildLayoutChangesboolIndicates if the view propagates child layout changes.
Boolean indicating if view propagates child layout changes. Generally set to true whenever a view adjusts its size to child layout changes.
RaycastBlockModeRaycastBlockModeIndicates when raycast should be blocked.
Enum indicating when raycasts should be blocked by the view.

Enum Values
NameDescription
DefaultRaycast is blocked if view is displayed and not transparent.
AlwaysRaycast is always blocked.
NeverRaycast is never blocked.
RenderMode TextRenderFlagsIndicates if the mesh will be rendered.
Boolean indicating if the mesh will be rendered.

Enum Values
NameDescription
DontRender
Render
RichText boolIndicates if rich text tags are enabled.
Boolean indicating if rich text tags are enabled.
Rotation Quaternion Rotation of the view.
The local rotation of the view in relation to the layout parent view transform. Stored as a Quaternion but specified in XUML as euler angles.
Scale Vector3 Scale of the view.
The scale of the view in relation to the layout parent view transform.
SelectionColor Color Selection color.
The color of the highlight showing which characters are selected.
SelectionEnd intSelection end position.
Selection end position.
SelectionStart intSelection start position.
Selection start position.
SetValueOnEndEditboolIndicates if text value should be updated at end edit.
Boolean indicating if text value should be set at end edit rather than while text is being typed.
ShadowColor Color Input field text shadow color.
The shadow color of the input field label.
ShadowDistance Vector2 Input field text shadow distance.
The distance of the input field label shadow.
ShouldHideMobileInput boolIndicates if mobile input should be hidden.
Boolean indicating if mobile input should be hidden.
SortIndexintView sort index.
The sort index is used by views such as Group and List to sort its child views.
SpriteAsset TMP_SpriteAssetSprite asset used by the text object.
Sprite asset used by the text object.
StatestringView state.
View state name. Determines state values to be applied to the view. All views start out in the "Default" state and when the state changes the values associated with that state are applied to the view.
StylestringThe style of the view.
Used as selector by the styles. Specifies the name of the style that is to be applied to the view and any children that explicitly inherits its style. The style is applied when the view is created (usually in the editor as the XUML is processed).
SupportRichText boolSupports rich text.
Boolean indicating if the input field label supports rich text.
TextstringInput field text.
Text displayind in the input field. Set as text is typed or at the end of edit if SetValueOnEndEdit is set.
TextAlignment ElementAlignmentInput field text alignment.
The alignment of the text inside the input field label. Can be used with TextMargin and TextOffset to get desired positioning of the text.

Enum Values
NameDescription
CenterElement centered horizontally and vertically.
LeftElement aligned to the left horizontally and centered vertically.
TopElement aligned to the top vertically and centered horizontally.
RightElement aligned to the right horizontally and centered vertically.
BottomElement aligned to the bottom vertically and centered horizontally.
TopLeftElement aligned to the top vertically and to the left horizontally.
TopRightElement aligned to the top vertically and to the right horizontally.
BottomLeftElement aligned to the bottom vertically and to the left horizontally.
BottomRightAlement aligned to the bottom vertically and to the right horizontally.
TextAlpha floatDefault text vertex alpha value.
Default text vertex alpha value.
TextMargin ElementMarginInput field text margin.
The margin of the input field label. Can be used to adjust the text positioning.
TextMeshProOutlineColor Color32 Outline color property of the assigned material.
_OutlineColor property of the assigned material. Changing outline color will result in an instance of the material.
TextOffset ElementMarginInput field text offset.
The offset of the input field label. Can be used with TextMargin and TextAlignment to get desired positioning of the text.
ThemestringThe theme of the view.
Specifies the name of the theme that is applied to the view and its children. The theme determines which set of styles are to be considered when applying matching styles to the view.
TintAllSprites boolIndicates if sprite color is multiplies by the vertex color of the text.
Indicates if sprite color is multiplies by the vertex color of the text.
TMProAlignment TextAlignmentOptionsText alignment options.
Text alignment options.

Enum Values
NameDescription
TopLeft
Top
TopRight
TopJustified
Left
Center
Right
Justified
BottomLeft
Bottom
BottomRight
BottomJustified
BaselineLeft
Baseline
BaselineRight
BaselineJustified
MidlineLeft
Midline
MidlineRight
MidlineJustified
CaplineLeft
Capline
CaplineRight
CaplineJustified
TMProFont TMP_FontAssetText font.
Text font.
TMProFontStyle FontStylesText font style.
Text font style.

Enum Values
NameDescription
Normal
Bold
Italic
Underline
LowerCase
UpperCase
SmallCaps
Strikethrough
Superscript
Subscript
UnitSizeVector3 Unit size.
Specifies the user-defined unit size to be used by the view and its children. Used when element size is specified in user-defined units to convert it into pixels.
UpdateBackgroundboolIndicates if background is updated.
If set to false the background image and color is not updated by the view. Is used when the background updates is done elsewhere.
UpdateRectTransformboolIndicates if rect transform is updated.
If set to false the rect transform is not updated by the layout logic. It is used when layouting is done elsewhere.
UseCustomCaretColor boolIndicates if custom caret color should be used.
Boolean indicating if the custom caret color specified by CaretColor should be used.
UseMaxVisibleDescender boolIndicates if vertical alignment of text is adjusted based on visible descender of text.
Boolean indicating if vertical alignment of text is adjusted based on visible descender of text.
VerticalMapping TextureMappingOptionsControls how face and outline textures are applied to text object.
Controls how face and outline textures are applied to text object.

Enum Values
NameDescription
Character
Line
Paragraph
MatchAspect
WidthElementSizeThe width of the view.
Specifies the width of the view either in pixels or percents.
WordWrappingRatios floatControls the ratio between character and word spacing to fill-in space for justified text.
Controls the ratio between character and word spacing to fill-in space for justified text.

View Actions

NameAction DataDescription
EndEditnoneInput field end edit.
Triggered when the user stops editing the input field.
ValueChangednoneInput field value changed.
Triggered when the input field text changes. Triggered once at end edit if SetValueOnEndEdit is set.
CancelnoneCancel view action.
Triggered by the EventSystem when a cancel event occurs.
DeselectnoneDeselect view action.
Triggered by the EventSystem when another view is selected.
DropnoneDrop view action.
Triggered by the EventSystem when the view accepts a drop.
MovenoneMove view action.
Triggered by the EventSystem when a move event occurs.
ClicknoneClick view action.
Triggered by the EventSystem when the user clicks/touches on the view.
BeginDragnoneDrag view action.
Triggered by the EventSystem when the user presses mouse on and starts to drag over the view.
EndDragnoneEnd drag view action.
Triggered by the EventSystem when the user stops dragging mouse over the view.
DragnoneDrag view action.
Triggered by the EventSystem as the user drags the mouse over the view.
InitializePotentialDragnoneInitialize potential drag view action.
Triggered by the EventSystem as the user initiates a potential drag over the view.
MouseDownnoneMouse down view action.
Triggered by the EventSystem when the mouse/touch presses down over the view.
MouseEnternoneMouse enter view action.
Triggered by the EventSystem when the mouse enters the view.
MouseExitnoneMouse exit view action.
Triggered by the EventSystem when the mouse exits the view.
MouseUpnoneMouse up view action.
Triggered by the EventSystem when the mouse/thouch releases over the view.
ScrollnoneScroll view action.
Triggered by the EventSystem when the user scrolls when the view is selected.
SelectnoneSelect view action.
Triggered by the EventSystem when the view is selected.
SubmitnoneSubmit view action.
Triggered by the EventSystem when the user submits while view is selected.
UpdateSelectednoneUpdate selected view action.
Triggered by the EventSystem when the object associated with this EventTrigger is updated.
ActivatednoneActivated view action.
Triggered every time the view is activated. Also triggered once the view is intialized if it starts out activated.
DeactivatednoneDeactivated view action.
Triggered every time the view is deactivated. Also triggered once the view is intialized if it starts out deactivated.





















Join the Announcement List

Be notified when new themes, views, tutorials and updates are available