drawXPolygon: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{RV|type=command |game1= arma3 |version1= 2.20 |gr1= GUI Control - Map |descr= Draws an N sided polygon on the map. |s1= map drawXPolygon [n, centre, a, b, angle, color, fill, alignWithMap] |p1= map: Control |p2= n: Number - number of sides 3..720 |p3= centre: Object or Array format Position2D, Position3D - ellipse's centre |p4= a: Number - horizontal (x) radius |p5= b: Number - ver...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 24: Line 24:
|p7= color: [[Array]] format [[Color|Color (RGBA)]] - line color
|p7= color: [[Array]] format [[Color|Color (RGBA)]] - line color


|p8= fill: [[String]] - fill texture file or [[Procedural Textures]]. Note that the file texture will not rotate with rectangle, use [[drawIcon]] for that. If fill texture is not empty, set line color to white [1,1,1,1]
|p8= fill: [[String]] - fill texture file or [[Procedural Textures]]. Note that the file texture will not rotate with polygon, use [[drawIcon]] for that. If fill texture is not empty, set line color to white [1,1,1,1]


|p9= alignWithMap: [[Boolean]] - (Optional, default [[true]]) - when [[false]] the shape will not follow map rotation.
|p9= alignWithMap: [[Boolean]] - (Optional, default [[true]]) - when [[false]] the shape will not follow map rotation.
|p8since= Arma3 2.18


|r1= [[Nothing]]
|r1= [[Nothing]]
Line 46: Line 45:
</sqf>
</sqf>


|seealso= [[drawArrow]] [[drawIcon]] [[drawLine]] [[drawRectangle]] [[drawPolygon]] [[drawTriangle]] [[drawRectangle]]
|seealso= [[drawArrow]] [[drawIcon]] [[drawLine]] [[drawRectangle]] [[drawPolygon]] [[drawTriangle]] [[drawEllipse]]
}}
 
{{Note
|user= Waffle SS.
|timestamp= 20150707212800
|text= Be careful when using this command. Unlike map markers, the draw commands can decrease your framerate.
}}
}}

Latest revision as of 22:38, 1 November 2024

Hover & click on the images for description

Description

Description:
Draws an N sided polygon on the map.
Groups:
GUI Control - Map

Syntax

Syntax:
map drawXPolygon [n, centre, a, b, angle, color, fill, alignWithMap]
Parameters:
map: Control
n: Number - number of sides 3..720
centre: Object or Array format Position2D, Position3D - ellipse's centre
a: Number - horizontal (x) radius
b: Number - vertical (y) radius
angle: Number - angle of rotation in degrees
color: Array format Color (RGBA) - line color
fill: String - fill texture file or Procedural Textures. Note that the file texture will not rotate with polygon, use drawIcon for that. If fill texture is not empty, set line color to white [1,1,1,1]
alignWithMap: Boolean - (Optional, default true) - when false the shape will not follow map rotation.
Return Value:
Nothing

Examples

Example 1:
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { _this select 0 drawXPolygon [ 5, player, 50, 10, 0, [1, 0, 0, 1], "" ]; _this select 0 drawXPolygon [ 3, player, 10, 50, 0, [1, 1, 1, 1], "#(rgb,8,8,3)color(1,0.6,0,1)" ]; _this select 0 drawXPolygon [ 12, player, 10, 10, 90, [0, 0, 1, 1], "" ]; }];

Additional Information

See also:
drawArrow drawIcon drawLine drawRectangle drawPolygon drawTriangle drawEllipse

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