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.
Canvas is the central object of Prowl.Quill. Every drawing operation — paths, shapes, images, text — flows through a single Canvas instance bound to a backend renderer. The canvas operates in logical units: all coordinates you pass are device-independent, and the canvas converts them to physical pixels using FramebufferScale before emitting vertices. This makes HiDPI displays transparent to application code.
Constructor
ICanvasRenderer and manages the GPU-side texture and draw-call submission. fontAtlasSettings controls how the font atlas is created for text rendering.
The renderer backend implementation. Throws
ArgumentNullException when null.Configuration for the font glyph atlas — atlas dimensions, padding, and rasterisation options.
Frame Lifecycle
Prowl.Quill uses an explicit per-frame model. You begin a frame, issue drawing calls, then flush the accumulated geometry to the GPU in a singleRender() call.
BeginFrame
Call
BeginFrame(width, height, framebufferScale) at the start of every frame. This clears all accumulated geometry and resets canvas state to defaults.Draw operations
Issue any combination of path, shape, image, or text drawing calls. State changes (color, transform, scissor, brush) take effect immediately and are preserved across calls until changed or until the next
BeginFrame.BeginFrame
Canvas width in logical units (typically the window width in CSS/logical pixels).
Canvas height in logical units.
Ratio of physical pixels to logical pixels. Pass
2.0 for Retina / HiDPI displays.
Throws ArgumentOutOfRangeException when <= 0.Render
Dispose
Properties
| Property | Type | Description |
|---|---|---|
Width | float | Canvas width in logical units (framebuffer width / FramebufferScale). |
Height | float | Canvas height in logical units. |
FramebufferScale | float | Physical pixels per logical pixel, set by BeginFrame. |
PixelFraction | float | Size of one physical pixel in logical units (1 / FramebufferScale). |
Text | TextRenderer | Exposes the TextRenderer for advanced font engine access. |
CurrentPoint | Float2 | The last point in the active sub-path, or Float2.Zero when no path is active. |
DrawCalls | IReadOnlyList<DrawCall> | All draw calls accumulated since the last BeginFrame. |
Indices | IReadOnlyList<uint> | Triangle index buffer for all accumulated geometry. |
Vertices | IReadOnlyList<Vertex> | Vertex buffer for all accumulated geometry. |
Coordinate Conversion
The canvas works in logical units throughout its public API. Use these helpers to convert host input coordinates (e.g., mouse positions reported in physical pixels) to logical units, or to compute pixel-exact sizes for assets.PixelToLogical
FramebufferScale. Useful for converting raw OS mouse/touch coordinates.
LogicalToPixel
FramebufferScale.
Low-Level Geometry Submission
These methods are intended for custom renderers, extensions, or performance-critical paths that construct geometry manually rather than through the path API.RequestNewDrawCall
AddVertex
A
Vertex containing position (Float2), UV coordinates (Float2), and a Color32 color.