Apprendre
Classe de moteur
GuiService
Création impossible
Service
Non répliqué

*Ce contenu est traduit en utilisant l'IA (Beta) et peut contenir des erreurs. Pour consulter cette page en anglais, clique ici.



Référence API
Propriétés
AutoSelectGuiEnabled
Lecture parallèle
Capacités : UI, Input
GuiService.AutoSelectGuiEnabled:boolean

CoreGuiNavigationEnabled
Caché
Non répliqué
Lecture parallèle
Capacités : UI, Input
GuiService.CoreGuiNavigationEnabled:boolean

GuiNavigationEnabled
Lecture parallèle
Capacités : UI, Input
GuiService.GuiNavigationEnabled:boolean

IsModalDialog
Déprécié

IsWindows
Déprécié

MenuIsOpen
Lecture uniquement
Non répliqué
Lecture parallèle
Capacités : UI
GuiService.MenuIsOpen:boolean

PreferredTextSize
Lecture uniquement
Non répliqué
Lecture parallèle
Capacités : UI
GuiService.PreferredTextSize:Enum.PreferredTextSize
Échantillons de code
Détecter/Appliquer les changements à la taille de texte préférée
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 = "Test de Label de Texte"
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 ajoute", addedTextHeight, " à la taille de texte par défaut")
textLabel.Size = UDim2.new(0, 0, 0, FONT_SIZE + addedTextHeight + PADDING)
end
applyAddedTextHeight()
GuiService:GetPropertyChangedSignal("PreferredTextSize"):Connect(applyAddedTextHeight)

PreferredTransparency
Caché
Lecture uniquement
Non répliqué
Lecture parallèle
Capacités : UI
GuiService.PreferredTransparency:number
Échantillons de code
Détecter/Appliquer les changements de transparence préférée
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
-- Stocker les instances initiales marquées
for _, object in CollectionService:GetTagged(TAG) do
onInstanceAdded(object)
end
-- Détecter quand une instance marquée est ajoutée ou retirée
CollectionService:GetInstanceAddedSignal(TAG):Connect(onInstanceAdded)
CollectionService:GetInstanceRemovedSignal(TAG):Connect(onInstanceRemoved)
-- Lorsque le paramètre en jeu est changé, ajuster les instances marquées
GuiService:GetPropertyChangedSignal("PreferredTransparency"):Connect(function()
for object, defaultTransparency in transparentBackObjects do
object.BackgroundTransparency = defaultTransparency * GuiService.PreferredTransparency
end
end)

ReducedMotionEnabled
Caché
Lecture uniquement
Non répliqué
Lecture parallèle
Capacités : UI
GuiService.ReducedMotionEnabled:boolean

SelectedObject
Lecture parallèle
Capacités : UI, Input
GuiService.SelectedObject:GuiObject
Échantillons de code
Impression lors du changement de sélection de manette
local GuiService = game:GetService("GuiService")
local function printChanged(value)
if value == "SelectedObject" then
print("Le SelectedObject a changé !")
end
end
GuiService.Changed:Connect(printChanged)

TopbarInset
Lecture uniquement
Non répliqué
Lecture parallèle
Capacités : UI
GuiService.TopbarInset:Rect
Échantillons de code
Cadre réactif dans l'espace de la barre supérieure disponible
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
Lecture parallèle
Capacités : UI, Input
GuiService.TouchControlsEnabled:boolean

ViewportDisplaySize
Lecture uniquement
Non répliqué
Lecture parallèle
Capacités : UI
GuiService.ViewportDisplaySize:Enum.DisplaySize
Échantillons de code
Modifications de la taille d'affichage du viewport
local GuiService = game:GetService("GuiService")
local function updateUI()
if (GuiService.ViewportDisplaySize == Enum.DisplaySize.Small) then
-- Mettre à jour l'interface utilisateur pour un petit écran
elseif (GuiService.ViewportDisplaySize == Enum.DisplaySize.Large) then
-- Mettre à jour l'interface utilisateur pour un grand écran
else
-- Mettre à jour l'interface utilisateur pour un écran moyen/par défaut
end
end
GuiService:GetPropertyChangedSignal("ViewportDisplaySize"):Connect(updateUI)
updateUI()

Méthodes
AddSelectionParent
Déprécié

AddSelectionTuple
Déprécié

CloseInspectMenu
Capacités : UI
GuiService:CloseInspectMenu():()
Retours
()

DismissNotification
Capacités : UI
GuiService:DismissNotification(notificationId:string):boolean
Paramètres
notificationId:string
Retours

GetEmotesMenuOpen
Capacités : UI
GuiService:GetEmotesMenuOpen():boolean
Retours

GetGameplayPausedNotificationEnabled
Capacités : UI
GuiService:GetGameplayPausedNotificationEnabled():boolean
Retours

GetGuiInset
Capacités : UI
GuiService:GetGuiInset():Tuple
Retours

GetInsetArea
Capacités : UI
GuiService:GetInsetArea(screenInsets:Enum.ScreenInsets):Rect
Paramètres
screenInsets:Enum.ScreenInsets
Retours

GetInspectMenuEnabled
Capacités : UI
GuiService:GetInspectMenuEnabled():boolean
Retours

InspectPlayerFromHumanoidDescription
Capacités : UI, AvatarAppearance
GuiService:InspectPlayerFromHumanoidDescription(
humanoidDescription:Instance, name:string
):()
Paramètres
humanoidDescription:Instance
name:string
Retours
()
Échantillons de code
Ouvrir un menu d'inspection avec un HumanoidDescription
local GuiService = game:GetService("GuiService")
local humanoidDescription = Instance.new("HumanoidDescription")
humanoidDescription.HatAccessory = "3339374070"
humanoidDescription.BackAccessory = "3339363671"
GuiService:InspectPlayerFromHumanoidDescription(humanoidDescription, "MyPlayer")

InspectPlayerFromUserId
Capacités : UI, AvatarAppearance
GuiService:InspectPlayerFromUserId(userId:User):()
Paramètres
userId:User
Retours
()
Échantillons de code
Ouverture du Menu d'Inspection pour un UserId
local GuiService = game:GetService("GuiService")
GuiService:InspectPlayerFromUserId(772462)

IsTenFootInterface
Déprécié

RemoveSelectionGroup
Déprécié

Select
Capacités : UI
GuiService:Select(selectionParent:Instance):()
Paramètres
selectionParent:Instance
Retours
()

SendNotification
Capacités : UI
GuiService:SendNotification(notificationInfo:Dictionary):string
Paramètres
notificationInfo:Dictionary
Retours

SetEmotesMenuOpen
Capacités : UI
GuiService:SetEmotesMenuOpen(isOpen:boolean):()
Paramètres
isOpen:boolean
Retours
()

SetGameplayPausedNotificationEnabled
Capacités : UI
GuiService:SetGameplayPausedNotificationEnabled(enabled:boolean):()
Paramètres
enabled:boolean
Retours
()

SetInspectMenuEnabled
Capacités : UI
GuiService:SetInspectMenuEnabled(enabled:boolean):()
Paramètres
enabled:boolean
Retours
()

Événements
MenuClosed
Capacités : UI
GuiService.MenuClosed():RBXScriptSignal

MenuOpened
Capacités : UI
GuiService.MenuOpened():RBXScriptSignal

©2026 Société Roblox. Roblox, le logo Roblox et Powering Imagination font partie de nos marques déposées aux États-Unis et dans d'autres pays.