Difference between revisions of "BIS fnc drawArrow"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
Line 1: Line 1:
{{Function|Comments=
+
{{Function
  
| arma3 |Game name=
+
| arma3
  
|1.74|Game version=
+
|1.74
  
|gr1 = Map and Markers |GROUP1=
+
|gr1 = Map and Markers
  
 
| Draws a static arrow (outline or color filled) on map. See Example 4 for arrow removal.
 
| Draws a static arrow (outline or color filled) on map. See Example 4 for arrow removal.
{{Informative|Note that the order in which arrows are added to map is reversed, the last added arrow will appear under the first added arrow}}|DESCRIPTION=
+
{{Informative|Note that the order in which arrows are added to map is reversed, the last added arrow will appear under the first added arrow}}
  
| [from, to, color, pars, fill, map] call [[BIS_fnc_drawArrow]] |SYNTAX=
+
| [from, to, color, pars, fill, map] call [[BIS_fnc_drawArrow]]
  
|p1= from: [[Array]] - Arrow start position in format [x,y] or [x,y,z]|PARAMETER1=
+
|p1= from: [[Array]] - Arrow start position in format [x,y] or [x,y,z]
|p2= to: [[Array]] - Arrow end position in format [x,y] or [x,y,z]|PARAMETER2=
+
|p2= to: [[Array]] - Arrow end position in format [x,y] or [x,y,z]
|p3= color (Optional): [[Array]] - Arrow line or fill color in format [r,g,b,a]. Default: [1,1,1,1] |PARAMETER3=
+
|p3= color (Optional): [[Array]] - Arrow line or fill color in format [r,g,b,a]. Default: [1,1,1,1]
 
|p4= pars (Optional): [[Array]] - Arrow geometry details in format [arrowThickness, arrowHeadLengthCoef, arrowHeadWidthCoef], where:
 
|p4= pars (Optional): [[Array]] - Arrow geometry details in format [arrowThickness, arrowHeadLengthCoef, arrowHeadWidthCoef], where:
 
* arrowThickness (Optional):  [[Number]] - Arrow thickness in meters. Default: 10
 
* arrowThickness (Optional):  [[Number]] - Arrow thickness in meters. Default: 10
 
* arrowHeadLengthCoef (Optional):  [[Number]] - Arrow head length compared to the total length of the arrow. Default: 1/3 (third of the length)
 
* arrowHeadLengthCoef (Optional):  [[Number]] - Arrow head length compared to the total length of the arrow. Default: 1/3 (third of the length)
 
* arrowHeadWidthCoef (Optional):  [[Number]] - Arrow head width compared to the arrow thickness. Default: 2 (twice as wide)
 
* arrowHeadWidthCoef (Optional):  [[Number]] - Arrow head width compared to the arrow thickness. Default: 2 (twice as wide)
* arrowBaseWidthCoef (Optional):  [[Number]] - Arrow base width compared to the arrow thickness. Default: 1 (same width)  - ''Since Arma 3 v1.97''|PARAMETER4=
+
* arrowBaseWidthCoef (Optional):  [[Number]] - Arrow base width compared to the arrow thickness. Default: 1 (same width)  - ''Since Arma 3 v1.97''
|p5= fill (Optional): [[Boolean]] - [[true]] to draw color filled arrow, [[false]] to draw outline. Default: [[true]]|PARAMETER5=
+
|p5= fill (Optional): [[Boolean]] - [[true]] to draw color filled arrow, [[false]] to draw outline. Default: [[true]]
|p6= map (Optional): [[Control]] - Map control. Default: [[displayCtrl|control]] 51 of the main map [[findDisplay|display]] 12|PARAMETER6=
+
|p6= map (Optional): [[Control]] - Map control. Default: [[displayCtrl|control]] 51 of the main map [[findDisplay|display]] 12
  
 
| [[Array]] - Arrow reference for removal in format [idd, idc, ehId] or empty array [] on removal operation
 
| [[Array]] - Arrow reference for removal in format [idd, idc, ehId] or empty array [] on removal operation
  
<br><br>[[Image:fnc_drawArrow.jpg|448px]] [[Image:BIS_fnc_drawArrow2.jpg|400px]]|RETURNVALUE=
+
<br><br>[[Image:fnc_drawArrow.jpg|448px]] [[Image:BIS_fnc_drawArrow2.jpg|400px]]
 
   
 
   
|x1= Draw a semi-transparent, blue arrow with default geometry:<code>myArrow1 = [_pos1, _pos2, [0,0,1,0.5]] [[call]] [[BIS_fnc_drawArrow]];</code> |Example1=
+
|x1= Draw a semi-transparent, blue arrow with default geometry:<code>myArrow1 = [_pos1, _pos2, [0,0,1,0.5]] [[call]] [[BIS_fnc_drawArrow]];</code>
|x2= Draw a wide, green arrow outline:<code>myArrow2 = [_pos1, _pos2, [0,1,0,1], [20], [[false]]] [[call]] [[BIS_fnc_drawArrow]]; </code> |Example2=
+
|x2= Draw a wide, green arrow outline:<code>myArrow2 = [_pos1, _pos2, [0,1,0,1], [20], [[false]]] [[call]] [[BIS_fnc_drawArrow]]; </code>
|x3= Draw a thin, red arrow with custom head geometry:<code>myArrow3 = [_pos1, _pos2, [1,0,0,1], [1,1/5,5]] [[call]] [[BIS_fnc_drawArrow]];</code> |Example3=
+
|x3= Draw a thin, red arrow with custom head geometry:<code>myArrow3 = [_pos1, _pos2, [1,0,0,1], [1,1/5,5]] [[call]] [[BIS_fnc_drawArrow]];</code>
|x4= Remove the arrow created in Example 3:<code>myArrow3 [[call]] [[BIS_fnc_drawArrow]];</code> |Example4=
+
|x4= Remove the arrow created in Example 3:<code>myArrow3 [[call]] [[BIS_fnc_drawArrow]];</code>
 
|x5= <code>myArrow1 = [<nowiki/>[100,400,0], [200,500,0], [1,0,0,1], [20], [[true]]] [[call]] [[BIS_fnc_drawArrow]];  
 
|x5= <code>myArrow1 = [<nowiki/>[100,400,0], [200,500,0], [1,0,0,1], [20], [[true]]] [[call]] [[BIS_fnc_drawArrow]];  
 
myArrow2 = [<nowiki/>[400,700,0], [300,600,0], [0,1,0,1], [20, 1/3, 2, 2], [[true]]] [[call]] [[BIS_fnc_drawArrow]];  
 
myArrow2 = [<nowiki/>[400,700,0], [300,600,0], [0,1,0,1], [20, 1/3, 2, 2], [[true]]] [[call]] [[BIS_fnc_drawArrow]];  
Line 36: Line 36:
 
myArrow4 = [<nowiki/>[100,100,0], [200,200,0], [0,0,0,1], [20], [[false]]] [[call]] [[BIS_fnc_drawArrow]];  
 
myArrow4 = [<nowiki/>[100,100,0], [200,200,0], [0,0,0,1], [20], [[false]]] [[call]] [[BIS_fnc_drawArrow]];  
 
myArrow5 = [<nowiki/>[400,400,0], [300,300,0], [1,1,1,1], [20, 1/3, 2, 2], [[false]]] [[call]] [[BIS_fnc_drawArrow]];  
 
myArrow5 = [<nowiki/>[400,400,0], [300,300,0], [1,1,1,1], [20, 1/3, 2, 2], [[false]]] [[call]] [[BIS_fnc_drawArrow]];  
myArrow6 = [<nowiki/>[600,400,0], [400,600,0], [0,1,1,1], [20, 1/3, 2, 0.5], [[false]]] [[call]] [[BIS_fnc_drawArrow]];</code> |Example5=
+
myArrow6 = [<nowiki/>[600,400,0], [400,600,0], [0,1,1,1], [20, 1/3, 2, 0.5], [[false]]] [[call]] [[BIS_fnc_drawArrow]];</code>
  
  
| [[drawArrow]] |SEEALSO=
+
| [[drawArrow]]
 
}}
 
}}
  

Revision as of 23:02, 17 January 2021

Hover & click on the images for description

Description

Description:
Draws a static arrow (outline or color filled) on map. See Example 4 for arrow removal. Informative
Execution:
call
Groups:
Map and Markers

Syntax

Syntax:
[from, to, color, pars, fill, map] call BIS_fnc_drawArrow
Parameters:
from: Array - Arrow start position in format [x,y] or [x,y,z]
to: Array - Arrow end position in format [x,y] or [x,y,z]
color (Optional): Array - Arrow line or fill color in format [r,g,b,a]. Default: [1,1,1,1]
pars (Optional): Array - Arrow geometry details in format [arrowThickness, arrowHeadLengthCoef, arrowHeadWidthCoef], where:
  • arrowThickness (Optional): Number - Arrow thickness in meters. Default: 10
  • arrowHeadLengthCoef (Optional): Number - Arrow head length compared to the total length of the arrow. Default: 1/3 (third of the length)
  • arrowHeadWidthCoef (Optional): Number - Arrow head width compared to the arrow thickness. Default: 2 (twice as wide)
  • arrowBaseWidthCoef (Optional): Number - Arrow base width compared to the arrow thickness. Default: 1 (same width) - Since Arma 3 v1.97
fill (Optional): Boolean - true to draw color filled arrow, false to draw outline. Default: true
map (Optional): Control - Map control. Default: control 51 of the main map display 12
Return Value:
Array - Arrow reference for removal in format [idd, idc, ehId] or empty array [] on removal operation

fnc drawArrow.jpg BIS fnc drawArrow2.jpg

Examples

Example 1:
Draw a semi-transparent, blue arrow with default geometry:myArrow1 = [_pos1, _pos2, [0,0,1,0.5]] call BIS_fnc_drawArrow;
Example 2:
Draw a wide, green arrow outline:myArrow2 = [_pos1, _pos2, [0,1,0,1], [20], false] call BIS_fnc_drawArrow;
Example 3:
Draw a thin, red arrow with custom head geometry:myArrow3 = [_pos1, _pos2, [1,0,0,1], [1,1/5,5]] call BIS_fnc_drawArrow;
Example 4:
Remove the arrow created in Example 3:myArrow3 call BIS_fnc_drawArrow;
Example 5:
myArrow1 = [[100,400,0], [200,500,0], [1,0,0,1], [20], true] call BIS_fnc_drawArrow; myArrow2 = [[400,700,0], [300,600,0], [0,1,0,1], [20, 1/3, 2, 2], true] call BIS_fnc_drawArrow; myArrow3 = [[600,700,0], [400,900,0], [0,0,1,1], [20, 1/3, 2, 0.5], true] call BIS_fnc_drawArrow; myArrow4 = [[100,100,0], [200,200,0], [0,0,0,1], [20], false] call BIS_fnc_drawArrow; myArrow5 = [[400,400,0], [300,300,0], [1,1,1,1], [20, 1/3, 2, 2], false] call BIS_fnc_drawArrow; myArrow6 = [[600,400,0], [400,600,0], [0,1,1,1], [20, 1/3, 2, 0.5], false] call BIS_fnc_drawArrow;

Additional Information

See also:
drawArrow

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