Logo
UI Elements

Input Field

Placeholder animation and submission behavior for input fields

Overview

Input Field Enhancer adds floating-placeholder motion and submission options to an input field of any text provider, such as a TextMesh Pro TMP_InputField or a UniText UniTextEditable. Text editing remains the responsibility of that field.

Preview

Usage

Create an Evo UI Input Field prefab, or add Input Field Enhancer to an object with an input field.

Assign Source and the optional Interactive reference.

Configure placeholder slide, scale, and fade.

Bind On Submit to a method accepting the entered string.


Tips

  • Use Slide Offset, Scale Multiplier, and Fade Alpha to tune the combined placeholder animation.
  • Choose whether submission clears the field or ends its selection.
  • Handle Shift Enter is TextMesh Pro only. For UniText fields, set the field's Submit Key behavior to Enter instead.

Public API

Use InputFieldEnhancer in the Evo.UI namespace.

source holds the provider's input field component. Read or set its value through TextProvider, or cast it to the provider's type (for example, TMP_InputField) to access validation, content type, and editing events.

Fields

NameTypeDescription
sourceMonoBehaviourInput field that owns the text and editing behavior, from any text provider.
clearAfterSubmitboolClears text after submission.
deselectOnEndEditboolDeselects after editing ends.
handleShiftEnterboolEnables the enhancer’s Shift+Enter handling. TextMesh Pro only.
slideOffsetVector2Placeholder movement offset.
scaleMultiplierfloatPlaceholder scale when moved.
fadeAlphafloatPlaceholder alpha when moved.

Methods

NameParametersDescription
Focus()NoneSelects and activates the input field.
SetInteractable()bool valueChanges input availability.

Events

NameTypeDescription
onSubmitUnityEvent<string>Invoked with submitted text.

Example

InputFieldEnhancerExample.cs
using UnityEngine;
using Evo.UI;

public class InputFieldEnhancerExample : MonoBehaviour
{
    [SerializeField] private InputFieldEnhancer target;

    private void Start()
    {
        TextProvider.SetValue(target.source, "Player", notify: true);
        target.onSubmit.AddListener(text => Debug.Log($"Submitted: {text}"));
        target.Focus();
    }
}

On this page