Prowl.Quill maintains a single current transform matrix as part of the draw state. Every position you pass to a drawing method is multiplied by this matrix before being scaled to physical pixels. The transform is aDocumentation 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.
Transform2D — a 2×3 affine matrix that can represent translation, rotation, scale, and skew. Because the transform is part of the state, it participates fully in SaveState/RestoreState, making nested coordinate-space changes safe and easy to unwind.
All transform methods work in logical units. The canvas applies FramebufferScale in a separate step, after the transform, so you never need to think about HiDPI when building transforms.
Setting the Transform
TransformBy
t. This is the standard way to accumulate transforms: each call adds a new transformation on top of whatever is already active.
The transformation to concatenate with the current matrix.
CurrentTransform
The matrix to use as the new current transform.
ResetTransform
CurrentTransform(Transform2D.Identity). Subsequent coordinates are passed through unchanged (modulo FramebufferScale).
Reading the Transform
GetTransform
Converting Points
TransformPoint
unitPoint (in logical units) and then multiplies by FramebufferScale, returning the result in physical pixel coordinates. This is the same computation the canvas performs internally for every path vertex. It is useful when you need a pixel-space position — for example, to pass to an external rendering system or to perform pixel-accurate hit testing.
A point in logical units, in the current canvas coordinate space.
Transform2D Factory Methods
Transform2D is defined in Prowl.Vector and provides static factory methods for building common transforms. These combine cleanly with TransformBy.
Translation
(x, y) in logical units.
Rotation
radians around the origin (counter-clockwise, following the standard mathematical convention).
Scale
x and the Y axis by y. Pass the same value for both to scale uniformly.
Common Patterns
Centring the origin of a shape
Draw a shape at its own local origin and use a translation to place it on screen. This makes rotating and scaling around the shape’s centre trivial.Rotating a shape around its own centre
Compose a translate-to-centre, rotate, translate-back sequence. BecauseTransformBy post-multiplies, list operations in the order you want them applied.
Nested coordinate spaces
EachSaveState/RestoreState pair creates an isolated scope. Build local transforms inside and the parent space is automatically restored.