Aprenda
Classe do mecanismo
GuiService
Não criável
Serviço
Não replicado

*Este conteúdo é traduzido por IA (Beta) e pode conter erros. Para ver a página em inglês, clique aqui.



Referência API
Propriedades
AutoSelectGuiEnabled
Ler Parallel
Recursos: UI, Input
GuiService.AutoSelectGuiEnabled:boolean

CoreGuiNavigationEnabled
Oculto
Não replicado
Ler Parallel
Recursos: UI, Input
GuiService.CoreGuiNavigationEnabled:boolean

GuiNavigationEnabled
Ler Parallel
Recursos: UI, Input
GuiService.GuiNavigationEnabled:boolean

IsModalDialog
Obsoleto

IsWindows
Obsoleto

MenuIsOpen
Somente leitura
Não replicado
Ler Parallel
Recursos: UI
GuiService.MenuIsOpen:boolean

PreferredTextSize
Somente leitura
Não replicado
Ler Parallel
Recursos: UI
GuiService.PreferredTextSize:Enum.PreferredTextSize
Amostras de código
Detectar/Aplicar Mudanças no Tamanho de Texto Preferido
local GuiService = game:GetService("GuiService")
local TextService = game:GetService("TextService")
local FONT_SIZE = 25
local PADDING = 8
local textLabel = Instance.new("TextLabel")
textLabel.Position = UDim2.new(0.5, 0, 0.5, 0)
textLabel.AnchorPoint = Vector2.new(0.5, 0.5)
textLabel.AutomaticSize = Enum.AutomaticSize.X
textLabel.TextSize = FONT_SIZE + PADDING
textLabel.Text = "Teste de Rótulo de Texto"
textLabel.Parent = script.Parent
local function applyAddedTextHeight()
local finalTextHeight = TextService:GetTextSize("", FONT_SIZE, Enum.Font.BuilderSans, Vector2.new(math.huge, math.huge)).Y
local addedTextHeight = finalTextHeight - FONT_SIZE
print("PreferredTextSize adiciona", addedTextHeight, " ao tamanho de texto padrão")
textLabel.Size = UDim2.new(0, 0, 0, FONT_SIZE + addedTextHeight + PADDING)
end
applyAddedTextHeight()
GuiService:GetPropertyChangedSignal("PreferredTextSize"):Connect(applyAddedTextHeight)

PreferredTransparency
Oculto
Somente leitura
Não replicado
Ler Parallel
Recursos: UI
GuiService.PreferredTransparency:number
Amostras de código
Detectar/Aplicar Mudanças na Transparência Preferida
local GuiService = game:GetService("GuiService")
local CollectionService = game:GetService("CollectionService")
local TAG = "TransparentBack"
local transparentBackObjects = {}
local function onInstanceAdded(object)
if object.BackgroundTransparency then
local defaultTransparency = object.BackgroundTransparency
transparentBackObjects[object] = defaultTransparency
object.BackgroundTransparency = defaultTransparency * GuiService.PreferredTransparency
end
end
local function onInstanceRemoved(object)
transparentBackObjects[object] = nil
end
-- Armazenar instâncias marcadas iniciais
for _, object in CollectionService:GetTagged(TAG) do
onInstanceAdded(object)
end
-- Detectar quando uma instância marcada é adicionada ou removida
CollectionService:GetInstanceAddedSignal(TAG):Connect(onInstanceAdded)
CollectionService:GetInstanceRemovedSignal(TAG):Connect(onInstanceRemoved)
-- Quando a configuração do jogo é alterada, ajustar as instâncias marcadas
GuiService:GetPropertyChangedSignal("PreferredTransparency"):Connect(function()
for object, defaultTransparency in transparentBackObjects do
object.BackgroundTransparency = defaultTransparency * GuiService.PreferredTransparency
end
end)

ReducedMotionEnabled
Oculto
Somente leitura
Não replicado
Ler Parallel
Recursos: UI
GuiService.ReducedMotionEnabled:boolean

SelectedObject
Ler Parallel
Recursos: UI, Input
GuiService.SelectedObject:GuiObject
Amostras de código
Mudando a Seleção do Gamepad
local GuiService = game:GetService("GuiService")
local function printChanged(value)
if value == "SelectedObject" then
print("O SelectedObject mudou!")
end
end
GuiService.Changed:Connect(printChanged)

TopbarInset
Somente leitura
Não replicado
Ler Parallel
Recursos: UI
GuiService.TopbarInset:Rect
Amostras de código
Quadro Responsivo Dentro do Espaço Disponível na Barra Superior
local GuiService = game:GetService("GuiService")
local Players = game:GetService("Players")
local screenGui = Instance.new("ScreenGui")
screenGui.IgnoreGuiInset = true
screenGui.Parent = Players.LocalPlayer.PlayerGui
local frame = Instance.new("Frame")
frame.BackgroundColor3 = Color3.fromRGB(0, 255, 0)
frame.Parent = screenGui
GuiService:GetPropertyChangedSignal("TopbarInset"):Connect(function()
local inset = GuiService.TopbarInset
frame.Size = UDim2.new(0, inset.Width, 0, inset.Height)
frame.Position = UDim2.new(0, inset.Min.X, 0, inset.Min.Y)
end)

TouchControlsEnabled
Ler Parallel
Recursos: UI, Input
GuiService.TouchControlsEnabled:boolean

ViewportDisplaySize
Somente leitura
Não replicado
Ler Parallel
Recursos: UI
GuiService.ViewportDisplaySize:Enum.DisplaySize
Amostras de código
Mudanças no Tamanho da Tela do Visor
local GuiService = game:GetService("GuiService")
local function updateUI()
if (GuiService.ViewportDisplaySize == Enum.DisplaySize.Small) then
-- Atualizar UI para tela pequena
elseif (GuiService.ViewportDisplaySize == Enum.DisplaySize.Large) then
-- Atualizar UI para tela grande
else
-- Atualizar UI para tela média/padrão
end
end
GuiService:GetPropertyChangedSignal("ViewportDisplaySize"):Connect(updateUI)
updateUI()

Métodos
AddSelectionParent
Obsoleto

AddSelectionTuple
Obsoleto

CloseInspectMenu
Recursos: UI
GuiService:CloseInspectMenu():()
Devolução
()

DismissNotification
Recursos: UI
GuiService:DismissNotification(notificationId:string):boolean
Parâmetros
notificationId:string
Devolução

GetEmotesMenuOpen
Recursos: UI
GuiService:GetEmotesMenuOpen():boolean
Devolução

GetGameplayPausedNotificationEnabled
Recursos: UI
GuiService:GetGameplayPausedNotificationEnabled():boolean
Devolução

GetGuiInset
Recursos: UI
GuiService:GetGuiInset():Tuple
Devolução

GetInsetArea
Recursos: UI
GuiService:GetInsetArea(screenInsets:Enum.ScreenInsets):Rect
Parâmetros
screenInsets:Enum.ScreenInsets
Devolução

GetInspectMenuEnabled
Recursos: UI
GuiService:GetInspectMenuEnabled():boolean
Devolução

InspectPlayerFromHumanoidDescription
Recursos: UI, AvatarAppearance
GuiService:InspectPlayerFromHumanoidDescription(
humanoidDescription:Instance, name:string
):()
Parâmetros
humanoidDescription:Instance
name:string
Devolução
()
Amostras de código
Abrindo um Menu de Inspeção com uma HumanoidDescription
local GuiService = game:GetService("GuiService")
local humanoidDescription = Instance.new("HumanoidDescription")
humanoidDescription.HatAccessory = "3339374070"
humanoidDescription.BackAccessory = "3339363671"
GuiService:InspectPlayerFromHumanoidDescription(humanoidDescription, "MyPlayer")

InspectPlayerFromUserId
Recursos: UI, AvatarAppearance
GuiService:InspectPlayerFromUserId(userId:User):()
Parâmetros
userId:User
Devolução
()
Amostras de código
Abrindo o Menu de Inspeção para um UserId
local GuiService = game:GetService("GuiService")
-- Inspeciona o jogador com o UserId fornecido GuiService:InspectPlayerFromUserId(772462)

IsTenFootInterface
Obsoleto

RemoveSelectionGroup
Obsoleto

Select
Recursos: UI
GuiService:Select(selectionParent:Instance):()
Parâmetros
selectionParent:Instance
Devolução
()

SendNotification
Recursos: UI
GuiService:SendNotification(notificationInfo:Dictionary):string
Parâmetros
notificationInfo:Dictionary
Devolução

SetEmotesMenuOpen
Recursos: UI
GuiService:SetEmotesMenuOpen(isOpen:boolean):()
Parâmetros
isOpen:boolean
Devolução
()

SetGameplayPausedNotificationEnabled
Recursos: UI
GuiService:SetGameplayPausedNotificationEnabled(enabled:boolean):()
Parâmetros
enabled:boolean
Devolução
()

SetInspectMenuEnabled
Recursos: UI
GuiService:SetInspectMenuEnabled(enabled:boolean):()
Parâmetros
enabled:boolean
Devolução
()

Eventos
MenuClosed
Recursos: UI
GuiService.MenuClosed():RBXScriptSignal

MenuOpened
Recursos: UI
GuiService.MenuOpened():RBXScriptSignal

©2026 Roblox Corporation, Roblox, o logotipo Roblox e Powering Imagination estão entre nossas marcas registradas e não registradas nos EUA e em outros países.