drawPolygon: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (see also) |
m (template:command argument fix) |
||
Line 6: | Line 6: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| 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. |= | | 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] |= | | map '''drawPolygon''' [polygon, color] |SYNTAX= | ||
|p1= map: [[Control]] |= | |p1= map: [[Control]] |PARAMETER1= | ||
|p2= [polygon, color]: [[Array]] |= | |p2= [polygon, color]: [[Array]] |PARAMETER2= | ||
|p3= polygon: [[Array]] - array of positions in format [pos1, pos2, pos3,....posN], where pos is [[Position3D]] |= | |p3= polygon: [[Array]] - array of positions in format [pos1, pos2, pos3,....posN], where pos is [[Position3D]] |PARAMETER3= | ||
|p4= color: [[Array]] - line color in format [r,g,b,a]|= | |p4= color: [[Array]] - line color in format [r,g,b,a]|PARAMETER4= | ||
| [[Nothing]] |= | | [[Nothing]] |RETURNVALUE= | ||
|x1=<code>test_polygon = []; | |x1=<code>test_polygon = []; | ||
Line 28: | Line 28: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|[[drawEllipse]], [[drawIcon]], [[drawLine]], [[drawRectangle]], [[drawArrow]], [[drawTriangle]], [[inPolygon]]|= | |[[drawEllipse]], [[drawIcon]], [[drawLine]], [[drawRectangle]], [[drawArrow]], [[drawTriangle]], [[inPolygon]]|SEEALSO= | ||
}} | }} |
Revision as of 14:38, 7 April 2019
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:
- Uncategorised
Syntax
- Syntax:
- map drawPolygon [polygon, color]
- Parameters:
- map: Control
- [polygon, color]: Array
- polygon: Array - array of positions in format [pos1, pos2, pos3,....posN], where pos is Position3D
- color: Array - 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", { _this select 0 drawPolygon [test_polygon, [0,0,1,1]]; }];
Additional Information
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
[[Category:Introduced with A3 version 1.58]][[ Category: A3: New Scripting Commands | DRAWPOLYGON]][[ Category: A3: Scripting Commands | DRAWPOLYGON]]