The path API is the heart of Prowl.Quill. A path is an ordered collection of sub-paths, each built from straight lines, circular arcs, and Bézier curves. When your path is complete you choose how to render it —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl.Quill/llms.txt
Use this file to discover all available pages before exploring further.
Fill() for fast fan-fill, FillComplex() for tessellated self-intersecting shapes, Stroke() for outlined polylines, or FillAndStroke() for both in a single call. The API is intentionally close to the HTML5 Canvas 2D API, so the mental model will feel familiar.
Path Lifecycle
Every path follows the same lifecycle:ClosePath() (optional)
Draws a straight line from the current point back to the first point of the current sub-path, closing it.
Core Path Commands
BeginPath()
Resets all sub-paths. Always call this before starting a new shape unless you intentionally want to add sub-paths to the existing path (for holes or compound shapes).
MoveTo(x, y)
Lifts the pen and places it at (x, y) without drawing anything. Starts a new sub-path. If called before BeginPath(), it implicitly calls BeginPath() first.
LineTo(x, y)
Draws a straight line from the current position to (x, y) and updates the current position. If there is no current position, behaves like MoveTo.
ClosePath()
Connects the current point back to the first point of the current sub-path with a straight line, closing the loop. The current position becomes that first point.
Arcs
Arc
Appends a circular arc centered at (x, y) with the given radius from startAngle to endAngle, both in radians. By default the arc sweeps clockwise; pass counterclockwise: true to reverse.
MoveTo to the arc’s start position. Otherwise a straight line segment connects the current point to the arc entry.
ArcTo
Draws a circular arc tangent to both the line from the current point to (x1, y1) and the line from (x1, y1) to (x2, y2). This is the classic rounded corner primitive.
EllipticalArcTo
Appends an SVG-style elliptical arc from the current point to (x_end, y_end). This is the A command from SVG path data, implementing the full W3C algorithm including radius scaling when radii are too small.
| Parameter | Description |
|---|---|
rx, ry | X and Y radii of the ellipse |
xAxisRotationDegrees | Rotation of the ellipse’s X axis in degrees |
largeArcFlag | true → choose the larger of the two possible arcs |
sweepFlag | true → arc sweeps in positive-angle (clockwise) direction |
x_end, y_end | End point of the arc |
Bézier Curves
BezierCurveTo
Appends a cubic Bézier curve from the current point to (x, y) using two control points (cp1x, cp1y) and (cp2x, cp2y). The curve is adaptively subdivided using the Casteljau algorithm until it is within the current tessellation tolerance.
QuadraticCurveTo
Appends a quadratic Bézier curve from the current point to (x, y) with one control point (cpx, cpy). Internally Quill promotes this to a cubic Bézier using the standard degree-elevation formula:
QuadraticCurveTo is rendered by the same Casteljau subdivision as cubic curves — no separate code path, no quality difference.
Winding Mode
SetSolidity(WindingMode)
Controls which regions of a complex or self-intersecting path are considered “inside” for fill operations. This must be set before calling FillComplex() or FillComplexAA().
| Value | Description |
|---|---|
WindingMode.OddEven | A point is inside if a ray from it crosses an odd number of path segments. Classic even-odd fill rule. |
WindingMode.NonZero | A point is inside if the winding number is non-zero. Produces filled regions for most artistic shapes. |
Rendering the Path
Fill()
Fast fan-based fill suitable for convex sub-paths. Uses a center-to-edge triangle fan with UV-based shader AA. Do not use for self-intersecting or concave shapes.
FillComplex()
Tessellation-based fill using LibTess. Handles concave and self-intersecting paths with full
OddEven / NonZero winding rule support.FillComplexAA()
Same as
FillComplex() but also strokes the path with the fill color at width 1 for smooth anti-aliased edges. Recommended for most complex fills.Stroke()
Renders the path outline using the current stroke color, width, caps, and joints. Works on any path regardless of convexity.
Complete Examples
- Triangle
- Rounded Shape with Arcs
- Cubic Bézier Curve
A basic filled triangle using three
LineTo calls and FillAndStroke.