Empty
Empty
Empty
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
Types | Details |
---|---|
ClipToDeviceSafeArea | Ritaglia i contenuti nell'area sicura del dispositivo. |
DisplayOrder | Controlla l'ordine Z-index degli ScreenGui, con valori più alti che vengono renderizzati sopra. |
IgnoreGuiInset | Determina se ScreenGui si sovrappone agli elementi UI principali di Roblox. |
ScreenInsets | Definisce la regione di visualizzazione sullo schermo. |
CoreUISafeInsets
CoreUISafeInsets | Mantiene gli elementi UI all'interno dell'area sicura del Core UI, evitando i pulsanti della barra superiore e i tagli dello schermo (impostazione predefinita). |
None | Nessun vincolo dell'area sicura; gli elementi UI potrebbero essere oscurati dal Core UI o dai tagli del dispositivo, adatto per contenuti non interattivi. |
TopbarSafeInsets | Garantisce che gli elementi UI siano mantenuti tra i controlli Roblox più a sinistra e l'area sicura del dispositivo, regolando dinamicamente per evitare collisioni. |
DeviceSafeInsets | Applica margini per l'intera area sicura del dispositivo, evitando tagli o tacche dello schermo. |
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
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è