---
name: "drawLine"
type: command
status: ok
groups: ["GUI Control - Map"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/drawLine
revid: 377558
updated: 2026-01-02T06:55:00Z
---

# drawLine

*Command · GUI Control - Map · Arma 3 v0.50 · introduced in Armed Assault v1.00*

## Description

Draw a line on the map. Can decrease framerate!

## Syntax

```sqf
map drawLine [from, to, color, width]
```

**Parameters:**

- `map`: [Control](../topics/Control.md)
- `from`: [Object](../topics/Object.md) or [Position2D](../topics/Position.md#introduction) or [Position3D](../topics/Position.md#introduction)
- `to`: [Object](../topics/Object.md) or [Position2D](../topics/Position.md#introduction) or [Position3D](../topics/Position.md#introduction)
- `color`: [Color (RGBA)](../topics/Color.md)
- `width`: [Number](../topics/Number.md) - (Optional, default 3) *(since arma3 2.18)*

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

## Examples

### Example 1

```sqf
(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw",
    "(_this select 0) drawLine [
        player,
        [0,0,0],
        [0,0,1,1]
    ];"
];
```

Arma 3 v2.02 [toString](../commands/toString.md) version:

```sqf
(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw", toString {
    (_this select 0) drawLine [
        player,
        [0,0,0],
        [0,0,1,1] // blue
    ];
}];
```

## See also

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

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