AddPolygon

AddPolygon ( scanDirection ;​ listOfCoords ;​ fillColor ;​ fillColorVariant ;​ borderStroke ;​ borderColor ;​ borderColorVariant ;​ shadowEffect ;​ shadowColor )

Argument Type Range Default Note
scanDirection int 1..2 xxyy
listOfCoords num[] -inf..+inf (required)
fillColor rgba 0..255 black
fillColorVariant int -1..128 solid
borderStroke num[] 0..1000 0 Dimension:[pt]
borderColor rgba 0..255 black
borderColorVariant int -1..128 solid
shadowEffect num[] -1000..1000 0
shadowColor rgba 0..255 #888a
Examples

AddPolygon(xxyy;​50 50 150 150 150 100 50 250)

AddPolygon(xyxy;​50 50 150 150 150 100 50 250;​blue)

Description

The AddPolygon() function makes it possible to draw polygonal areas whose fill, border and shadow can be varied. The argument scanDirection makes it possible to enter coordinates in two ways: either all x-coordinates are entered first and then all y-coordinates (scanDirection = xxyy) or the x and y-coordinates of the 1st polygon point are entered, then the x and y-coordinates of the 2nd polygon point, etc. (scanDirection = xyxy). All coordinate values are to be entered separated by spaces, tabs or line feeds.

/* The following 2 function calls are equivalent. */

AddPolygon(xxyy;​45 69 60 30 21 45

15 32 60 60 32 15;​

steelBlue)

AddPolygon(xyxy;​45 15

69 32

60 60

30 60

21 32

45 15;​

steelBlue)

ADD_POLYGON_01
1

OpenDrawing(100;​100)

2

AddPolygon(xyxy;​

3

50.0 10.0

4

88.0 37.6

5

73.5 82.4

6

26.5 82.4

7

12.0 37.6;​

8

steelBlue;​shaded)

9

CloseDrawing()

ADD_POLYGON_01
ADD_POLYGON_02
1

OpenDrawing(100;​100)

2

AddPolygon(xyxy;​

3

50.0 10.0

4

59.0 37.6

5

88.0 37.6

6

64.6 54.7

7

73.5 82.4

8

50.0 65.3

9

26.5 82.4

10

35.4 54.7

11

12.0 37.6

12

41.0 37.6

13

50.0 10.0;​

14

206 222 236;​solid;​ /* Fill */

15

4;​steelBlue;​solid) /* Border */

16

CloseDrawing()

ADD_POLYGON_02
ADD_POLYGON_03
1

OpenDrawing(100;​100)

2

AddPolygon(xyxy;​

3

50.0 10.0

4

73.5 82.4

5

12.0 37.6

6

88.0 37.6

7

26.5 82.4

8

50.0 10.0;​

9

206 222 236;​solid;​ /* Fill */

10

2.0;​steelBlue;​solid;​ /* Border */

11

0 0 3;​0 128 128 150) /* Shadow */

12

CloseDrawing()

ADD_POLYGON_03
Scroll to Top