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, arc, triangle, polyline, curves and their filled versions.Text and images
text, measureText, image, imageQuad, your own fonts.Effects
Gradients, soft shadows and glows, frosted-glass blur.
Groups
push / pop: clip, fade, move, rotate, scale, draw above the menu.World space
line3d, polyline3d, circle3d.Screen and projection
screenSize, worldToScreen, screenTransform, boundsOf.[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
Every shape except
rectGradient also takes a gradient.
Arc angles are radians:
0 points right and they grow clockwise. polyline needs at least 2
points, polygonFilled at least 3. polygonFilled takes any shape, convex or not, as long as the
outline doesn’t cross itself.
Text and images
text
text at position, top-left corner by default. Non-strings go through String(), and
\n starts a new line.
measureText
render.text covers with the same size, font, wrap and letterSpacing. For
plain centering, align on render.text is simpler.
image
min–max. Draws nothing until the texture is
ready.
Texture.fromMemory and call update on it, instead of making a new
texture each frame.
imageQuad
Fonts
ESP text elements accept only the fonts marked in the second column.
Want something else? Load any
.ttf/.otf as a Font and pass it as font:
Effects
Gradients
Every shape andtext takes a gradient option. It replaces the color, spread across the
shape’s own bounds, so you never have to pass coordinates.
angle is in radians: 0 runs left to right, Math.PI / 2 top to bottom. "radial" goes from
the center (from) out to the edges (to). The shape’s own color still counts for its alpha, so
pass "#fff" to keep the gradient as it is, or "#fff8" to make it half transparent.
shadow
box-shadow kind. Draw it first, then the shape
on top. With a bright color and no offset it turns into a glow. Set rounding to half the size
and you get a round glow.
blur
Groups
push and pop gets the state you pushed. This is how you animate whole
widgets without touching their drawing code.
Groups nest: alphas multiply, transforms stack, clips narrow. Clips are in screen pixels and
transforms don’t move them. A group you forget to pop is closed once your listener returns, so it
never leaks into other scripts.
World space
Shapes placed in the world. Unlike drawing between twoworldToScreen points, the part behind
the camera gets cut off, so a line running past you still draws up to the edge of the view
instead of vanishing.
circle3d lies flat on the ground plane, and its radius is in world units.
Screen and projection
screenSize
render.screenSize.
worldToScreen
null when the point is behind the camera. Points off
to the side still project, to coordinates outside the screen.

screenTransform
worldToScreen, but in normalized device coordinates: -1..1 across the screen, y up.
null behind the camera.
boundsOf
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 inrender.