Logo
Effects

Soft Mask

Mask child graphics with soft edges and nested masks

Overview

Soft Mask uses a parent Graphic to mask its descendants with soft edges.

Preview

Usage

Add Soft Mask to the Graphic that defines the masking region.

Place the graphics to be masked below it in the hierarchy.

Choose whether the mask Graphic itself remains visible.


Limitations

Up to four mask levels are supported. Custom shaders (outside of Evo UI) must support the soft-mask data; adding Soft Mask does not make an unsupported material compatible.


Public API

Use SoftMask in the Evo.UI namespace.

Call Refresh() after hierarchy changes that need immediate rediscovery.

Properties

NameTypeDescription
ShowMaskGraphicboolShows the Graphic that defines the mask.
InvertMaskboolInverts the mask coverage.

Fields

NameTypeDescription
MaxMaskDepthintMaximum nested mask depth: 4.

Methods

NameParametersDescription
Refresh()NoneRefreshes child bindings and mask data.

Example

SoftMaskExample.cs
using UnityEngine;
using Evo.UI;

public class SoftMaskExample : MonoBehaviour
{
    [SerializeField] private SoftMask target;

    private void Start()
    {
        target.ShowMaskGraphic = false;
        target.InvertMask = false;
        target.Refresh();
    }
}

On this page