ReferenceDrawing

Drawing.new

Creates a drawing primitive over the game view.

Syntax

Drawing.new(kind: string) -> DrawingObject

Parameters

ParameterTypeDescription
kindstringPrimitive name with its documented capitalization.

Returns

TypeDescription
DrawingObjectNew drawing handle.

Description

Supported kinds are Line, Circle, Square, Triangle, Quad, Text and Image. New objects are initially invisible; assign their properties before setting Visible to true. The returned Lua value is a Drawing handle, not a parentable Instance. Apex mirrors Line, Square, Circle and Text into ordinary CoreGui Instances so they participate in Roblox rendering and capture; the mirror is hidden while CaptureService reports an active capture. Image and polygon kinds remain host-overlay only. Remove Drawing objects when they are no longer needed.

Common properties are Visible, Color, Transparency and ZIndex. Transparency is opacity: 1 is fully visible and 0 is invisible. Line uses From, To and Thickness; Square and Image use Position and Size; Circle uses Position, Radius, NumSides and Filled; Triangle uses PointA through PointC; Quad adds PointD. Text uses Text, Position, Size, Font, Center, Outline and OutlineColor; TextBounds is read-only. Multiline text supports LF, CRLF and CR line breaks; its bounds include the widest line and the height of all lines. Image.Data accepts encoded image bytes.

Example

local label = Drawing.new("Text")
label.Text = "Apex example"
label.Position = Vector2.new(40, 40)
label.Size = 20
label.Color = Color3.new(1, 1, 1)
label.Transparency = 1
label.Visible = true
task.delay(5, function() label:Remove() end)

Notes

These are Game executor contracts. Check build requirements and session lifetimes before using them.