Skip to content

Drawing

Functions for creating visual overlays rendered on top of the game. Drawing objects persist across frames and can be updated in real-time.

Drawing.new

Creates a new drawing object of the specified type.

lua
Drawing.new(type: string) -> DrawingObject
ParameterTypeDescription
typestringThe type of drawing object to create

Valid Types

TypeDescription
LineA line between two points
TextRendered text
ImageAn image from a URL or file
CircleA circle shape
SquareA rectangle shape
TriangleA triangle with three vertices
QuadA quadrilateral with four vertices

Common Properties

All drawing objects share these properties:

PropertyTypeDescription
VisiblebooleanWhether the object is visible
ZIndexnumberRender order (higher = on top)
TransparencynumberOpacity (0 = invisible, 1 = fully visible)
ColorColor3The object's color
Remove()methodDestroys the drawing object

Line Properties

PropertyTypeDescription
FromVector2Start point
ToVector2End point
ThicknessnumberLine width in pixels

Text Properties

PropertyTypeDescription
TextstringThe text content
SizenumberFont size
FontDrawing.FontsFont family
CenterbooleanWhether to center horizontally
OutlinebooleanWhether to add outline
OutlineColorColor3Outline color
PositionVector2Text position
TextBoundsVector2(read-only) Computed text size

Circle Properties

PropertyTypeDescription
PositionVector2Center position
RadiusnumberCircle radius
ThicknessnumberOutline thickness
FilledbooleanWhether the circle is filled
NumSidesnumberNumber of segments

Square Properties

PropertyTypeDescription
PositionVector2Top-left position
SizeVector2Width and height
ThicknessnumberOutline thickness
FilledbooleanWhether the square is filled

Triangle Properties

PropertyTypeDescription
PointAVector2First vertex
PointBVector2Second vertex
PointCVector2Third vertex
ThicknessnumberOutline thickness
FilledbooleanWhether filled

Quad Properties

PropertyTypeDescription
PointAVector2First vertex
PointBVector2Second vertex
PointCVector2Third vertex
PointDVector2Fourth vertex
ThicknessnumberOutline thickness
FilledbooleanWhether filled

Image Properties

PropertyTypeDescription
DatastringRaw image data
PositionVector2Top-left position
SizeVector2Width and height
RoundingnumberCorner rounding radius

Example

lua
-- Create an ESP box
local box = Drawing.new("Square")
box.Visible = true
box.Color = Color3.fromRGB(255, 0, 0)
box.Thickness = 1
box.Size = Vector2.new(100, 150)
box.Position = Vector2.new(200, 200)
box.Filled = false

-- Create text label
local text = Drawing.new("Text")
text.Visible = true
text.Color = Color3.fromRGB(255, 255, 255)
text.Text = "Player Name"
text.Size = 16
text.Font = Drawing.Fonts.Plex
text.Outline = true
text.Position = Vector2.new(250, 185)
text.Center = true

-- Cleanup
task.wait(5)
box:Remove()
text:Remove()

Drawing.Fonts

Font enum for text drawing objects.

NameValueDescription
Drawing.Fonts.UI0Default UI font
Drawing.Fonts.System1System font
Drawing.Fonts.Plex2IBM Plex font
Drawing.Fonts.Monospace3Monospace font

getrenderproperty

Reads a property from a Drawing object. This is the explicit __index for Drawing objects.

lua
getrenderproperty(object: DrawingObject, property: string) -> any
ParameterTypeDescription
objectDrawingObjectThe Drawing object to read from
propertystringThe property name

Example

lua
local circle = Drawing.new("Circle")
circle.Radius = 50

local radius = getrenderproperty(circle, "Radius")
print(radius) --> 50
circle:Remove()

setrenderproperty

Sets a property on a Drawing object. This is the explicit __newindex for Drawing objects.

lua
setrenderproperty(object: DrawingObject, property: string, value: any) -> void
ParameterTypeDescription
objectDrawingObjectThe Drawing object to modify
propertystringThe property name
valueanyThe value to set

Example

lua
local text = Drawing.new("Text")
setrenderproperty(text, "Text", "Hello!")
setrenderproperty(text, "Size", 24)
setrenderproperty(text, "Visible", true)
setrenderproperty(text, "Position", Vector2.new(100, 100))
task.wait(3)
text:Remove()

cleardrawcache

Removes all active drawing objects at once.

lua
cleardrawcache() -> void

Example

lua
-- Create some drawings
local circle = Drawing.new("Circle")
circle.Visible = true
circle.Position = Vector2.new(400, 300)
circle.Radius = 50

-- Clear everything
cleardrawcache()