drawPolygon: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN -->  <!-- Note Section END --> </dl> " to "")  | 
				Lou Montana (talk | contribs)  m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...)  | 
				||
| Line 1: | Line 1: | ||
{{Command  | {{Command  | ||
| arma3   | | arma3  | ||
|1.58  | |1.58  | ||
|gr1= GUI Control - Map   | |gr1= GUI Control - Map  | ||
| 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.  | ||
| map [[drawPolygon]] [polygon, color]   | | map [[drawPolygon]] [polygon, color]  | ||
|p1= map: [[Control]]   | |p1= map: [[Control]]  | ||
|p2= polygon: [[Array]] of [[Position3D]]   | |p2= polygon: [[Array]] of [[Position3D]]  | ||
|p3= color: [[Color|Color (RGBA)]] - line color in format [r,g,b,a]  | |p3= color: [[Color|Color (RGBA)]] - line color in format [r,g,b,a]  | ||
| [[Nothing]]   | | [[Nothing]]  | ||
|x1= <code>test_polygon = [];  | |x1= <code>test_polygon = [];  | ||
| Line 29: | Line 29: | ||
	[[params]] ["_control"];  | 	[[params]] ["_control"];  | ||
	_control [[drawPolygon]] [test_polygon, [0,0,1,1]];  | 	_control [[drawPolygon]] [test_polygon, [0,0,1,1]];  | ||
}];</code>   | }];</code>  | ||
| [[drawEllipse]], [[drawIcon]], [[drawLine]], [[drawRectangle]], [[drawArrow]], [[drawTriangle]], [[inPolygon]]   | | [[drawEllipse]], [[drawIcon]], [[drawLine]], [[drawRectangle]], [[drawArrow]], [[drawTriangle]], [[inPolygon]]  | ||
}}  | }}  | ||
<h3 style="display:none">Bottom Section</h3>  | <h3 style="display:none">Bottom Section</h3>  | ||
Revision as of 00:36, 18 January 2021
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
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