ScreenGui

ScreenGui è un contenitore per elementi dell'interfaccia utente 2D in Roblox, visualizzati sullo schermo del giocatore. Fornisce controlli essenziali e informazioni.

** Deve essere parentato a PlayerGui per essere visibile. Utilizzando StarterGui si garantisce che venga clonato in ogni PlayerGui all'entrata del giocatore.
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = game.Players.LocalPlayer: WaitForChild("PlayerGui")

Proprietà di ScreenGui

TypesDetails
ClipToDeviceSafeAreaRitaglia i contenuti nell'area sicura del dispositivo.
DisplayOrderControlla l'ordine Z-index degli ScreenGui, con valori più alti che vengono renderizzati sopra.
IgnoreGuiInsetDetermina se ScreenGui si sovrappone agli elementi UI principali di Roblox.
ScreenInsetsDefinisce la regione di visualizzazione sullo schermo.

CoreUISafeInsets

CoreUISafeInsetsMantiene gli elementi UI all'interno dell'area sicura del Core UI, evitando i pulsanti della barra superiore e i tagli dello schermo (impostazione predefinita).
NoneNessun vincolo dell'area sicura; gli elementi UI potrebbero essere oscurati dal Core UI o dai tagli del dispositivo, adatto per contenuti non interattivi.
TopbarSafeInsetsGarantisce che gli elementi UI siano mantenuti tra i controlli Roblox più a sinistra e l'area sicura del dispositivo, regolando dinamicamente per evitare collisioni.
DeviceSafeInsetsApplica margini per l'intera area sicura del dispositivo, evitando tagli o tacche dello schermo.
Image 1
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
Image 1
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
Image 1
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
Image 1
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

Se hai trovato utile questo tutorial e desideri supportare il mio lavoro, considera di offrirmi un caffè.

Grazie mille per il tuo supporto!

Offrimi un caffè