---
name: "drawIcon"
type: command
status: ok
groups: ["GUI Control - Map"]
arma3_since: "0.50"
locality: {"argument": null, "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/drawIcon
revid: 378474
updated: 2026-04-24T11:03:12Z
---

# drawIcon

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

Locality: effect **local**

## Description

Draws an icon on the map.
As this command needs to be called every frame, it is preferable using the [onDraw](../topics/User_Interface_Event_Handlers.md#ondraw) UI Event Handler.

> [!NOTE]
> Some useful icons can be found in `configFile >> "CfgVehicleIcons"`.

## Syntax

```sqf
map drawIcon [texture, color, position, width, height, angle, text, shadow, textSize, font, align]
```

**Parameters:**

- `map`: [Control](../topics/Control.md)
- `texture`: [String](../topics/String.md) - icon texture
- `color`: [Color (RGBA)](../topics/Color.md) - text and icon color
- `position`: [Object](../topics/Object.md), [Position2D](../topics/Position.md#introduction) or [Position3D](../topics/Position.md#introduction)
- `width`: [Number](../topics/Number.md) - width of the icon (but not the text)
- `height`: [Number](../topics/Number.md) - height of the icon (but not the text)
- `angle`: [Number](../topics/Number.md) - rotation angle of the icon not the text (add to it [ctrlMapDir](../commands/ctrlMapDir.md) to show correctly on rotating minimap)
- `text`: [String](../topics/String.md) - (Optional, default "")
- `shadow`: [Number](../topics/Number.md) or [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) can be one of:
  - 0 ([false](../commands/false.md)): no shadow
  - 1: shadow (for text)
  - 2 ([true](../commands/true.md)): outline (works for text and for icon only if icon angle is 0)
- `textSize`: [Number](../topics/Number.md) - (Optional, default -1) size of the text in UI units *(since arma3 0.72)*
- `font`: [String](../topics/String.md) - (Optional, default "") text's font *(since arma3 0.72)*
- `align`: [String](../topics/String.md) - (Optional, default "right") text alignment. Can be:
  - "left"
  - "right"
  - "center" *(since arma3 0.72)*

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

## Examples

### Example 1

Red icon with text:

```sqf
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", {
    _this select 0 drawIcon [
        "iconStaticMG", // custom images can also be used: getMissionPath "\myFolder\myIcon.paa"
        [1,0,0,1],
        getPosASLVisual player,
        24,
        24,
        getDirVisual player,
        "Player Vehicle",
        1,
        0.03,
        "TahomaB",
        "right"
    ]
}];
```

### Example 2

Green text only:

```sqf
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", {
    _this select 0 drawIcon [
        "#(rgb,1,1,1)color(1,1,1,1)",
        [0,1,0,1],
        player,
        0,
        0,
        0,
        name player
    ]
}];
```

## See also

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

## Community notes

**Benargee** — 2016-01-04

Arma 3 1.54

This command does not seem to play nice with [onEachFrame](../commands/onEachFrame.md). It seems to draw on the main screen while maintaing position relative to the map position

Example:

```sqf
onEachFrame {
    findDisplay 12 displayCtrl 51 drawIcon ['iconStaticMG', [1,0,0,1], getPosASL player, 24, 24, getDir player, 'Player Vehicle', 1, 0.03, 'TahomaB', 'right'];
};
```

---

**Leopard20** — 2022-05-09

The icon size always stays the same, even after zooming in/out. To make the icon get bigger with map zoom, use this for width and height size:

```sqf
private _scale = 6.4 * worldSize / 8192 * ctrlMapScale _map;
private _size = _sizeInMeters / _scale;
```

For example, the following icon has an exact size of 50 meters on the map, even after zooming in/out:

```sqf
private _scale = 6.4 * worldSize / 8192 * ctrlMapScale _map;
private _size = 50 / _scale;
_map drawIcon ["iconStaticMG", [1,0,0,1], getPosASLVisual player, _size, _size, 0]
```

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