Drawing
The Drawing library creates persistent visual overlays rendered above the game viewport.
Constructor
Drawing.new(type: "Line" | "Circle" | "Square" | "Triangle" | "Text" | "Image" | "Quad") -> DrawingObjectlocal 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 = trueFunctions
| Function | Description |
|---|---|
cleardrawcache | Remove all drawing objects |
getrenderproperty | Read an object property |
isrenderobj | Test whether a value is a drawing object |
setrenderproperty | Assign an object property |
DrawFont.Register | Register a font from memory |
DrawingImmediate | Draw 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
| Property | Type |
|---|---|
Visible | boolean |
ZIndex | number |
Transparency | number |
Color | Color3 |
__OBJECT_EXISTS | boolean (read-only) |
Line
| Property | Type |
|---|---|
From | Vector2 |
To | Vector2 |
Thickness | number |
Circle
| Property | Type |
|---|---|
Position | Vector2 |
Radius | number |
NumSides | number |
Thickness | number |
Filled | boolean |
Square
| Property | Type |
|---|---|
Position | Vector2 |
Size | Vector2 |
Thickness | number |
Filled | boolean |
Triangle
| Property | Type |
|---|---|
PointA | Vector2 |
PointB | Vector2 |
PointC | Vector2 |
Thickness | number |
Filled | boolean |
Quad
| Property | Type |
|---|---|
PointA | Vector2 |
PointB | Vector2 |
PointC | Vector2 |
PointD | Vector2 |
Thickness | number |
Filled | boolean |
Text
| Property | Type | Notes |
|---|---|---|
Text | string | Displayed text |
TextBounds | Vector2 | Read-only calculated bounds |
Font | Drawing.Fonts | DrawFont | Legacy font ID or registered font |
Size | number | Font size |
Position | Vector2 | Draw position |
Center, Centered | boolean | Equivalent names |
Outline, Outlined | boolean | Equivalent names |
OutlineColor | Color3 | Outline color |
OutlineOpacity | number | Outline opacity |
Image
| Property | Type | Notes |
|---|---|---|
Data | string | Encoded image data |
Size | Vector2 | Draw size |
Position | Vector2 | Draw position |
Rounding | number | Corner rounding |
Loaded | boolean | Read-only load state |
Legacy Fonts
Drawing.Fonts.UI -- 0
Drawing.Fonts.System -- 1
Drawing.Fonts.Plex -- 2
Drawing.Fonts.Monospace -- 3Cleanup
local circle = Drawing.new("Circle")
circle.Visible = true
-- Later
circle:Remove()
print(circle.__OBJECT_EXISTS) -- false