Drawing.new
Creates a Drawing object.
Syntax
Signature
Drawing.new(Type: string) -> DrawingObject | DrawingControlAliases
This function has no aliases.
Parameters
| Parameter | Type | Description |
|---|---|---|
Type | string | Primitive type or installed retained control kind. |
Returns
| Type | Description |
|---|---|
DrawingObject | DrawingControl | New 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)