Every drawing operation in Prowl.Quill reads from a mutable draw state object. The state bundles fill color, stroke style, active brush, scissor rectangle, and transform into a single unit that can be saved and restored atomically. Understanding state management is key to writing correct, efficient rendering code: the canvas batches draw calls together whenever the state hash is identical, so minimising unnecessary state changes directly reduces draw call count.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.
Save and Restore
The state stack lets you apply temporary changes — a transform, a clip rectangle, a gradient brush — and then revert cleanly without manually tracking every property you touched.SaveState
RestoreState
ResetState
BeginFrame.
| Property | Default |
|---|---|
| Stroke color | Black (#000000FF) |
| Fill color | Black (#000000FF) |
| Stroke width | 1.0 |
| Stroke scale | 1.0 |
| Joint style | Bevel |
| Start/end cap | Butt |
| Miter limit | 4.0 |
| Tessellation tolerance | 0.5 |
| Rounding min distance | 3.0 |
| Winding mode | OddEven |
| Scissor | Disabled |
| Brush type | None (solid color) |
Fill
SetFillColor
Fill(), FillComplex(), FillComplexAA(), and all filled primitive methods when no gradient brush is active.
SetGlobalAlpha
Stroke
SetStrokeColor
Stroke() and FillAndStroke().
SetStrokeWidth
SetStrokeScale
(strokeWidth × strokeScale) × FramebufferScale.
SetStrokeJoint
JointStyle | Description |
|---|---|
Bevel | Flat edge connecting the outer corners (default). |
Miter | Sharp extension of outer edges until they meet. Falls back to bevel when the miter length exceeds the miter limit. |
Round | Circular arc connecting the outer edges. |
SetStrokeCap
SetStrokeStartCap / SetStrokeEndCap
EndCapStyle | Description |
|---|---|
Butt | No cap; stroke ends exactly at the endpoint (default). |
Square | Square cap extending by half the stroke width beyond the endpoint. |
Round | Semicircular cap with radius equal to half the stroke width. |
Bevel | Triangular beveled cap. |
SetMiterLimit
JointStyle.Miter is active, joints whose miter length exceeds limit × strokeWidth fall back to bevel. The default of 4 matches the SVG specification.
SetTessellationTolerance
SetRoundingMinDistance
Dash Patterns
SetStrokeDash
Stroke() calls. The pattern is a flat list of alternating dash and gap lengths in logical units: [dash1, gap1, dash2, gap2, ...]. If the list has an odd number of elements it is duplicated and concatenated to make it even, matching SVG behaviour.
Alternating dash and gap lengths. Pass
null or an empty list for a solid line.Phase offset into the dash pattern at path start, in logical units.
ClearStrokeDash
Scissor Clipping
The scissor rectangle clips all geometry to an axis-aligned rectangular region. Unlike many APIs, Prowl.Quill’s scissor is transform-aware: it is stored in the coordinate space of the current transform at the timeScissor() is called.
Scissor
IntersectScissor
Scissor().
ResetScissor
Gradient Brushes
Brushes override solid fill color with gradient or pattern fills. When a brush is active, its colors replaceSetFillColor for all filled shapes.
SetLinearBrush
(x1, y1) to (x2, y2). Colors are premultiplied-alpha encoded internally.
Start point of the gradient in logical units.
End point of the gradient in logical units.
Color at the start point.
Color at the end point.
SetRadialBrush
(centerX, centerY). The innerColor fills from the origin to innerRadius; the gradient feathers to outerColor by outerRadius.
Center of the gradient in logical units.
Radius at which the inner color ends.
Radius at which the outer color begins.
Color at the center.
Color at the outer edge.
SetBoxBrush
innerColor fills a rounded rectangle of size width × height centred at (centerX, centerY) with corner radius radi; the transition to outerColor is spread over feather logical units.
Corner radius of the inner box.
Softness of the box edge in logical units. Larger values produce a more blurred transition.
ClearBrush
SetFillColor color.
Texture Brush
A texture brush maps an image onto filled shapes using world-space UV coordinates.SetBrushTexture
texture is non-null and no explicit SetBrushTextureTransform has been called, a default transform is computed so that one logical unit maps to one texel.
SetBrushTextureTransform
ClearBrushTexture
Backdrop Blur
Backdrop blur turns any filled shape into a frosted-glass panel by blending the shape’s fill over a blurred copy of the framebuffer content behind it.SetBackdropBlur
radius is the blur radius in physical pixels. A translucent fill tints the blurred background; a fully opaque fill completely obscures it. Backends that do not support backdrop blur draw the fill normally.
ClearBackdropBlur
radius set to 0).
Custom Shaders
Custom shaders allow backend-specific shader programs to be bound for individual draw calls. When a shader is active, the default Prowl.Quill uniforms are not set — the application is responsible for supplying all required uniforms.SetCustomShader
null to revert to the default shader.
SetShaderUniform
float, int, Float2, Float3, Float4, Float4x4.