Empty
Empty
Empty
ScreenGui is a container for 2D user interface elements in Roblox, displayed on the player's screen. It provides essential controls and information.
** Must be parented to PlayerGui to be visible. Using StarterGui ensures it clones into each player's PlayerGui on joining.
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = game.Players.LocalPlayer: WaitForChild("PlayerGui")
ScreenGui Properties
Types | Details |
---|---|
ClipToDeviceSafeArea | Clips contents to the device's safe area. |
DisplayOrder | Controls the Z-index order of ScreenGuis, with higher values rendering on top. |
IgnoreGuiInset | Determines whether the ScreenGui overflows into Roblox's core UI elements. |
ScreenInsets | Defines the display region on screen. |
CoreUISafeInsets
CoreUISafeInsets | Keeps UI elements within the core UI safe area, avoiding top bar buttons and screen cutouts (default). |
None | No safe area constraints; UI elements may be obscured by core UI or device cutouts, suitable for non-interactive content. |
TopbarSafeInsets | Ensures UI elements are kept between the left-most Roblox controls and the device safe area, adjusting dynamically to avoid collisions. |
DeviceSafeInsets | Applies insets for the entire device's safe area, avoiding any screen cutouts or notches. |
Empty
Empty
Empty
Roblox Studio
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Display_CoreUISafeInsets"
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
screenGui.ScreenInsets = Enum.ScreenInsets.CoreUISafeInsets
local frame = Instance.new("Frame")
frame.Size = UDim2.new(1, 0, 1, 0)
frame.Position = UDim2.new(0, 0, 0, 0)
frame.BackgroundTransparency = 0.5
frame.BackgroundColor3 = Color3.fromRGB(255, 0, 0) -- Red for CoreUISafeInsets
frame.Parent = screenGui
local label = Instance.new("TextLabel")
label.Text = "CoreUISafeInsets"
label.BackgroundTransparency = 0
label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
label.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
label.Size = UDim2.new(0.3, 0, 0.1, 0)
label.Position = UDim2.new(0.35, 0, 0.45, 0)
label.Parent = frame
Empty
Empty
Empty
Roblox Studio
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Display_None"
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
screenGui.ScreenInsets = Enum.ScreenInsets.None
local frame = Instance.new("Frame")
frame.Size = UDim2.new(1, 0, 1, 0)
frame.Position = UDim2.new(0, 0, 0, 0)
frame.BackgroundTransparency = 0.5
frame.BackgroundColor3 = Color3.fromRGB(0, 255, 0) -- Green for None
frame.Parent = screenGui
local label = Instance.new("TextLabel")
label.Text = "None"
label.BackgroundTransparency = 0
label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
label.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
label.Size = UDim2.new(0.3, 0, 0.1, 0)
label.Position = UDim2.new(0.35, 0, 0.45, 0)
label.Parent = frame
Empty
Empty
Empty
Roblox Studio
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Display_TopbarSafeInsets"
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
screenGui.ScreenInsets = Enum.ScreenInsets.TopbarSafeInsets
local frame = Instance.new("Frame")
frame.Size = UDim2.new(1, 0, 1, 0)
frame.Position = UDim2.new(0, 0, 0, 0)
frame.BackgroundTransparency = 0.5
frame.BackgroundColor3 = Color3.fromRGB(0, 0, 255) -- Blue for TopbarSafeInsets
frame.Parent = screenGui
local label = Instance.new("TextLabel")
label.Text = "TopbarSafeInsets"
label.BackgroundTransparency = 0
label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
label.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
label.Size = UDim2.new(0.3, 0, 0.1, 0)
label.Position = UDim2.new(0.35, 0, 0.45, 0)
label.Parent = frame
Empty
Empty
Empty
Roblox Studio
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Display_DeviceSafeInsets"
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
screenGui.ScreenInsets = Enum.ScreenInsets.DeviceSafeInsets
local frame = Instance.new("Frame")
frame.Size = UDim2.new(1, 0, 1, 0)
frame.Position = UDim2.new(0, 0, 0, 0)
frame.BackgroundTransparency = 0.5
frame.BackgroundColor3 = Color3.fromRGB(255, 255, 0) -- Yellow for DeviceSafeInsets
frame.Parent = screenGui
local label = Instance.new("TextLabel")
label.Text = "DeviceSafeInsets"
label.BackgroundTransparency = 0
label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
label.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
label.Size = UDim2.new(0.3, 0, 0.1, 0)
label.Position = UDim2.new(0.35, 0, 0.45, 0)
label.Parent = frame