Logo
Effects

Spotlight

Follow the pointer with a soft light inside a Graphic

Overview

Spotlight adds a soft pointer-following light clipped by the target Graphic.

Preview

Usage

Add Spotlight or enable Spotlight in Interactive.

Assign an Image, RawImage, or Procedural Shape as the target.

Choose Hover Only or Always visibility.

Adjust radius, softness, and opacity.


Customization

  • Follow Duration smooths movement; zero follows immediately.
  • Fade-in and fade-out durations control visibility changes.
  • The light’s radius is measured in the target’s local UI units.
  • Ignore Graphic Alpha keeps the light at its own opacity when the graphic is translucent or fully transparent. The sprite or Procedural Shape outline still clips it, and Canvas Groups and masks still apply.

Public API

Use Spotlight in the Evo.UI namespace.

Fields

NameTypeDescription
spotlightSettingsSettings object for the target, color, radius, and timing.

Methods

NameParametersDescription
Show()PointerEventData eventData = nullShows at a pointer event position; null follows the global pointer.
Hide()NoneFades the light out.

Settings

Spotlight.Settings exposes enabled, targetGraphic, visibility, color, ignoreGraphicAlpha, radius, softness, followDuration, fadeInDuration, and fadeOutDuration. Visibility is HoverOnly or Always.

Example

SpotlightExample.cs
using UnityEngine;
using Evo.UI;

public class SpotlightExample : MonoBehaviour
{
    [SerializeField] private Spotlight target;

    private void Start()
    {
        target.spotlight.radius = 120f;
        target.spotlight.followDuration = 0.08f;
        target.spotlight.color = new Color(0.5f, 0.8f, 1f, 0.15f);
    }
}

On this page