A polygon or polyline shape defined by vertices in world units. More...
| Import Statement: | import Clayground.Canvas |
Poly renders a shape from an array of vertex points in world coordinates. It can display as a closed polygon (with fill) or an open polyline.
Example usage:
import Clayground.Canvas as Canv Canv.Poly { canvas: myCanvas vertices: [ {x: 0, y: 0}, {x: 2, y: 0}, {x: 1, y: 2} ] fillColor: "green" strokeColor: "darkgreen" }
The parent canvas for coordinate transformation. Required.
Array of vertex points {x, y} in world units.
Width of the outline stroke in pixels.
Color of the outline stroke.
Fill color. Use "transparent" for polyline (no fill).
Style of the stroke (solid, dash, etc.).
Custom dash pattern as an array of dash/gap lengths.
Whether the shape is closed. True when fillColor is not transparent.
Pen used for the outline: "none" (default), "chalk" or "marker". "chalk" draws a wobbly, slightly jagged line plus a wider, fainter grain pass; "marker" draws a smooth slow wobble with round caps and joins. The vertices stay exact.
How much of the outline is drawn, from 0 to 1 (default 1), measured along its length from the first vertex.
Which wobble the sketch pens use (default 0). Same seed and same vertices draw the same line.
Refreshes the shape visualization after vertex changes.