Skip to content

Path

interludesoftware.tick

Interlude.Tick

Path Class

Fluent path builder. Accumulates a closed polygonal outline with optional per-vertex corner rounding. Pass to FillPath(Path, Color) for rendering via the EarClip triangulator.

Example:

var path = new Path()
    .LineTo(new Vector2(0, 0))
    .CornerTo(new Vector2(100, 0), 8.0f)
    .CornerTo(new Vector2(100, 100), 8.0f)
    .CornerTo(new Vector2(0, 100), 8.0f)
    .Close();
ui.FillPath(path, Color.red);

Reuse a single instance across frames by calling Clear() between builds to avoid re-allocating the backing list.

public class Path

Inheritance System.Object → Path

Properties

Path.IsClosed Property

True if Close() has been called.

public bool IsClosed { get; }

Property Value

System.Boolean

Path.VertexCount Property

Number of corner vertices currently in the path.

public int VertexCount { get; }

Property Value

System.Int32

Methods

Path.Clear() Method

Resets the path so the instance can be reused without reallocating.

public Interlude.Tick.Path Clear();

Returns

Path

Path.Close() Method

Marks the path as closed. Rendering joins the last vertex back to the first.

public Interlude.Tick.Path Close();

Returns

Path

Path.CornerTo(float, float, float) Method

Convenience: rounded corner with explicit x/y.

public Interlude.Tick.Path CornerTo(float x, float y, float radius);

Parameters

x System.Single

y System.Single

radius System.Single

Returns

Path

Path.CornerTo(Vector2, float) Method

Appends a rounded corner at p with the given radius. The radius is clamped at render time to half the shorter adjacent edge so arcs from neighbouring corners never overlap.

public Interlude.Tick.Path CornerTo(Vector2 p, float radius);

Parameters

p UnityEngine.Vector2

radius System.Single

Returns

Path

Path.LineTo(float, float) Method

Convenience: same as LineTo(Vector2) with explicit x/y.

public Interlude.Tick.Path LineTo(float x, float y);

Parameters

x System.Single

y System.Single

Returns

Path

Path.LineTo(Vector2) Method

Appends a sharp (un-rounded) vertex to the path.

public Interlude.Tick.Path LineTo(Vector2 p);

Parameters

p UnityEngine.Vector2

Returns

Path