Skip to main content
Immediate-mode 2D drawing on the overlay, in screen pixels with the origin at the top-left.
Draw calls only work inside an on("render") listener. Anywhere else (a tick, a timer, after an await) they throw. Queries (measureText, worldToScreen, screenTransform, boundsOf, screenSize) work anywhere.

Overview

Shapes

line, rect, circle, triangle, polyline and their filled versions.

Text and images

text, measureText, image, fonts.

Screen and projection

screenSize, worldToScreen, screenTransform, boundsOf.
Positions are Vec2Like: [x, y], { x, y } or a Vector2. Colors are ColorLike and always required: "#ff4040", [255, 64, 64, 200], a Color or a packed 0xAABBGGRR. The last argument is an optional options object.

Shapes

polyline needs at least 2 points, polygonFilled at least 3.
polygonFilled only handles convex polygons. A concave outline fills wrong, so split it into triangles.

Text and images

text


Draws text with its top-left corner at position. Non-strings go through String().

measureText


The size render.text covers with the same size and font.

image


Stretches a Texture over min–max. Draws nothing until the texture is ready. tint is multiplied with the texture.

Fonts

ESP text elements accept only the fonts marked in the second column.

Screen and projection

screenSize


The overlay size in pixels. It’s a live value, so there’s no named export: read it as render.screenSize.

worldToScreen


World position to overlay pixels. Returns null when the point is behind the camera. Points off to the side still project, to coordinates outside the screen.
World space to screen space
Project inside render, not on the tick, or boxes lag behind when you turn.

screenTransform


Same as worldToScreen, but in normalized device coordinates: -1..1 across the screen, y up. null behind the camera.

boundsOf


The screen rectangle around an entity’s collision bounds, or around a world box. Returns null when the entity is gone or has no bounds, or when any corner is behind the camera.

Example

Boxes and health bars for enemies. Logic on the tick, drawing in render.