drawPolygon: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Color" to "Color (RGBA)")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| arma3 |Game name=
| arma3 |Game name=
Line 7: Line 6:


|gr1= GUI Control - Map |GROUP1=
|gr1= GUI Control - Map |GROUP1=
____________________________________________________________________________________________


| Draws given polygon on the given map control with given color. The polygon must consist of at least 3 points. Unlike with other draw<shape> commands and due to complexity, this command does not support filling of the polygon with color. Use [[drawTriangle]] command to construct and fill polygon shape as a workaround. |DESCRIPTION=
| Draws given polygon on the given map control with given color. The polygon must consist of at least 3 points. Unlike with other draw<shape> commands and due to complexity, this command does not support filling of the polygon with color. Use [[drawTriangle]] command to construct and fill polygon shape as a workaround. |DESCRIPTION=
____________________________________________________________________________________________


| map [[drawPolygon]] [polygon, color] |SYNTAX=
| map [[drawPolygon]] [polygon, color] |SYNTAX=
Line 33: Line 30:
_control [[drawPolygon]] [test_polygon, [0,0,1,1]];
_control [[drawPolygon]] [test_polygon, [0,0,1,1]];
}];</code> |EXAMPLE1=
}];</code> |EXAMPLE1=
____________________________________________________________________________________________


| [[drawEllipse]], [[drawIcon]], [[drawLine]], [[drawRectangle]], [[drawArrow]], [[drawTriangle]], [[inPolygon]] |SEEALSO=
| [[drawEllipse]], [[drawIcon]], [[drawLine]], [[drawRectangle]], [[drawArrow]], [[drawTriangle]], [[inPolygon]] |SEEALSO=

Revision as of 01:21, 17 January 2021

Hover & click on the images for description

Description

Description:
Draws given polygon on the given map control with given color. The polygon must consist of at least 3 points. Unlike with other draw<shape> commands and due to complexity, this command does not support filling of the polygon with color. Use drawTriangle command to construct and fill polygon shape as a workaround.
Groups:
GUI Control - Map

Syntax

Syntax:
map drawPolygon [polygon, color]
Parameters:
map: Control
polygon: Array of Position3D
color: Color (RGBA) - line color in format [r,g,b,a]
Return Value:
Nothing

Examples

Example 1:
test_polygon = []; for "_i" from 1 to 12 do { test_polygon pushBack (player getPos [10 + random 100, 360/_i]); }; findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { params ["_control"]; _control drawPolygon [test_polygon, [0,0,1,1]]; }];

Additional Information

See also:
drawEllipsedrawIcondrawLinedrawRectangledrawArrowdrawTriangleinPolygon

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section