> For the complete documentation index, see [llms.txt](https://0x29a.gitbook.io/0x29a-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0x29a.gitbook.io/0x29a-docs/interface/render.md).

# render / draw

**interface · GPU-batched · globals: `render`, `draw`**

A unified drawing API, meant for full-screen HUD/ESP — unlike [ui](/0x29a-docs/interface/ui.md), it doesn't require an open window. Registered under two identical names: `render` (canonical) and `draw` (back-compat alias).

* **2D** (`line`, `rect`, `circle`, `text`, ...) draws on ImGui's *background draw list* — already batched into GPU vertex buffers.
* **3D** (`view`, `line3d`) uses a dedicated vertex-shader pipeline that projects world→screen **on the GPU**.

Colors are `{r, g, b, a}` tables (floats `0..1`, `a` optional) or the global helper `color(r, g, b, a)`. Positions are `{x, y}`/`{x,y,z}` tables, the `vec2(x, y)` helper, or just plain numbers in the expected order.

```lua
_29a.on_frame(function()
    render.rect_filled(10, 10, 200, 40, color(0.1, 0.1, 0.15, 0.8))
    render.text(20, 20, color(1, 1, 1, 1), "hello, hud")
end)
```

## 2D (screen)

### `render.line(x1, y1, x2, y2, color [, thickness=1])`

### `render.rect(x, y, w, h, color [, thickness=1, rounding=0])`

### `render.rect_filled(x, y, w, h, color [, rounding=0])`

### `render.circle(x, y, radius, color [, thickness=1, segments=auto])`

### `render.circle_filled(x, y, radius, color [, segments=auto])`

### `render.triangle(x1, y1, x2, y2, x3, y3, color [, thickness=1])`

### `render.triangle_filled(x1, y1, x2, y2, x3, y3, color)`

### `render.text(x, y, color, text)`

### `render.text_size(text) -> w, h`

### `render.screen() -> width, height`

Current screen/viewport dimensions.

## 3D (world)

### `render.view(addr) / render.view(matrix16)`

Sets the view-projection matrix used to project `render.line3d`. Accepts either a memory address (reads 16 floats from there — the game's view-proj matrix, once per frame) **or** a Lua table of 16 numbers.

```lua
-- option A: read directly from the game's memory (most common)
render.view(view_matrix_addr)

-- option B: a matrix you already computed in Lua
render.view({ m00, m01, m02, m03, m10, ..., m33 })
```

### `render.line3d(x1, y1, z1, x2, y2, z2, color)`

Queues a line in **world** coordinates — the projection (and behind-camera clipping) happens on the GPU, using the last matrix set by `render.view`. This is how skeleton/box ESP gets drawn.

```lua
render.view(view_matrix_addr)

for _, bone in ipairs(get_player_bones(entity)) do
    render.line3d(bone.parent.x, bone.parent.y, bone.parent.z,
                  bone.x, bone.y, bone.z,
                  color(1, 0, 0, 1))
end
```

{% hint style="info" %}
**When to use `render` vs. `ui.dl_*` Use `render.*` for a permanent full-screen HUD/ESP. Only use the `ui.dl_*` functions (see** [**ui**](/0x29a-docs/interface/ui.md#draw-list-current-window)**) when the drawing**

needs to be clipped inside a specific ImGui window.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://0x29a.gitbook.io/0x29a-docs/interface/render.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
