Aprender
Clase de motor
GuiService
No creable
Servicio
No replicado

*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.



Referencia API
Propiedades
AutoSelectGuiEnabled
Leer paralelo
Capacidades: UI, Input
GuiService.AutoSelectGuiEnabled:boolean

CoreGuiNavigationEnabled
Oculto
No replicado
Leer paralelo
Capacidades: UI, Input
GuiService.CoreGuiNavigationEnabled:boolean

GuiNavigationEnabled
Leer paralelo
Capacidades: UI, Input
GuiService.GuiNavigationEnabled:boolean

IsModalDialog
Obsoleto

IsWindows
Obsoleto

MenuIsOpen
Solo lectura
No replicado
Leer paralelo
Capacidades: UI
GuiService.MenuIsOpen:boolean

PreferredTextSize
Solo lectura
No replicado
Leer paralelo
Capacidades: UI
GuiService.PreferredTextSize:Enum.PreferredTextSize
Muestras de código
Detectar/Aplícar Cambios al Tamaño 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 = "Prueba de Etiqueta 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 añade", addedTextHeight, " al tamaño de texto por defecto")
textLabel.Size = UDim2.new(0, 0, 0, FONT_SIZE + addedTextHeight + PADDING)
end
applyAddedTextHeight()
GuiService:GetPropertyChangedSignal("PreferredTextSize"):Connect(applyAddedTextHeight)

PreferredTransparency
Oculto
Solo lectura
No replicado
Leer paralelo
Capacidades: UI
GuiService.PreferredTransparency:number
Muestras de código
Detectar/Aplicar Cambios a la Transparencia 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
-- Almacenar instancias etiquetadas iniciales
for _, object in CollectionService:GetTagged(TAG) do
onInstanceAdded(object)
end
-- Detectar cuando una instancia etiquetada es añadida o eliminada
CollectionService:GetInstanceAddedSignal(TAG):Connect(onInstanceAdded)
CollectionService:GetInstanceRemovedSignal(TAG):Connect(onInstanceRemoved)
-- Cuando se cambia la configuración en el juego, ajustar las instancias etiquetadas
GuiService:GetPropertyChangedSignal("PreferredTransparency"):Connect(function()
for object, defaultTransparency in transparentBackObjects do
object.BackgroundTransparency = defaultTransparency * GuiService.PreferredTransparency
end
end)

ReducedMotionEnabled
Oculto
Solo lectura
No replicado
Leer paralelo
Capacidades: UI
GuiService.ReducedMotionEnabled:boolean

SelectedObject
Leer paralelo
Capacidades: UI, Input
GuiService.SelectedObject:GuiObject
Muestras de código
Cambiando el Texto Cuando Cambia la Selección del Gamepad
local GuiService = game:GetService("GuiService")
local function printChanged(value)
if value == "SelectedObject" then
print("¡El SelectedObject ha cambiado!")
end
end
GuiService.Changed:Connect(printChanged)

TopbarInset
Solo lectura
No replicado
Leer paralelo
Capacidades: UI
GuiService.TopbarInset:Rect
Muestras de código
Marco Rectangular Responsivo Dentro del Espacio Disponible de la 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
Leer paralelo
Capacidades: UI, Input
GuiService.TouchControlsEnabled:boolean

ViewportDisplaySize
Solo lectura
No replicado
Leer paralelo
Capacidades: UI
GuiService.ViewportDisplaySize:Enum.DisplaySize
Muestras de código
Cambios en el Tamaño de Visualización del Marco
local GuiService = game:GetService("GuiService")
local function updateUI()
if (GuiService.ViewportDisplaySize == Enum.DisplaySize.Small) then
-- Actualizar la interfaz de usuario para pantalla pequeña
elseif (GuiService.ViewportDisplaySize == Enum.DisplaySize.Large) then
-- Actualizar la interfaz de usuario para pantalla grande
else
-- Actualizar la interfaz de usuario para pantalla mediana/predeterminada
end
end
GuiService:GetPropertyChangedSignal("ViewportDisplaySize"):Connect(updateUI)
updateUI()

Métodos
AddSelectionParent
Obsoleto

AddSelectionTuple
Obsoleto

CloseInspectMenu
Capacidades: UI
GuiService:CloseInspectMenu():()
Devuelve
()

DismissNotification
Capacidades: UI
GuiService:DismissNotification(notificationId:string):boolean
Parámetros
notificationId:string
Devuelve

GetEmotesMenuOpen
Capacidades: UI
GuiService:GetEmotesMenuOpen():boolean
Devuelve

GetGameplayPausedNotificationEnabled
Capacidades: UI
GuiService:GetGameplayPausedNotificationEnabled():boolean
Devuelve

GetGuiInset
Capacidades: UI
GuiService:GetGuiInset():Tuple
Devuelve

GetInsetArea
Capacidades: UI
GuiService:GetInsetArea(screenInsets:Enum.ScreenInsets):Rect
Parámetros
screenInsets:Enum.ScreenInsets
Devuelve

GetInspectMenuEnabled
Capacidades: UI
GuiService:GetInspectMenuEnabled():boolean
Devuelve

InspectPlayerFromHumanoidDescription
Capacidades: UI, AvatarAppearance
GuiService:InspectPlayerFromHumanoidDescription(
humanoidDescription:Instance, name:string
):()
Parámetros
humanoidDescription:Instance
name:string
Devuelve
()
Muestras de código
Abrir un menú de inspección con una HumanoidDescription
local GuiService = game:GetService("GuiService")
local humanoidDescription = Instance.new("HumanoidDescription")
humanoidDescription.HatAccessory = "3339374070"
humanoidDescription.BackAccessory = "3339363671"
GuiService:InspectPlayerFromHumanoidDescription(humanoidDescription, "MyPlayer")

InspectPlayerFromUserId
Capacidades: UI, AvatarAppearance
GuiService:InspectPlayerFromUserId(userId:User):()
Parámetros
userId:User
Devuelve
()
Muestras de código
Abriendo el Menú de Inspección para un UserId
local GuiService = game:GetService("GuiService")
-- Abre el menú de inspección para el usuario con ID 772462 GuiService:InspectPlayerFromUserId(772462)

IsTenFootInterface
Obsoleto

RemoveSelectionGroup
Obsoleto

Select
Capacidades: UI
GuiService:Select(selectionParent:Instance):()
Parámetros
selectionParent:Instance
Devuelve
()

SendNotification
Capacidades: UI
GuiService:SendNotification(notificationInfo:Dictionary):string
Parámetros
notificationInfo:Dictionary
Devuelve

SetEmotesMenuOpen
Capacidades: UI
GuiService:SetEmotesMenuOpen(isOpen:boolean):()
Parámetros
isOpen:boolean
Devuelve
()

SetGameplayPausedNotificationEnabled
Capacidades: UI
GuiService:SetGameplayPausedNotificationEnabled(enabled:boolean):()
Parámetros
enabled:boolean
Devuelve
()

SetInspectMenuEnabled
Capacidades: UI
GuiService:SetInspectMenuEnabled(enabled:boolean):()
Parámetros
enabled:boolean
Devuelve
()

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

MenuOpened
Capacidades: UI
GuiService.MenuOpened():RBXScriptSignal

©2026 Roblox Corporation. Roblox, el logotipo de Roblox y "Powering Imagination" son algunas de nuestras marcas registradas y no registradas en los Estados Unidos y otros países.