Category

Drawing

2D drawing objects, 3D drawing, the camera helper, ESP and toasts.

Pages in this category

2D drawing: Drawing

Drawing.new(kind) creates an object that is drawn on top of the game every frame until you remove it.

Kinds: "Square", "Text", "Line", "Circle", "Triangle". Any other name raises an error. There can be at most 2000 live objects.

local box = Drawing.new("Square")
box.Position = Vector2.new(100, 100)
box.Size = Vector2.new(200, 80)
box.Color = Color3.fromRGB(255, 80, 80)
box.Filled = true
box.Visible = true

Objects start hidden. Set Visible = true to show them.

Properties

Set a property by assigning to it. Reading returns the value you last set.

PropertyTypeUsed byNotes
VisiblebooleanallDefault false
ColorColor3allDefault white
Transparencynumberall1 is fully visible, 0 is invisible. Default 1
ZIndexnumberallHigher draws on top. Default 0
PositionVector2Square, Text, CircleTop-left for squares and text
From, PointAVector2Line, TriangleSame as Position
To, PointBVector2Line, TriangleEnd point
PointCVector2TriangleThird point
SizeVector2 or numberSquare (Vector2), Text (number)For text, the font size. Default 18 if invalid
ThicknessnumberSquare, Line, Circle, TriangleOutline width. Default 1
FilledbooleanSquare, Circle, TriangleDefault false
RadiusnumberCircleDefault 8 if invalid
TextstringText
CenterbooleanTextCentre the text on Position
OutlinebooleanTextDraw a dark outline around the text

Properties that do not apply to a kind are stored but have no effect.

Drawing.Fonts exists (UI, System, Plex, Monospace) but setting a Font property currently has no effect.

Methods

object:Remove()

Deletes the object. Alias: object:Destroy(). After removal, assignments are ignored.

Global helpers

cleardrawcache()

Removes every Drawing object.

isrenderobj(obj)

Returns true if obj is a Drawing object.

Example: draw every frame

local label = Drawing.new("Text")
label.Size = 16
label.Outline = true
label.Visible = true

RunService.RenderStepped:Connect(function()
  local p = mc.getPlayer()
  if p then
    label.Position = Vector2.new(10, 10)
    label.Text = string.format("%.1f %.1f %.1f", p.x, p.y, p.z)
  end
end)

In this category