polygon(pts: Vec2[] , opt?: PolygonCompOpt ): PolygonComp
Attach and render a polygon to a Game Object.
parampts- The points to render the polygon.
paramopt- Options for the polygon component. See
// Make a square the hard way
add([
pos(80, 120),
polygon([vec2(0,0), vec2(50,0), vec2(50,50), vec2(0,50)]),
outline(4),
area(),
])
returnsThe polygon comp.
sincev3001.0
groupComponents