---
name: "drawPolygon"
type: command
status: ok
groups: ["GUI Control - Map"]
arma3_since: "1.58"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/drawPolygon
revid: 377843
updated: 2026-01-03T04:35:45Z
---

# drawPolygon

*Command · GUI Control - Map · Arma 3 v1.58*

## 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*` commands and due to complexity, this command does not support filling of the polygon with color. Use [drawTriangle](../commands/drawTriangle.md) command to construct and fill polygon shape as a workaround.

## Syntax

```sqf
map drawPolygon [polygon, color]
```

**Parameters:**

- `map`: [Control](../topics/Control.md)
- `polygon`: [Array](../topics/Array.md) of [Position3D](../topics/Position.md#introduction)
- `color`: [Color (RGBA)](../topics/Color.md)

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
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]];
}];
```

### Example 2

Draw a polygon by adjusting the `_radius` and `_numVertices`

```sqf
vertices = [];
private _numVertices = 2;
private _numVertices = _numVertices max 3;
private _radius = 100;

for "_i" from 1 to _numVertices do
{
    vertices pushBack (player getRelPos [_radius, 360 / _numVertices * _i]);
};

findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",
{
    params ["_control"];
    _control drawPolygon [vertices, [0,0,1,1]];
}];
```

## See also

[drawEllipse](../commands/drawEllipse.md) · [drawIcon](../commands/drawIcon.md) · [drawLine](../commands/drawLine.md) · [drawRectangle](../commands/drawRectangle.md) · [drawArrow](../commands/drawArrow.md) · [drawTriangle](../commands/drawTriangle.md) · [inPolygon](../commands/inPolygon.md) · [drawXPolygon](../commands/drawXPolygon.md)

<sub>Source: [BI Community Wiki — drawPolygon](https://community.bistudio.com/wiki/drawPolygon) (revision 377843).</sub>
