User Tools

Site Tools


en:poly

This is an old revision of the document!


Poly (Statement)

Format

poly numeric_array_variable
poly ( numeric_array_variable )
poly { x1, y1, x2, y2, x3, y3 … }

Description

Draws a polygon. The sides of the polygon are defined by the values stored in the array, which should be stored as x,y pairs, sequentially. The length of the array/2 will define the number of points. A polygon may also be specified using an Anonymous Array (list of x,y pairs enclosed in curly braces {}).

Example

# using an array
color blue
rect 0,0,300,300
color green
dim tri(1)
tri = {100, 100, 200, 200, 100, 200}
poly tri
# using an anonymous array
color blue
rect 0,0,300,300
color green
poly {100, 100, 200, 200, 100, 200}

Both programs use the poly statement to draw the following:

See Also

2016/01/01 22:42

History

0.9.4number of points in the array argument was removed from the poly statement
en/poly.1451713303.txt.gz · Last modified: 2020/02/28 10:46 (external edit)