---
name: "drawXPolygon"
type: command
status: ok
groups: ["GUI Control - Map"]
arma3_since: "2.20"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/drawXPolygon
revid: 377556
updated: 2026-01-02T06:54:57Z
---

# drawXPolygon

*Command · GUI Control - Map · Arma 3 v2.20*

## Description

Draws an N sided polygon on the map.

## Syntax

```sqf
map drawXPolygon [n, centre, a, b, angle, color, fill, alignWithMap]
```

**Parameters:**

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

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

## Examples

### Example 1

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

## See also

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

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