Skip to main content

traceless.render

Draw during paint or paint_ui. Coordinates and sizes are screen pixels; colors are integer RGBA components conventionally in 0–255. Drawing methods return no values unless stated. Text arguments are concatenated into bounded 2048-byte buffers.

line​

traceless.render.line(x1, y1, x2, y2, r, g, b, a)

Returns: none.

Draws a line between two numeric points. RGBA components are integers.

rectangle​

traceless.render.rectangle(x, y, width, height, r, g, b, a)

Returns: none.

Draws a filled rectangle. Position, size, and color arguments are integers.

gradient​

traceless.render.gradient(x, y, width, height, r1, g1, b1, a1, r2, g2, b2, a2, horizontal)

Returns: none.

Draws a rectangle between two integer RGBA colors. A truthy horizontal argument selects horizontal interpolation; false/nil selects vertical.

triangle​

traceless.render.triangle(x1, y1, x2, y2, x3, y3, r, g, b, a)

Returns: none.

Draws a filled triangle from integer coordinates and colors.

circle​

traceless.render.circle(x, y, r, g, b, a, radius, start_angle, end_angle)

Returns: none.

Draws a filled circle/arc with numeric center, radius, and arc fractions. Use start_angle = 0, end_angle = 1 for a complete circle.

circle_outline​

traceless.render.circle_outline(x, y, r, g, b, a, radius, start_angle, end_angle, thickness)

Returns: none.

Draws a circle/arc outline. Center and RGBA values are integers; radius, arc fractions, and required thickness are numbers.

indicator​

traceless.render.indicator(r, g, b, a, ...)

Returns: integer y.

Draws concatenated values using the native indicator stack and returns its resulting vertical position. Colors are integers.

text​

traceless.render.text(x, y, r, g, b, a, flags, alignment, ...)

Returns: none.

Uses the default ESP font. flags and alignment are compatibility placeholders and are ignored; text begins at argument 9. Pass an empty string and 0 for these slots. Use font_text for supported custom alignment.

measure_text​

traceless.render.measure_text(flags, ...)

Returns: width, height integers.

Measures text using the default ESP font. The first argument is ignored; text begins at argument 2. Use measure_text("", "text"), not measure_text("text").

create_font​

traceless.render.create_font(face, pixel_height [, weight = 400 [, flags = 0 [, start_codepoint = 0x20 [, end_codepoint = 0xFF]]]])

Returns: integer font ID; or nil.

face is a nonempty installed font name of at most 63 bytes without embedded NUL. Height is 1–256; weight is 1–1000; codepoints form an ordered range in 0–0xFFFF with at most 4096 glyphs. Flags must contain only supported bits. Missing renderer/script, invalid settings, and creation failure return nil. Matching settings reuse an ID within its owning script. IDs become invalid on owner unload.

font_text​

traceless.render.font_text(font_id, x, y, r, g, b, a [, alignment = traceless.render.font_alignment.left], ...)

Returns: none.

Text always starts at argument 9. Pass nil in the alignment slot to use the default when providing text. Invalid/stale ID, uninitialized renderer, or unsupported alignment bits draw nothing. Uses integer positions and colors.

font_measure_text​

traceless.render.font_measure_text(font_id, ...)

Returns: width, height integers; or nil.

Measures a custom font, concatenating values from argument 2. Uninitialized renderer or an unavailable font returns nil.

world_to_screen​

traceless.render.world_to_screen(x, y, z)

Returns: screen_x, screen_y integers; or nil.

Projects numeric world coordinates. Returns nil when projection is not visible.

load_jpg​

traceless.render.load_jpg(contents, width, height)

Returns: integer texture ID; or nil.

contents is a binary Lua string. Required integer dimensions must match the decoded JPEG and be between 1 and 4096. Bad data, unavailable renderer/script, or resource failure returns nil. Owner unload destroys the texture.

load_png​

traceless.render.load_png(contents, width, height)

Returns: integer texture ID; or nil.

Same ownership and dimension rules as load_jpg, for PNG contents.

load_rgba​

traceless.render.load_rgba(contents, width, height)

Returns: integer texture ID; or nil.

Raw RGBA8 binary string must contain exactly width * height * 4 bytes; integer dimensions must be 1–4096. Bad size or unavailable resources returns nil. Owner unload destroys the texture.

texture​

traceless.render.texture(id, x, y, width, height, r, g, b, a [, mode])

Returns: none.

Draws an existing texture, tinted with integer colors. Unknown/stale ID draws nothing. Optional mode must be string-like when provided, but is ignored: repeat currently behaves as fill.

font_flags​

Combine these integer bits with bit.bor.

MemberValueMeaning
font_flags.none0Default rendering
font_flags.shadow1Text shadow
font_flags.outline2Text outline
font_flags.no_antialias4Disable antialiasing

font_alignment​

MemberValueMeaning
font_alignment.left1Left alignment
font_alignment.right2Right alignment
font_alignment.center_x4Horizontal centering
font_alignment.center_y8Vertical centering

Combine supported alignment bits with bit.bor. Choose one horizontal alignment; use center_y as an additional vertical flag.

local traceless = require("traceless")
local font = traceless.render.create_font("Tahoma", 14, 400, traceless.render.font_flags.outline)
traceless.events.on("paint_ui", function()
if font then
traceless.render.font_text(font, 20, 20, 255, 255, 255, 255, nil, "Ready")
end
end)