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.
Inheritance System.Object → Path
Properties¶
Path.IsClosed Property¶
True if Close() has been called.
Property Value¶
Path.VertexCount Property¶
Number of corner vertices currently in the path.
Property Value¶
Methods¶
Path.Clear() Method¶
Resets the path so the instance can be reused without reallocating.
Returns¶
Path.Close() Method¶
Marks the path as closed. Rendering joins the last vertex back to the first.
Returns¶
Path.CornerTo(float, float, float) Method¶
Convenience: rounded corner with explicit x/y.
Parameters¶
radius System.Single
Returns¶
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.
Parameters¶
radius System.Single
Returns¶
Path.LineTo(float, float) Method¶
Convenience: same as LineTo(Vector2) with explicit x/y.
Parameters¶
Returns¶
Path.LineTo(Vector2) Method¶
Appends a sharp (un-rounded) vertex to the path.