Please enable JavaScript to view this site.

A-Shell Consolidated Reference

Revised December 2017

//POLYGON, mode, brush, x1, y1, x2, y2, {...X10, Y10}

POLYGON draws a polygon based on up to 10 points. Straight lines are drawn between the points using the current pen, including a line from the last point back to the first. The points are specified in the current map mode.

Parameters

mode specifies the polygon fill mode:

Symbol

Value

Description

 

0

Use existing mode (whatever was last set)

Alternate

1

Fills in the area between odd and even sides

Winding

2

Fills in any area with a non-zero "winding value".

The difference between the modes is not significant for simple enclosed polygons, but becomes apparent with polygons whose sides cross over themselves. An illustrative example would be a five-pointed star, whose lines intersect to create a pentagon in the middle. The alternate fill mode would fill in the points, whereas the winding fill mode would fill in the entire region.

The winding value is defined as the number of times a pen used to draw the polygon would go around the region.

brush selects a value for fill from the table below. See the topic Parameters: Symbols vs. Values if you have questions about which to use.

Symbol

Value

Description

Comment

WHITE_BRUSH

0

White

Overrides color set by SETBRUSH

LTGRAY_BRUSH

1

Light gray

Or color set by SETBRUSH

GRAY_BRUSH

2

Gray

Or color set by SETBRUSH

DKGRAY_BRUSH

3

Dark gray

Or color set by SETBRUSH

BLACK_BRUSH

4

Black

Overrides color set bySETBRUSH

NULL_BRUSH

5

Hollow (default)

Overrides color set by SETBRUSH

 

History

2011 January, A-Shell 6.0.1203:  Added to A-Shell