Empty
Empty
Empty
ScreenGui é um contêiner para elementos de interface de usuário 2D no Roblox, exibidos na tela do jogador. Ele fornece controles e informações essenciais.
** Deve estar anexado ao PlayerGui para ser visível. Usar StarterGui garante que ele seja clonado no PlayerGui de cada jogador ao entrar.
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = game.Players.LocalPlayer: WaitForChild("PlayerGui")
Propriedades do ScreenGui
Types | Details |
---|---|
ClipToDeviceSafeArea | Recorta o conteúdo para a área segura do dispositivo. |
DisplayOrder | Controla a ordem do Z-index dos ScreenGuis, com valores mais altos sendo renderizados acima. |
IgnoreGuiInset | Determina se o ScreenGui excederá para os elementos principais da interface do Roblox. |
ScreenInsets | Define a região de exibição na tela. |
CoreUISafeInsets
CoreUISafeInsets | Mantém os elementos da interface dentro da área segura da interface principal, evitando botões da barra superior e recortes na tela (padrão). |
None | Sem restrições de área segura; elementos da interface podem ser obscurecidos pela interface principal ou recortes do dispositivo, adequado para conteúdo não interativo. |
TopbarSafeInsets | Garante que os elementos da interface sejam mantidos entre os controles mais à esquerda do Roblox e a área segura do dispositivo, ajustando-se dinamicamente para evitar colisões. |
DeviceSafeInsets | Aplica recortes para toda a área segura do dispositivo, evitando qualquer recorte ou entalhe na tela. |
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 você achou este tutorial útil e gostaria de apoiar meu trabalho, por favor, considere me comprar um café.
Muito obrigado pelo seu apoio!
Me compre um café