Link Search Menu Expand Document


InputField

Based on UIImageView

Description

Interactable input field view enabling user to type single or multi-line text. Based on TextMeshPro input field component.

Dependency Properties

Name Type Description
Alignment ElementAlignment Used to align the view relative to the layout parent region it resides in.
Alpha float 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.
AnimationTriggers AnimationTriggers The animation triggers for this selectable object.
AsteriskChar Char Character used for password fields.
BackgroundAlphaHitTestMinimumThreshold float Alpha values less than the threshold will cause raycast events to pass through the view.
BackgroundColor Color Background color of the view. Color values can be specified by name (Red, Blue, Coral, etc), hexcode (#aarrggbb or #rrggbb) or rgb/rgba value (“1.0,0.0,0.5” or “1,1,1,0.5”).
BackgroundFillAmount float Amount of the view shown when BackgroundType is set to Filled.
BackgroundFillCenter bool Boolean indicating if the center of a Tiled or Sliced sprite should be rendered.
BackgroundFillClockwise bool Boolean indicating if the sprite should be filled clockwise or counter-clockwise.
BackgroundFillMethod FillMethod Enum indicating the background fill method.
BackgroundFillOrigin int Point of origin of the Fill process. Value means different things with each fill method.
BackgroundIsMaskingGraphic bool Boolean indicating if image is a masking graphic.
BackgroundMaskable bool Boolean indicating if the graphic allows masking.
BackgroundMaterial Material Material used by the sprite.
BackgroundOnCullStateChanged CullStateChangedEvent Callback called when the culling state of this graphic either becomes culled or visible.
BackgroundOverrideSprite Sprite Overrides the default sprite used by this view.
BackgroundPixelsPerUnitMultiplier float Pixel per unit modifier to change how sliced sprites are generated.
BackgroundPreserveAspect bool Boolean indicating if this sprite should preserve its aspect ratio.
BackgroundRaycastTarget bool Boolean indicating if the graphic should be considered a target for raycasting.
BackgroundSprite Sprite The background sprite of the view. The value is the name of the sprite asset file without extension, e.g. “mysprite”.
BackgroundType Type Enum indicating what type of sprite the background is.
BackgroundUseSpriteMesh bool Boolean indicating if the view should use mesh generated by TextureImporter or a simple quad mesh.
BubbleNotifyChildLayoutChanged bool Boolean indicating if parent always should be notified when the child changes layout.
CaretBlinkRate float The blinking rate of the input caret in cycles per second.
CaretColor Color Color of the caret if CustomCaretColor is set.
CaretPosition int Current InputField caret position (also selection tail).
CaretWidth int Width of the caret.
CharacterLimit int How many characters the input field is limited to (0 = infinite).
CharacterValidation CharacterValidation The type of validation to perform on a character.
Colors ColorBlock The ColorBlock for this selectable object.
ContentType ContentType The type of input expected.
CustomCaretColor bool Boolean indicating if caret color is customized by CaretColor.
DisableLayoutUpdate bool Boolean indicating if automatic layout updates for this view should be disabled. When disabled the view doesn’t call UpdateLayout() when properties such as Width, Height, etc. changes.
EnableScriptEvents bool Boolean indicating if unity script events (Update, LateUpdate, Awake, etc) should be relayed to the view code-behind through the corresponding methods that can be overriden.
FontAsset TMP_FontAsset Font asset used by input field.
GameObject GameObject GameObject in the hierarchy that corresponds to the view.
Height ElementSize The height of the view in pixels or percents.
IgnoreFlip bool Used when doing localization override default behavior of flipping the view Right to Left or Left to Rigth.
IgnoreObject bool Boolean indicating if the view should be ignored. Ignored objects don’t run any load logic and don’t respond to property changed events.
Image Image Convenience function that converts the referenced Graphic to a Image, if possible.
InputType InputType Type of input expected.
InputValidator TMP_InputValidator Input validator used by the input field.
Interactable bool Boolean indicating if input field is interactable.
IsActive bool Boolean indicating if the view is active. Deactivated views deactivates corresponding game object, components, renderers and scripts.
IsRichTextEditingAllowed bool Boolean indicating if rich text editing is allowed.
IsVisible bool Boolean indicating if view is visible or hidden. Invisible views still take up space but aren’t interactable and have their alpha set to 0.
KeyboardType TouchScreenKeyboardType Enum indicating touch screen keyboard type.
LineLimit int How many lines the input field is limited to (0 = infinite).
LineType LineType Line type used by the input field.
LoadMode LoadMode Enum flags indicating when and how the view should be loaded by the framework. Can be changed when e.g. the view is to be loaded on-demand.
Margin ElementMargin Adding margins to a view changes the size of the area in which its content resides, but it does not change the width or height of the view.
MaskContent bool Boolean indicating if content of the view should be masked.
Navigation Navigation Navigation settings.
Offset ElementMargin Determines the offset of the view.
OffsetFromParent ElementMargin Offset set by a parent view. Used by views like Group to arrange children without changing their own Offset values.
OnDeselect SelectionEvent Called when input field is deselected.
OnEndEdit SubmitEvent Called when the user stops editing the input field.
OnEndTextSelection TextSelectionEvent Called when text selections ends.
OnFocusSelectAll bool Called when focused and all is selected.
OnlyTriggerValueChangedFromUI bool Boolean indicating if the ValueChanged action only should be called when the user changes the input text and not when it’s programmatically changed.
OnSelect SelectionEvent Called when input field is selected.
OnSubmit SubmitEvent Called when submit event occurs.
OnTextSelection TextSelectionEvent Called when text is selected.
OnTouchScreenKeyboardStatusChanged TouchScreenKeyboardEvent Called when touch screen keyboard status changes.
OnValidateInput OnValidateInput Called when input is validated.
OnValueChanged OnChangeEvent Called when value is changed.
OverrideHeight ElementSize Overrides regular Height value. Used to e.g. automatically size items without changing the default Height value set.
OverrideWidth ElementSize Overrides regular Width value. Used to e.g. automatically size items without changing the default Width value set.
Pivot Vector2 The pivot point of the view.
Placeholder Graphic Placeholder graphics used by the input field.
PointSize float Specifies the point size of the input field text.
Position Vector3 Directly sets the local position of the view relative to parent. Position otherwise set using the Alignment and Offset properties.
RaycastBlockMode RaycastBlockMode Enum indicating if raycasts should be blocked.
ReadOnly bool Boolean indicating if the input field is read only.
ResetOnDeActivation bool Boolean indicating if input field is reset on deactivation.
RestoreOriginalTextOnEscape bool Boolean indicating if original text should be restored when user presses escape.
RichText bool Boolean indicating if input is rich text.
Rotation Quaternion Rotation of the view.
Scale Vector3 Scale of the view.
ScrollSensitivity float Indicates the sensitivity of scrolling the input field text.
SelectionAnchorPosition int Determines the anchor position of selection.
SelectionColor Color Color of the selection.
SelectionFocusPosition int Selection focus position.
SelectionStringAnchorPosition int Selection string anchor position.
SelectionStringFocusPosition int Determines the focus position of the selection string.
SetValueOnEndEdit bool Boolean indicating if the value of the input field text should be set after the user is done editing.
ShouldHideMobileInput bool Boolean indicating if mobile input should be hidden.
ShouldHideSoftKeyboard bool Boolean indicating if soft keyboard should be hidden.
SpriteState SpriteState The sprite state of this selectable object.
StringPosition int Position of the string.
TargetGraphic Graphic Graphic that will be transitioned upon.
Text string Text of the input field.
TextComponent TMP_Text Reference to the text component.
TextMargin ElementMargin Margin of the input text.
TextViewport RectTransform Reference to the text viewport.
Transition Transition The type of transition that will be applied to the targetGraphic when the state changes.
UseFastShader bool Boolean indicating if the default UI shader should be replaced by a simpler and faster one. The faster shader does not support masking and clipping.
VerticalScrollbar Scrollbar Reference to a vertical scrollbar used by the input field.
Width ElementSize The width of the view in pixels or percents.