draw
draw - Drawing#
Recorded overlay primitives, replayed inside the render scene one frame later.
draw.line#
draw.line(x1, y1, x2, y2, argb, [thickness])
Straight line between two screen points.
| Parameter | Type | Default | Description |
|---|---|---|---|
x1 | number | (required) | Start X (px). |
y1 | number | (required) | Start Y (px). |
x2 | number | (required) | End X (px). |
y2 | number | (required) | End Y (px). |
argb | number | (required) | Color from draw.color. |
thickness | number | 1 | Stroke width (px). |
draw.box#
draw.box(x, y, w, h, argb, [thickness])
Rectangle outline.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | number | (required) | Left (px). |
y | number | (required) | Top (px). |
w | number | (required) | Width (px). |
h | number | (required) | Height (px). |
argb | number | (required) | Color from draw.color. |
thickness | number | 1 | Stroke width (px). |
draw.fill#
draw.fill(x, y, w, h, argb)
Filled rectangle.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | number | (required) | Left (px). |
y | number | (required) | Top (px). |
w | number | (required) | Width (px). |
h | number | (required) | Height (px). |
argb | number | (required) | Color from draw.color. |
draw.circle#
draw.circle(x, y, r, argb, [thickness])
Circle outline.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | number | (required) | Center X (px). |
y | number | (required) | Center Y (px). |
r | number | (required) | Radius (px). |
argb | number | (required) | Color from draw.color. |
thickness | number | 1 | Stroke width (px). |
draw.fill_circle#
draw.fill_circle(x, y, r, argb)
Filled circle.
| Parameter | Type | Default | Description |
|---|---|---|---|
x | number | (required) | Center X (px). |
y | number | (required) | Center Y (px). |
r | number | (required) | Radius (px). |
argb | number | (required) | Color from draw.color. |
draw.text#
draw.text(str, x, y, argb)
Text at a screen point.
| Parameter | Type | Default | Description |
|---|---|---|---|
str | string | (required) | Text. |
x | number | (required) | X (px). |
y | number | (required) | Y (px). |
argb | number | (required) | Color from draw.color. |
draw.text_centered#
draw.text_centered(str, x, y, argb)
Text centered on a screen point.
| Parameter | Type | Default | Description |
|---|---|---|---|
str | string | (required) | Text. |
x | number | (required) | Center X (px). |
y | number | (required) | Center Y (px). |
argb | number | (required) | Color from draw.color. |
draw.color#
draw.color(r, g, b, [a]) → number (ARGB)
Pack 0-255 channels into the ARGB number every draw function takes.
| Parameter | Type | Default | Description |
|---|---|---|---|
r | number | (required) | Red 0-255. |
g | number | (required) | Green 0-255. |
b | number | (required) | Blue 0-255. |
a | number | 255 | Alpha 0-255. |
draw.pixels#
draw.pixels(hex, x, y, [cell], [color], [rotation_deg])
Draw a 25x25 pixel-art shape (crosshair-editor hex format, e.g. from menu.pixels) centered at x,y. The whole grid rotates rigidly. Empty/invalid hex draws the classic cross.
| Parameter | Type | Default | Description |
|---|---|---|---|
hex | string | (required) | Pixel-art hex string. |
x | number | (required) | Center X (px). |
y | number | (required) | Center Y (px). |
cell | number | 4 | Cell size (px, min 0.5). |
color | number | opaque green | ARGB color. |
rotation_deg | number | 0 | Rotation in degrees. |
Last updated 2026-10-03