Logo
Effects

Ripple

A quick expanding and fading ripple effect for UI interactions

Overview

Ripple creates a custom shaped expanding ripple when interacting with UI elements. The effect mimics modern material style feedback and works on pointer clicks and submit actions. Ripples are instantiated at runtime, scale outward, fade, and then self destroy.

Preview

Usage

Add Ripple component to any UI object

Set Create On Click or Create On Submit depending on interaction

Optionally set a Ripple Parent to control where the effect spawns in the hierarchy

The component will automatically create a ripple effect on click


Properties

Preset

NameTypeDescription
shapeSpriteRipple image shape
colorColorRipple color including alpha
centeredboolIf true, ripple spawns at element center rather than pointer position
durationfloatTime for the ripple animation
sizefloatExpansion scale multiplier

Settings

NameTypeDescription
createOnClickboolCreates ripple on pointer click
createOnSubmitboolCreates ripple on submit (keyboard, controller, etc.)
rippleParentTransformParent where the ripple instance will be created

Static Methods

NameParametersDescription
Create(preset, parent, manageParent, forceCentered)Preset, Transform, bool, boolSpawns a ripple under a given parent. forceCentered overrides preset.centered

Code Example

RippleExample.cs
using UnityEngine;
using Evo.UI;

public class RippleExample : MonoBehaviour
{
    public Ripple ripple;

    void Start()
    {
        // Customize preset
        ripple.preset.shape = someSprite;                     // Your circular or custom ripple sprite
        ripple.preset.color = new Color(1f, 1f, 1f, 0.3f);    // White with softer alpha
        ripple.preset.centered = false;                       // Spawn at pointer by default

        ripple.preset.duration = 0.45f;                       // Ripple lifetime
        ripple.preset.size = 7f;                              // Expansion scale

        // Interaction settings
        ripple.createOnClick = true;                          // Create on pointer down
        ripple.createOnSubmit = false;                        // Create on keyboard submit
    }

    // Manual ripple creation (for example when interacting by script)
    public void SpawnCustomRipple(Transform target)
    {
        Ripple.Create(ripple.preset, target);
    }

    // Force a ripple to spawn centered
    public void SpawnCenteredRipple(Transform target)
    {
        Ripple.Create(ripple.preset, target, false, true);
    }
}

On this page