Logo
Effects

Stroke Dash

Draw an animated dashed rectangular border

Overview

Stroke Dash draws its own dashed border as a MaskableGraphic.

Preview

Usage

Add Stroke Dash to a UI RectTransform.

Set its dimensions, border radius, and thickness.

Adjust dash length, gap, and animation speed.


Notes

  • Use Graphic color for the border tint. For dashed outlines on other shape types, use Procedural Shape’s built-in outline settings.
  • This component is the Graphic. Do not add another Image to the same GameObject to supply its rendering.

Public API

Use StrokeDash in the Evo.UI namespace.

Fields

NameTypeDescription
thicknessfloatBorder thickness.
borderRadiusfloatCorner radius.
dashLengthfloatLength of each dash.
gapLengthfloatSpace between dashes.
speedfloatDash animation speed.

Example

StrokeDashExample.cs
using UnityEngine;
using Evo.UI;

public class StrokeDashExample : MonoBehaviour
{
    [SerializeField] private StrokeDash target;

    private void Start()
    {
        target.thickness = 3f;
        target.dashLength = 16f;
        target.gapLength = 8f;
        target.speed = 20f;
    }
}

On this page