UI library

Build reusable frames, textboxes, buttons and interactive controls.

Layout and appearance

PropertyTypeDescription
ParentDrawingControl?Parent control; positions are relative to its top-left corner. Cycles are rejected.
Position / SizeVector2Position and dimensions in pixels.
AbsolutePosition / AbsoluteSizeVector2Calculated client-space bounds after a UI update.
Visible / ActivebooleanVisibility and pointer interaction.
ZIndexnumberRelative draw layer, combined with ancestor layers.
BackgroundColor3Color3Background fill color.
BackgroundTransparencynumber0 is opaque; 1 is transparent, unlike primitive Transparency.
DraggablebooleanAllow dragging this control with the left mouse button.
ClipsDescendantsbooleanClip descendants to this control’s rectangle.
CanvasSize / ScrollOffsetnumberScrollingFrame content height and vertical scroll offset.

Text and values

PropertyTypeDescription
TextstringUTF-8 text, limited to 65536 bytes.
TextColor3 / PlaceholderColor3Color3Normal text and placeholder colors.
TextSize / Font / PaddingnumberFont size, Drawing.Fonts identifier and horizontal padding.
PlaceholderTextstringShown when an unfocused textbox is empty.
TextEditable / ClearTextOnFocusbooleanAllow editing, or clear contents when focus is acquired.
MultilinebooleanEnter inserts a newline; Ctrl+Enter submits.
MaxLengthnumberMaximum UTF-8 byte length.
Cursor / AnchornumberZero-based UTF-8 byte offsets defining the caret and selection.
Valueboolean | numberCheckbox state or slider value.
Min / MaxnumberSlider range.
ImagestringEncoded image bytes for ImageLabel.

Control events

EventArgumentsDescription
Focused()Textbox acquired keyboard focus.
FocusLostsubmitted: booleanTextbox lost focus; true indicates submission.
TextChangedtext: stringTextbox contents changed.
Changedproperty: stringA property changed.
InputBegankey: string, control: boolean, shift: booleanKey received by the focused textbox.
MouseButton1Click()Press and release completed inside the control.
MouseButton1Down / MouseButton1Up()Left mouse press or release.

Available functions