Drawing

The Drawing library creates persistent visual overlays rendered above the game viewport.

Constructor

Drawing.new(type: "Line" | "Circle" | "Square" | "Triangle" | "Text" | "Image" | "Quad") -> DrawingObject
local line = Drawing.new("Line")
line.From = Vector2.new(0, 0)
line.To = Vector2.new(100, 100)
line.Color = Color3.fromRGB(255, 0, 0)
line.Thickness = 2
line.Visible = true

Functions

FunctionDescription
cleardrawcacheRemove all drawing objects
getrenderpropertyRead an object property
isrenderobjTest whether a value is a drawing object
setrenderpropertyAssign an object property
DrawFont.RegisterRegister a font from memory
DrawingImmediateDraw from a per-frame paint callback

DrawingObject

Every drawing object exposes Remove() and Destroy(). Both stop the object from rendering. The read-only __OBJECT_EXISTS property reports whether it still exists.

Common Properties

PropertyType
Visibleboolean
ZIndexnumber
Transparencynumber
ColorColor3
__OBJECT_EXISTSboolean (read-only)

Line

PropertyType
FromVector2
ToVector2
Thicknessnumber

Circle

PropertyType
PositionVector2
Radiusnumber
NumSidesnumber
Thicknessnumber
Filledboolean

Square

PropertyType
PositionVector2
SizeVector2
Thicknessnumber
Filledboolean

Triangle

PropertyType
PointAVector2
PointBVector2
PointCVector2
Thicknessnumber
Filledboolean

Quad

PropertyType
PointAVector2
PointBVector2
PointCVector2
PointDVector2
Thicknessnumber
Filledboolean

Text

PropertyTypeNotes
TextstringDisplayed text
TextBoundsVector2Read-only calculated bounds
FontDrawing.Fonts | DrawFontLegacy font ID or registered font
SizenumberFont size
PositionVector2Draw position
Center, CenteredbooleanEquivalent names
Outline, OutlinedbooleanEquivalent names
OutlineColorColor3Outline color
OutlineOpacitynumberOutline opacity

Image

PropertyTypeNotes
DatastringEncoded image data
SizeVector2Draw size
PositionVector2Draw position
RoundingnumberCorner rounding
LoadedbooleanRead-only load state

Legacy Fonts

Drawing.Fonts.UI        -- 0
Drawing.Fonts.System    -- 1
Drawing.Fonts.Plex      -- 2
Drawing.Fonts.Monospace -- 3

Cleanup

local circle = Drawing.new("Circle")
circle.Visible = true

-- Later
circle:Remove()
print(circle.__OBJECT_EXISTS) -- false