Polygon
A filled outline whose points are dragged into shape and triangulated automatically: a water surface, a slope, a pool of acid, a hand-drawn backdrop. A texture stretches across it or tiles over it, or it fills flat with a colour.
On this page
Add it
+ Add node → Polygon, MultiMesh creates a node with it already on. Already have a node for it? Add component → PolygonComponent.
From a script
A script on the same node writes these fields by name. PolygonComponent is the name to pass.
rgs
set_colour("PolygonComponent", "color", vec4(1.0, 1.0, 1.0, 1.0));
set_number("PolygonComponent", "tile_scale", 1.0);
set_flag("PolygonComponent", "opaque", false); Fields
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Points | points | list | empty | The outline, in order, in local units. |
| Color | color | colour | #ffffff | Tints the art; alpha fades it out. |
| Texture | texture | asset | none | Covers the shape as Fit says. |
| Fit | fit | one of Stretch, Tile | Stretch | Stretch spreads the picture once across the shape's extent; Tile repeats it at its own size times Tile Scale, from the node's origin. |
| Tile Scale | tile_scale | number, at least 0.01 | 1 | World units each art pixel covers when Fit is Tile: 1 draws the picture at its own size, 2 at twice it. |
| Sort Layer | layer | number | 0 | Lower draws first. |
| Opaque | opaque | checkbox | off | Draw without blending, for a backmost shape nothing shows through: its see-through parts, and a see-through Color, come out dark instead of showing what is behind. |