Difference between revisions of "PixelDisplay.drawPoly"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>PixelDisplay.drawPoly</c> draws (outlines) a polygon on the pixel display. The ''points'' argument can be either a list of maps containing "x" and "y" values, or a list of...")
 
 
Line 1: Line 1:
<c>PixelDisplay.drawPoly</c> draws (outlines) a polygon on the pixel display.  The ''points'' argument can be either a list of maps containing "x" and "y" values, or a list of 2-element
+
<c>[[PixelDisplay]].drawPoly</c> draws (outlines) a polygon on the pixel display.  The ''points'' argument can be either a list of maps containing "x" and "y" values, or a list of 2-element
 
lists interpreted as [''x'', ''y''].
 
lists interpreted as [''x'', ''y''].
  

Latest revision as of 00:06, 29 April 2020

PixelDisplay.drawPoly draws (outlines) a polygon on the pixel display. The points argument can be either a list of maps containing "x" and "y" values, or a list of 2-element lists interpreted as [x, y].

Arguments

Parameter Name Type Default Value Meaning
points list list of three or more points
color type self.color color to draw
penSize number 1 width of line to draw

Usage Notes

The polygon is automatically closed; there is no need to repeat the first point at the end of the list.

Example

gfx.drawPoly [[10,100], [200,500], [390,100]]		// draws a triangle