GuiObject
The shared base for visual objects: geometry, visibility, styling, focus and input.
Shared base class. You normally create a concrete control such as TextButton or Frame, then use the inherited members documented here.
Create: This base class cannot be created directly. Inherits: Instance.
Parent and children: Use Window, Frame or ScrollingFrame as the Parent. Child support depends on the concrete subclass.
Example
Section titled “Example”Where to put it: replace Src/Main.luau in a project created with this SDK. This is the complete entry file.
local Window = Instance.new("Window", { Title = "LUI example", Size = UDim2.fromOffset(560, 280),})local Status = Instance.new("TextLabel", { Parent = Window, Text = "Ready", Position = UDim2.fromOffset(16, 170), Size = UDim2.new(1, -32, 0, 72),})local Button = Instance.new("TextButton", { Parent = Window, Text = "Try it", Size = UDim2.fromOffset(220, 44), Position = UDim2.fromOffset(16, 16),})Button.AnchorPoint = Vector2.new(0.5, 0)Button.Position = UDim2.new(0.5, 0, 0, 16)Button.BackgroundColor3 = Color3.fromRGB(40, 100, 180)Button.AccessibilityLabel = "Continue to the next screen"Button.Activated:Connect(function() Status.Text = "Activated" end)Window.Visible = trueExpected result: A centered button appears. It inherits geometry, color and accessible naming from GuiObject. GuiObject itself cannot be created.
Properties
Section titled “Properties”Visible
Section titled “Visible”Whether this object participates in the visible interface. A hidden ancestor also hides its descendants.
Type: boolean. Default: true. Read/write field.
AccessibilityLabel
Section titled “AccessibilityLabel”A short accessible name, such as Search households. Provide one when the visible content does not identify the control clearly.
Type: string. Default: empty string. Read/write field.
AccessibilityDescription
Section titled “AccessibilityDescription”Additional accessible guidance. Keep the main name in AccessibilityLabel; avoid repeating it here.
Type: string. Default: empty string. Read/write field.
Width and height relative to the parent. Each axis combines a proportion of the parent with a logical-unit offset.
Type: UDim2. Default: 100% of parent. Read/write field.
Position
Section titled “Position”Position relative to the parent’s content area. A layout helper can arrange children instead of manual positioning.
Type: UDim2. Default: 0,0. Read/write field.
AnchorPoint
Section titled “AnchorPoint”The point within the object aligned to Position. Vector2.new(0.5, 0.5) anchors its center; (0, 0) anchors its top-left corner.
Type: Vector2. Default: 0,0. Read/write field.
LayoutOrder
Section titled “LayoutOrder”Ordering value used by list/grid layout. Use it to arrange children without depending on their names.
Type: number. Default: 0. Read/write field.
BackgroundColor3
Section titled “BackgroundColor3”Background color. nil leaves color selection to the native/theme behavior.
Type: Color3?. Default: nil (native/theme). Read/write field.
BackgroundTransparency
Section titled “BackgroundTransparency”Background transparency from 0 (opaque) to 1 (fully transparent). It does not set the opacity of the entire object.
Type: number. Default: 0. Read/write field.
BorderColor3
Section titled “BorderColor3”Border color; nil leaves it to native/theme behavior. BorderSizePixel controls its thickness.
Type: Color3?. Default: nil (native/theme). Read/write field.
BorderSizePixel
Section titled “BorderSizePixel”Border thickness in logical units despite the historical Pixel suffix.
Type: number. Default: 0. Read/write field.
CornerRadius
Section titled “CornerRadius”Rounded-corner radius in logical units, subject to the selected host’s control mapping.
Type: number. Default: 0. Read/write field.
Opacity
Section titled “Opacity”Overall opacity from 0 (invisible) to 1 (fully opaque), distinct from background transparency.
Type: number. Default: 1. Read/write field.
TextColor3
Section titled “TextColor3”Text color. nil inherits the applicable text/theme color.
Type: Color3?. Default: nil (inherited/theme). Read/write field.
TextSize
Section titled “TextSize”Text size in logical units. nil inherits it; the shared fallback is 14.
Type: number?. Default: nil (inherit; default 14 logical units). Read/write field.
FontFamily
Section titled “FontFamily”Font family name. nil inherits it; the fallback is System. Font availability still depends on the machine.
Type: string?. Default: nil (inherit; default System). Read/write field.
FontWeight
Section titled “FontWeight”Normal or Bold. nil inherits the weight.
Type: string?. Default: nil (inherit; Normal or Bold). Read/write field.
TextWrapped
Section titled “TextWrapped”Whether text wraps within its available width. Native editing and display controls still have their documented limits.
Type: boolean. Default: true. Read/write field.
TextXAlignment
Section titled “TextXAlignment”Horizontal text alignment: Left, Center or Right.
Type: string. Default: Left. Read/write field.
TextYAlignment
Section titled “TextYAlignment”Vertical text alignment: Top, Center or Bottom.
Type: string. Default: Top. Read/write field.
ZIndex
Section titled “ZIndex”Relative stacking order for overlapping content. Use ordinary containers/layout before depending on overlap.
Type: number. Default: 0. Read/write field.
ClipsDescendants
Section titled “ClipsDescendants”Clips children to this object’s bounds. ScrollingFrame always clips even if this property is set to false.
Type: boolean. Default: false; ScrollingFrame always clips. Read/write field.
IsFocused
Section titled “IsFocused”Whether this object currently has input focus.
Type: boolean. Default: false. Read-only.
AbsolutePosition
Section titled “AbsolutePosition”Resolved logical position after parent layout. It is a measurement, not an input property.
Type: Vector2. Default: derived. Read-only.
AbsoluteSize
Section titled “AbsoluteSize”Resolved logical width and height after layout, including constraints.
Type: Vector2. Default: derived. Read-only.
Methods
Section titled “Methods”Requests input focus and returns whether it was accepted. Focusability and visibility depend on the control and host.
Focus() -> booleanSignals
Section titled “Signals”Focused
Section titled “Focused”Fires when the object gains focus. No arguments are passed.
Type: Signal. Subscribe with :Connect(function(...) ... end).
FocusLost
Section titled “FocusLost”Fires when the object loses focus. No arguments are passed.
Type: Signal. Subscribe with :Connect(function(...) ... end).
MouseEnter
Section titled “MouseEnter”Fires when the mouse enters the object. No arguments are passed; use InputChanged when you need a pointer position.
Type: Signal. Subscribe with :Connect(function(...) ... end).
MouseLeave
Section titled “MouseLeave”Fires when the mouse leaves the object. No arguments are passed.
Type: Signal. Subscribe with :Connect(function(...) ... end).
InputBegan
Section titled “InputBegan”Receives an InputEvent for a pointer press or key press. Check Device before reading pointer-only fields.
Type: InputSignal. Subscribe with :Connect(function(...) ... end).
InputChanged
Section titled “InputChanged”Receives a changed input record, such as pointer movement. Position is local logical geometry, not a screen-pixel coordinate.
Type: InputSignal. Subscribe with :Connect(function(...) ... end).
InputEnded
Section titled “InputEnded”Receives released or canceled input. For pointer input, inspect IsCanceled before treating it as a completed action.
Type: InputSignal. Subscribe with :Connect(function(...) ... end).
Inherited members
Section titled “Inherited members”You can use these directly on GuiObject. Follow a member link for its explanation and example.
From Instance
Section titled “From Instance”Name · Sensitive · EffectiveSensitive · Parent · ClassName · Destroy · Clone · GetChildren · GetDescendants · FindFirstChild · IsA · Changed · Destroying
Full type declaration — for type checking and deeper reference
The declaration is generated from the SDK. Self is supplied by a colon call; read means the field cannot be assigned. See how to read this reference.
export type GuiObject = Instance & { Visible: boolean, AccessibilityLabel: string, AccessibilityDescription: string, Size: UDim2, Position: UDim2, AnchorPoint: Vector2, LayoutOrder: number, BackgroundColor3: Color3?, BackgroundTransparency: number, BorderColor3: Color3?, BorderSizePixel: number, CornerRadius: number, Opacity: number, TextColor3: Color3?, TextSize: number?, FontFamily: string?, FontWeight: string?, TextWrapped: boolean, TextXAlignment: string, TextYAlignment: string, ZIndex: number, ClipsDescendants: boolean, read IsFocused: boolean, read AbsolutePosition: Vector2, read AbsoluteSize: Vector2, read Focus: (Self: GuiObject) -> boolean, read Focused: Signal, read FocusLost: Signal, read MouseEnter: Signal, read MouseLeave: Signal, read InputBegan: InputSignal, read InputChanged: InputSignal, read InputEnded: InputSignal,}Availability and deeper reading
Section titled “Availability and deeper reading”See platform limits before relying on host-specific behavior. The framework design specification and reflection/type sources are deeper engineering references, not extra setup required to build an app.