Slider
A numeric slider control.
Syntax
Signature
Drawing.create("Slider", Properties: table?) -> DrawingControlAliases
This function has no aliases.
Parameters
| Parameter | Type | Description |
|---|---|---|
Properties | table? | Initial property values. Omitted properties use the defaults below. |
Returns
| Type | Description |
|---|---|
DrawingControl | A 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.
| Property | Type | Default / behavior |
|---|---|---|
Text | string | Defaults to ""; up to 65536 UTF-8 bytes. |
TextColor3 | Color3 | Defaults to RGB(235, 235, 238). |
TextSize | number | Defaults to 16 pixels. |
Font | number | Defaults to Drawing.Fonts.Monospace. |
Padding | number | Defaults to 6 pixels. |
Min / Max | number | Defaults to 0 and 100. |
Value | number | Defaults to 0. Pointer dragging maps the horizontal position to the range. |
Events
| Event | Arguments | Description |
|---|---|---|
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
Observe Value with GetPropertyChangedSignal. Direct assignments must be finite numbers and are not automatically clamped to Min and Max.
Example
Luau
local Control = Drawing.create("Slider", {Text = "Speed", Min = 0, Max = 100, Value = 50})
Control:GetPropertyChangedSignal("Value"):Connect(function() print(Control.Value) end)