Skip to main content
The Render module draws primitives on the screen overlay. Everything is drawn on top of the game in screen-space pixel coordinates.
All draw calls must happen inside the on("render", ...) callback. Drawing from "tick", timers, or other events will cause flickering or invisible output - the overlay only accepts commands during the render frame. See Events → render for details.
Pro tip: All position arguments accept both Vector2 instances and plain { x, y } objects. All color arguments accept Color instances and packed hex integers (e.g. 0xFF0000FF). If a color is omitted, white is used.

Overview

Screen size

Get the current overlay dimensions.

Rectangles & Circles

Draw bounding boxes, health bars, and FOV rings.

Lines & Polygons

Connect points, draw custom radar shapes and crosshairs.

Text

Render custom strings and player names.

Images

Draw loaded textures with optional rounding.

Screen size

Render.getScreenSize


Returns the current overlay dimensions in pixels as a Vector2 (x = width, y = height). Call this once per frame - the size can change if the user resizes the window or switches resolution.

Rectangles & Circles

Instead of listing separate functions for outlines and filled shapes, we group them here. The parameters are nearly identical, with the exception of thickness.

Rectangles

Vector2
required
Top-left corner of the rectangle in screen coordinates.
Vector2
required
Bottom-right corner of the rectangle in screen coordinates.
Color
default:"Color.white()"
Outline or fill color.
number
default:"1.0"
Border width in pixels. (Ignored in rectFilled)
number
default:"0.0"
Corner radius in pixels. Use for UI backgrounds or modern-looking ESP boxes.

Circles

Vector2
required
The center point of the circle on the screen.
number
required
The radius in pixels.
Color
default:"Color.white()"
Outline or fill color.
number
default:"1.0"
Line width for the outline. (Ignored in circleFilled)

Lines & Polygons

Draws a single straight line between two points.
Vector2
required
Starting point.
Vector2
required
Ending point.
Example: Draw a snapline from the bottom center of the screen to an enemy.
Draws a triangle outline using three specific vertices.
Example: Draw a directional arrow indicating where an off-screen enemy is.
Draws a series of connected line segments through an array of points. Best used for custom complex shapes like radar blips or star polygons.
Vector2[]
required
Array of vertices.
boolean
default:"false"
If true, automatically draws a line from the last point back to the first point.
Example: Draw a diamond shape.

Text

Render.text


Draws a text string on the screen. The position defines the top-left corner of the rendered text block.
Vector2
required
Top-left coordinate for the text.
string
required
The string to render.
Color
default:"Color.white()"
Text color.
number
default:"14"
Font size in pixels.
string
default:"\"segoe\""
Font name. See available fonts.

Render.calcTextSize


Returns the pixel dimensions of a text string without drawing it. Use this to center or align text precisely.
The measurement is exact on every call, including the first one, and costs nothing worth measuring - it walks the font’s glyph table directly and caches the result. It is safe to call in render for every entity on screen.
string
required
The string to measure.
number
default:"14"
Font size in pixels. Must match the size you pass to Render.text.
string
default:"\"segoe\""
Font name. Must match the font you pass to Render.text. See available fonts.
Pass the same fontSize and fontName you will pass to Render.text - measuring with one and drawing with another is the only way to get a mismatch. Both default to 14 and "segoe".

Available fonts


Images

Draw loaded Texture objects.
Always check texture.isReady before drawing. Textures load asynchronously from the disk. Attempting to draw a texture that hasn’t finished loading is a silent no-op.
Texture
required
A previously loaded texture instance.
Vector2
required
Top-left corner of the image rectangle.
Vector2
required
Bottom-right corner of the image rectangle.
number
default:"0.0"
Corner radius in pixels. (Only available in imageRounded)
Color
default:"Color.white()"
Acts as a tint mask. Using Color.white() draws the image in its original colors.

Cookbook: Custom Crosshairs

A quick example showing how to combine basic primitives to build custom UI elements.
A custom drawn crosshair