Use this file to discover all available pages before exploring further.
Prowl.Quill follows a path-then-paint model inspired by HTML5 Canvas and SVG: you first describe a shape using path commands, then paint it with a fill, stroke, or both. A path can contain multiple disconnected sub-paths — each started with MoveTo — and the entire collection is processed together when you call a fill or stroke method. This separation of description from painting lets you build complex, multi-contour shapes (including holes) before committing any geometry to the vertex buffer.
BeginPath clears all existing sub-paths and resets the current point. Call it whenever you want to start a completely new shape, discarding anything built up since the last BeginPath.
MoveTo lifts the “pen” and starts a new sub-path at (x, y) without drawing anything. LineTo extends the current sub-path with a straight line segment to (x, y). ClosePath draws a straight line back to the first point of the current sub-path, closing the contour — essential for filled shapes that should have no gap at the join.
If LineTo is called before any MoveTo, it behaves like MoveTo for the first point, matching HTML Canvas spec behaviour.
Fill uses a centroid-fan algorithm: it finds the geometric centre of each sub-path and fans triangles out from it to the perimeter. This is the fastest fill method and produces correct results for convex shapes (rectangles, circles, regular polygons). Avoid it for concave or self-intersecting shapes — the fan triangulation will produce visible artefacts.
// A simple convex triangle — Fill() is ideal herecanvas.BeginPath();canvas.MoveTo(100, 20);canvas.LineTo(180, 150);canvas.LineTo(20, 150);canvas.ClosePath();canvas.SetFillColor(Color32.FromArgb(255, 100, 200, 255));canvas.Fill();
public void FillComplex()
FillComplex runs the path through LibTess (a full polygon tessellator) and supports non-convex (concave) shapes, self-intersecting contours, and holes. It respects the active WindingMode (see below). Use this whenever your shape cannot be guaranteed convex.
FillComplexAA calls FillComplex and then automatically overlays a thin 1-pixel stroke in the same fill colour. The stroke uses the PolylineMesher’s AA feathering to smooth the edges of tessellated shapes. Choose this over FillComplex when pixel-perfect anti-aliased edges matter more than raw performance.
public enum WindingMode { OddEven, NonZero }public void SetSolidity(WindingMode solidity)
WindingMode controls how FillComplex determines which regions of an overlapping or multi-contour path are considered “inside”:
OddEven
A point is inside if a ray cast from it crosses an odd number of path segments. This is the default. A sub-path drawn in the opposite winding direction to the outer contour automatically punches a hole.
NonZero
A point is inside if the signed winding number of the path around it is non-zero. Use this to match SVG’s default fill-rule="nonzero" behaviour.
canvas.BeginPath();canvas.MoveTo(20, 0); // top pointcanvas.LineTo(25, 15); // right shouldercanvas.LineTo(40, 15); // right arm tipcanvas.LineTo(30, 25); // right indentcanvas.LineTo(35, 40); // right legcanvas.LineTo(20, 30); // bottom centrecanvas.LineTo(5, 40); // left legcanvas.LineTo(10, 25); // left indentcanvas.LineTo(0, 15); // left arm tipcanvas.LineTo(15, 15); // left shouldercanvas.ClosePath();canvas.SetFillColor(Color32.FromArgb(255, 100, 200, 255));canvas.SetStrokeColor(Color32.FromArgb(255, 255, 255, 255));canvas.SetStrokeWidth(1.5f);canvas.FillComplex(); // Shape is concave — use FillComplex, not Fillcanvas.Stroke();
Fill() uses a fan from the centroid and only works correctly for strictly convex shapes. If your shape is concave (any interior angle greater than 180°) or contains holes, use FillComplex() or FillComplexAA() instead.
For common shapes, Prowl.Quill provides path-building helpers that call BeginPath and set up the contour for you:
// Path-based primitives (call Fill/Stroke after)canvas.Rect(x, y, width, height);canvas.RoundedRect(x, y, width, height, radius);canvas.Circle(x, y, radius);canvas.Ellipse(x, y, rx, ry);canvas.Pie(x, y, radius, startAngle, endAngle);
There are also shader-based variants (RectFilled, RoundedRectFilled, CircleFilled, PieFilled) that bypass the path system entirely and emit pre-optimised vertex quads with built-in AA — significantly faster for static shapes.