> For the complete documentation index, see [llms.txt](https://pellix-1.gitbook.io/pellix-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pellix-1.gitbook.io/pellix-docs/callbacks/draw.md). Agents can also search and read this documentation through its [MCP server](https://pellix-1.gitbook.io/pellix-docs/~gitbook/mcp).

# draw

Executes every time when overlay frame is about to render.

This callback can be registered by calling [set\_callback](https://pellix-1.gitbook.io/pellix-docs/functions/set_callback.md).

**Example:**

```lua
local function on_draw()
    draw.line(0, 0, 100, 100, 0xffffffff)
end

set_callback("draw", on_draw)
```
