Frame
Displays a rectangle and contains GUI instances.
Behavior
Frame provides a background rectangle and a container for GUI children.
Size and Position use UDim2 values to combine
parent-relative scale with pixel offsets.
Summary
The resolved position in pixels from the top-left of the screen.
The resolved rotation of this interface element in degrees, including ancestor rotation.
The read-only resolved dimensions in pixels.
Whether the frame consumes input instead of passing it to GUI instances behind it.
The point within the frame used by Position.
The dimensions that resize to fit the element's content.
The background fill color.
The background transparency, from 0 (opaque) to 1 (invisible).
The color of the element's border.
Whether the border is drawn outside, across, or inside the element's bounds.
The border width in pixels.
Whether child rendering is clipped at the frame boundaries.
The corner radius used for the element's rounded background.
The individual corner radii used for the element's rounded background.
Whether pointer dragging can move the element.
The share of remaining main-axis space assigned to this child in flow layout.
The element's current idle, hover, pressed, or non-interactable state.
Which input events this element consumes before they reach elements behind it.
Whether the element accepts interaction.
Whether children use flow layout or their explicit positions.
The ordering value used by a parent layout such as UIListLayout or UIGridLayout.
The interface element selected when navigating down from this element.
The interface element selected when navigating left from this element.
The interface element selected when navigating right from this element.
The interface element selected when navigating up from this element.
The opacity multiplier applied to this element and its descendants.
The position relative to the parent, measured at AnchorPoint.
The interface rotation in degrees.
Whether interface navigation can select this element.
The interface element used to draw the selection indicator.
The numeric order used for interface selection traversal.
The frame dimensions as a UDim2.
The parent axes used to resolve relative interface size.
Whether the frame and its descendants are rendered.
The rendering order among siblings.
Gives keyboard focus to this interface element.
Returns this instance if it is an ExecutionGroup.
Removes keyboard focus from this interface element.
Fires when pointer dragging of the element begins.
Fires when pointer dragging of the element ends.
Fires when input begins over the frame.
Fires when input dispatched to this element changes.
Fires when input dispatched to this element ends.
Fires when the mouse wheel scrolls backward over this element.
Fires when the mouse wheel scrolls forward over this element.
Fires when the pointer enters the frame.
Fires when the pointer leaves the frame.
Fires when the pointer moves across the object.
Fires when interface navigation selects this element.
Fires when this element loses interface selection.
Properties
AbsolutePosition
Frame.AbsolutePosition: Vector2 = Vector2.new(0, 0)The resolved position in pixels from the top-left of the screen.
AbsoluteRotation
Frame.AbsoluteRotation: number = 0The resolved rotation of this interface element in degrees, including ancestor rotation.
AbsoluteSize
Frame.AbsoluteSize: Vector2 = Vector2.new(0, 0)The read-only resolved dimensions in pixels.
Active
Frame.Active: boolean = falseWhether the frame consumes input instead of passing it to GUI instances behind it.
AnchorPoint
Frame.AnchorPoint: Vector2 = Vector2.new(0, 0)The point within the frame used by Position. (0, 0) is the top-left corner and is the default. (0.5, 0.5) is the center; (1, 1) is the bottom-right corner.
AutomaticSize
Frame.AutomaticSize: Enum.AutomaticSize = Enum.AutomaticSize.NoneThe dimensions that resize to fit the element's content.
BackgroundColor3
Frame.BackgroundColor3: Color3 = Color3.new(0.6392157, 0.63529414, 0.64705884)The background fill color.
BackgroundTransparency
Frame.BackgroundTransparency: number = 0The background transparency, from 0 (opaque) to 1 (invisible). This does not change child transparency.
BorderColor3
Frame.BorderColor3: Color3 = Color3.new(0.105882354, 0.16470589, 0.20784314)The color of the element's border.
BorderMode
Frame.BorderMode: Enum.BorderMode = Enum.BorderMode.OutlineWhether the border is drawn outside, across, or inside the element's bounds.
BorderSizePixel
Frame.BorderSizePixel: number = 1The border width in pixels. Set to 0 to hide the border.
ClipsDescendants
Frame.ClipsDescendants: boolean = falseWhether child rendering is clipped at the frame boundaries.
CornerRadius
Frame.CornerRadius: number = 0The corner radius used for the element's rounded background.
Corners
Frame.Corners: { number } = {}The individual corner radii used for the element's rounded background.
Draggable
Frame.Draggable: boolean = falseWhether pointer dragging can move the element.
Grow
Frame.Grow: number = 0The share of remaining main-axis space assigned to this child in flow layout.
GuiState
Frame.GuiState: Enum.GuiState = Enum.GuiState.IdleThe element's current idle, hover, pressed, or non-interactable state.
InputSink
Frame.InputSink: Enum.InputSink = Enum.InputSink.NoneWhich input events this element consumes before they reach elements behind it.
Interactable
Frame.Interactable: boolean = trueWhether the element accepts interaction.
Layout
Frame.Layout: Enum.Layout = Enum.Layout.FlowWhether children use flow layout or their explicit positions.
LayoutOrder
Frame.LayoutOrder: number = 0The ordering value used by a parent layout such as UIListLayout or UIGridLayout.
NextSelectionDown
Frame.NextSelectionDown: GuiObject? = nilThe interface element selected when navigating down from this element.
NextSelectionLeft
Frame.NextSelectionLeft: GuiObject? = nilThe interface element selected when navigating left from this element.
NextSelectionRight
Frame.NextSelectionRight: GuiObject? = nilThe interface element selected when navigating right from this element.
NextSelectionUp
Frame.NextSelectionUp: GuiObject? = nilThe interface element selected when navigating up from this element.
Opacity
Frame.Opacity: number = 1The opacity multiplier applied to this element and its descendants.
Position
The position relative to the parent, measured at AnchorPoint.
Rotation
Frame.Rotation: number = 0The interface rotation in degrees.
Selectable
Frame.Selectable: boolean = falseWhether interface navigation can select this element.
SelectionImageObject
Frame.SelectionImageObject: GuiObject? = nilThe interface element used to draw the selection indicator.
SelectionOrder
Frame.SelectionOrder: number = 0The numeric order used for interface selection traversal.
Size
The frame dimensions as a UDim2. Scale is relative to the parent; offset is added in pixels.
SizeConstraint
Frame.SizeConstraint: Enum.SizeConstraint = Enum.SizeConstraint.RelativeXYThe parent axes used to resolve relative interface size.
Visible
Frame.Visible: boolean = trueWhether the frame and its descendants are rendered. Hidden GUI instances do not receive input.
ZIndex
Frame.ZIndex: number = 1The rendering order among siblings. Higher values render in front.
Methods
CaptureFocus
Frame:CaptureFocus(): ()Gives keyboard focus to this interface element.
GetExecutionGroup
Frame:GetExecutionGroup(): ExecutionGroup?Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.
ReleaseFocus
Frame:ReleaseFocus(): ()Removes keyboard focus from this interface element.
Events
DragBegin
Frame.DragBegin: RBXScriptSignalFires when pointer dragging of the element begins.
DragStopped
Frame.DragStopped: RBXScriptSignalFires when pointer dragging of the element ends.
InputBegan
Frame.InputBegan: RBXScriptSignalFires when input begins over the frame.
InputChanged
Frame.InputChanged: RBXScriptSignalFires when input dispatched to this element changes.
InputEnded
Frame.InputEnded: RBXScriptSignalFires when input dispatched to this element ends.
MouseWheelBackward
Frame.MouseWheelBackward: RBXScriptSignalFires when the mouse wheel scrolls backward over this element.
MouseWheelForward
Frame.MouseWheelForward: RBXScriptSignalFires when the mouse wheel scrolls forward over this element.
PointerEntered
Frame.PointerEntered: RBXScriptSignalFires when the pointer enters the frame.
PointerExited
Frame.PointerExited: RBXScriptSignalFires when the pointer leaves the frame.
PointerMoved
Frame.PointerMoved: RBXScriptSignalFires when the pointer moves across the object.
SelectionGained
Frame.SelectionGained: RBXScriptSignalFires when interface navigation selects this element.
SelectionLost
Frame.SelectionLost: RBXScriptSignalFires when this element loses interface selection.
Inherited members
- Properties
- CatchesPointer
- Properties
- ArchivableClassNameNameParent
- Methods
- AddComponent()AddTag()ClearAllChildren()ClearTags()Clone()Destroy()FindFirstAncestor()FindFirstAncestorOfClass()FindFirstAncestorWhichIsA()FindFirstChild()FindFirstChildOfClass()FindFirstChildWhichIsA()FindFirstDescendant()GetAttribute()GetAttributeChangedSignal()GetAttributes()GetChildren()GetComponent()GetComponentChangedSignal()GetComponents()GetDebugId()GetDescendants()GetFullName()GetPropertyChangedSignal()GetReferencing()GetTags()HasComponent()HasTag()IsA()IsAncestorOf()IsDescendantOf()RemoveComponent()RemoveTag()SetAttribute()WaitForChild()
- Events
- AncestryChangedAttributeChangedChangedChildAddedChildRemovedDescendantAddedDescendantRemovingDestroying
Example
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0.5, 0, 0, 80)
frame.BackgroundTransparency = 1Related APIs
TextLabel · TextButton · ScreenGui · UDim2