TextLabel

Displays text.

Syntax

Signature
Drawing.create("TextLabel", Properties: table?) -> DrawingControl

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
Propertiestable?Initial property values. Omitted properties use the defaults below.

Returns

TypeDescription
DrawingControlA live control. Call Destroy to remove it and its descendants.

Properties

Inherits the shared layout properties. Positions are relative to Parent. BackgroundTransparency is 0 for opaque and 1 for transparent.

PropertyTypeDefault / behavior
TextstringDefaults to ""; up to 65536 UTF-8 bytes.
TextColor3Color3Defaults to RGB(235, 235, 238).
TextSizenumberDefaults to 16 pixels.
FontnumberDefaults to Drawing.Fonts.Monospace.
PaddingnumberDefaults to 6 pixels.

Events

EventArgumentsDescription
MouseButton1Down()Left mouse button pressed inside the control.
MouseButton1Up()Left mouse button released after a press.
MouseButton1Click()Press and release completed inside the control.

Every control supports Changed and GetPropertyChangedSignal(Property). UseDestroy()to remove a control and its children.

Notes

Use TextSize, Font, TextColor3, TextTransparency, and TextXAlignment to control its appearance.

Example

Luau
local Control = Drawing.create("TextLabel", {Text = "Hello", Size = Vector2.new(200, 30)})