drawTriangle
Jump to navigation
Jump to search
Description
- Description:
- Draws a single triangle or multiple triangles on the map. Triangle is defined by 3 positions of its verticies: p0, p1, p2 in a single array [p0, p1, p2]. Next 3 positions in the same array [p0, p1, p2, p0, p1, p2] will be used to draw second triangle, another 3 positions [p0, p1, p2, p0, p1, p2, p0, p1, p2] to draw 3rd and so on.
NOTE: when fill param is absent or is an empty string "", the triangle is drawn with lines of the color set in color param. In order to draw color filled triangle of the same color as color param, set fill param to opaque white procedural texture"#(rgb,1,1,1)color(1,1,1,1)". - Groups:
- Uncategorised
Syntax
- Syntax:
- map drawTriangle [vertices, color, fill]
- Parameters:
- map: Control - map control
- [vertices, color, fill]: Array
- vertices: Array of triangle(s) vertices in multiple of 3s [p0, p1, p2(, p0, p1, p2,....)], where vertex position (p) is in format [x,y] or [x,y,z], in which case z is ignored
- color: Array - color in format: [r,g,b,a]
- fill (Optional): String - fill texture file or Procedural_Textures. See note in description for more info.
- Return Value:
- Nothing
Examples
- Example 1:
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { _this select 0 drawTriangle [ [ player getRelPos [100, 0], player getRelPos [100, -135], player getRelPos [100, 135] ], [1,0,0,0.5], "#(rgb,1,1,1)color(1,1,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 arma3dev version 1.73]][[ Category: arma3dev: New Scripting Commands | DRAWTRIANGLE]][[ Category: arma3dev: Scripting Commands | DRAWTRIANGLE]]