# drawDui (Client)

> Draws a dui on the screen for one frame, in coordinates relative to the screen.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Web interface
- **URL**: https://wiki.mymp.gg/en/drawDui

## Syntax

```lua
bool drawDui(dui dui, float x, float y, float width, float height)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `dui` | `dui` | The dui. |
| `x` | `float` | Left edge, from 0 to 1 of the screen's width. |
| `y` | `float` | Top edge, from 0 to 1 of the screen's height. |
| `width` | `float` | Width, as a fraction of the screen's width. |
| `height` | `float` | Height, as a fraction of the screen's height. |

## Returns

`true` once the drawing is asked for. `false` with a wrong argument (logs a warning).

Call it every frame while the dui should show. To draw in pixels, use `dxDrawImage` with the dui.

## Example

```lua
local dui = createDui("https://example.com", 1280, 720)

addEventHandler("onClientRender", root, function()
    drawDui(dui, 0.7, 0.05, 0.25, 0.25)
end)
```

## See also

- [createDui (Client)](https://wiki.mymp.gg/en/createDui.md): Opens a web page off screen, with a transparent background, and gives it back as an image that can be drawn.
- [dxDrawImage (Client)](https://wiki.mymp.gg/en/dxDrawImage.md): Draws an image on the screen for one frame.
- [onClientRender (Client)](https://wiki.mymp.gg/en/onClientRender.md): Fired every frame, when that frame's dx drawing should be done.
