render
The render namespace exposes high-performance Direct3D drawing functions.
2D & 3D Shapes
Section titled “2D & 3D Shapes”Screen coordinates are represented as vector instances where z is ignored.
| Function | Parameters | Description |
|---|---|---|
render.line |
from: vector, to: vector, clr: color |
Draws a 1px line between screen points. |
render.rect |
from: vector, to: vector, clr: color, rounding?: number |
Draws a filled rectangle with optional corner rounding. |
render.rect_outline |
from: vector, to: vector, clr: color, rounding?: number |
Draws an outlined rectangle. |
render.gradient |
from: vector, to: vector, tl: color, tr: color, bl: color, br: color |
Draws a 4-corner color gradient rectangle. |
render.circle |
center: vector, clr: color, radius: number, start_deg?: number, fraction?: number |
Filled circle or pie slice (fraction: 0..1). |
render.circle_outline |
center: vector, clr: color, radius: number, start_deg?: number, fraction?: number, thickness?: number |
Outlined circle or progress arc. |
render.circle_gradient |
center: vector, outer_clr: color, inner_clr: color, radius: number |
Radial glow circle gradient. |
render.circle_3d |
center: vector, clr: color, radius: number |
World-space filled circle flat on ground. |
render.circle_3d_outline |
center: vector, clr: color, radius: number |
World-space circle outline. |
render.poly |
clr: color, ...points: vector |
Filled convex polygon. |
render.poly_line |
clr: color, ...points: vector |
Polyline through specified vertices. |
render.push_clip_rect |
from: vector, to: vector |
Pushes a screen bounding box clipping region. |
render.pop_clip_rect |
(none) | Restores previous clipping region. |
client.add_callback("render", function() -- Draw a 75% health arc starting at 12 o'clock (-90 deg) render.circle_outline(vector(100, 100), color(120, 220, 90), 20, -90, 0.75, 2)end)Text & Font Rendering
Section titled “Text & Font Rendering”Functions
Section titled “Functions”render.text(font: number | font_t, pos: vector, clr: color, flags: string, text: string)local size = render.measure_text(font: number | font_t, text: string) --> vector(width, height)local custom_font = render.load_font(name: string, size: number, flags?: string) --> font_trender.add_font(file_bytes: string) --> booleanBuilt-in Font IDs
Section titled “Built-in Font IDs”| ID | Typeface Description |
|---|---|
1 |
Verdana (Default cheat UI font) |
2 |
Small Fonts (8px raster face used by ESP flags) |
3 |
Verdana Bold |
4 |
Calibri Bold |
Text Alignment & Style Flags
Section titled “Text Alignment & Style Flags”Flags is a string composed of:
"c": Centered horizontally atpos.x"o": 1px black outline"d": Drop shadow
Inline Color Codes
Section titled “Inline Color Codes”render.text supports embedding inline color sequences:
| Escape Sequence | Effect |
|---|---|
\aRRGGBB |
Sets RGB color, preserving base alpha. |
\aRRGGBBAA |
Sets both RGB and Alpha. |
\aDEFAULT |
Resets to the base clr argument. |
\aCLEAN |
Transparent text placeholder (zero alpha, maintains layout width). |
render.text(1, vector(20, 20), color(255, 255, 255), "o", "Target: \aFF4040Enemy \aDEFAULT| HP: \a40FF40100")Images, Textures & SVGs
Section titled “Images, Textures & SVGs”local img = render.load_image(raw_bytes: string, size?: vector) --> image_tlocal svg = render.load_svg(svg_markup: string, size?: vector) --> image_tlocal pano = render.get_panorama_image(path: string, size?: vector) --> image_tlocal rgba = render.load_rgba(raw_bytes: string, width: number, height: number) --> image_tlocal wpn = render.get_weapon_icon(weapon_index: number) --> image_t
render.texture(image: image_t, pos: vector, clr?: color, size?: vector)load_imagesupports PNG, JPG, BMP, TGA, DDS, and SVG markup.get_panorama_imagesearches loose game files and CS:GO’spak01_*.vpkpackages.- Always load or decode images once during initialization, never inside the
rendercallback loop.
Camera & Screen Projections
Section titled “Camera & Screen Projections”| Function | Returns | Description |
|---|---|---|
render.screen_size() |
vector(width, height) |
Active screen resolution dimensions. |
render.camera_position() |
vector |
Eye position currently being rendered. |
render.camera_angles(ang?: qangle) |
qangle |
Gets (or sets if passed) camera view angles. |
render.world_to_screen(world_pos) |
vector |
Converts 3D world coordinate to 2D screen coordinate. Returns (-1, -1) if behind camera. |
render.project(world_pos) |
vector, boolean |
Returns screen position and a behind_camera flag. |
render.view_matrix() |
table of 16 numbers |
Current 4x4 row-major world-to-screen matrix. |
Raw Direct3D Primitives
Section titled “Raw Direct3D Primitives”render.vertex(primitive_type: number, v1: vertex, v2: vertex, ...)| Type ID | D3D Primitive Type |
|---|---|
1 |
Point list |
2 |
Line list |
3 |
Line strip |
4 |
Triangle list |
5 |
Triangle strip |
6 |
Triangle fan |
