Skip to content

Components

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

FieldScript nameKindDefaultWhat it does
PointspointslistemptyThe outline, in order, in local units.
Colorcolorcolour#ffffffTints the art; alpha fades it out.
TexturetextureassetnoneCovers the shape as Fit says.
Fitfitone of Stretch, TileStretchStretch 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 Scaletile_scalenumber, at least 0.011World units each art pixel covers when Fit is Tile: 1 draws the picture at its own size, 2 at twice it.
Sort Layerlayernumber0Lower draws first.
OpaqueopaquecheckboxoffDraw 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.