Function for drawing and interacting with rendered visuals.
overlay.circle(x, y, r, g, b, a, radius, start_degrees, percentage)
Draws a filled circle on the screen.
overlay.circle_outline(x, y, r, g, b, a, radius, start_degrees, percentage, thickness)
Draws the outline of a circle on the screen.
overlay.gradient(x, y, w, h, r1, g1, b1, a1, r2, g2, b2, a2, direction)
Draws a horizontal or vertical gradient on the screen.
overlay.line(x1, y1, x2, y2, r, g, b, a)
Draws a line on the screen.
overlay.load_img(contents, width, height)
Loads a texture (or an array of textures) from raw image contents (with file header). Supports PNG, JPG, GIF, APNG. Returns a texture ID that can be used with texture, or nil on failure.
overlay.load_rgba(contents, width, height)
Loads a texture from a RGBA buffer. Returns a texture ID that can be used with texture, or nil on failure.
overlay.load_svg(contents, width, height)
Loads an SVG from a string. Returns a texture ID that can be used with texture, or nil on failure.
overlay.measure_text(string, flags)
Returns width and height of text.
overlay.rectangle(x, y, w, h, r, g, b, a)
Draws a filled rectangle on the screen.
overlay.text(x, y, r, g, b, a, flags, max_width, string)
Draws text on the screen.
overlay.texture(texture, x, y, w, h, r, g, b, a, mode: optional)
Draws a texture from the texture id created from load_rgba or load_img.
overlay.triangle(x1, y1, x2, y2, x3, y3, r, g, b, a)
Draws a filled triangle on the screen. The points need to be specified in clockwise order.
overlay.wts(x, y, z)
Returns the screen coordinates of a world position or nil if the world position is not visible on the screen.