Drawing.new

Creates a Drawing object.

Syntax

Signature
Drawing.new(Type: string) -> DrawingObject | DrawingControl

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
TypestringPrimitive type or installed retained control kind.

Returns

TypeDescription
DrawingObject | DrawingControlNew drawing userdata or retained control table.

Notes

Types are Line, Square, Circle, Triangle, Quad, Text, Image, Blur, and Panel. Panel is an alias for Square. Primitives start hidden and at most 4096 can be registered. When the retained UI library is installed, this function also accepts its control kinds, such as TextBox and Frame.

For native primitives, Transparency is opacity: 0 is invisible and 1 is opaque. Retained controls use their own BackgroundTransparency and TextTransparency properties.

Example

Luau
local Text = Drawing.new("Text")
Text.Text = "Hello, Vortex"
Text.Position = Vector2.new(30, 30)
Text.Visible = true
task.delay(5, function() Text:Remove() end)