Informacje o wersji
Edukacja
Klasa silnika
GuiService
Brak możliwości tworzenia
Usługa
Bez replikacji

*Ta zawartość została przetłumaczona przy użyciu narzędzi AI (w wersji beta) i może zawierać błędy. Aby wyświetlić tę stronę w języku angielskim, kliknij tutaj.



Materiały referencyjne dotyczące interfejsów API
Właściwości
AutoSelectGuiEnabled
Odczyt równoległy
Możliwości: UI, Input
GuiService.AutoSelectGuiEnabled:boolean

CoreGuiNavigationEnabled
Ukryte
Bez replikacji
Odczyt równoległy
Możliwości: UI, Input
GuiService.CoreGuiNavigationEnabled:boolean

GuiNavigationEnabled
Odczyt równoległy
Możliwości: UI, Input
GuiService.GuiNavigationEnabled:boolean

IsModalDialog
Przestarzałe

IsWindows
Przestarzałe

MenuIsOpen
Tylko do odczytu
Bez replikacji
Odczyt równoległy
Możliwości: UI
GuiService.MenuIsOpen:boolean

PreferredTextSize
Tylko do odczytu
Bez replikacji
Odczyt równoległy
Możliwości: UI
GuiService.PreferredTextSize:Enum.PreferredTextSize
Przykłady kodu
Wykryj/Zastosuj zmiany w preferowanym rozmiarze tekstu
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 etykiety tekstowej"
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("Preferowany rozmiar tekstu dodaje", addedTextHeight, " do domyślnego rozmiaru tekstu")
textLabel.Size = UDim2.new(0, 0, 0, FONT_SIZE + addedTextHeight + PADDING)
end
applyAddedTextHeight()
GuiService:GetPropertyChangedSignal("PreferredTextSize"):Connect(applyAddedTextHeight)

PreferredTransparency
Ukryte
Tylko do odczytu
Bez replikacji
Odczyt równoległy
Możliwości: UI
GuiService.PreferredTransparency:number
Przykłady kodu
Wykryj/Zastosuj zmiany w preferowanej przezroczystości
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
-- Zapisz początkowe oznaczone instancje
for _, object in CollectionService:GetTagged(TAG) do
onInstanceAdded(object)
end
-- Wykryj, gdy oznaczona instancja zostanie dodana lub usunięta
CollectionService:GetInstanceAddedSignal(TAG):Connect(onInstanceAdded)
CollectionService:GetInstanceRemovedSignal(TAG):Connect(onInstanceRemoved)
-- Gdy ustawienie w grze zostanie zmienione, dostosuj oznaczone instancje
GuiService:GetPropertyChangedSignal("PreferredTransparency"):Connect(function()
for object, defaultTransparency in transparentBackObjects do
object.BackgroundTransparency = defaultTransparency * GuiService.PreferredTransparency
end
end)

ReducedMotionEnabled
Ukryte
Tylko do odczytu
Bez replikacji
Odczyt równoległy
Możliwości: UI
GuiService.ReducedMotionEnabled:boolean

SelectedObject
Odczyt równoległy
Możliwości: UI, Input
GuiService.SelectedObject:GuiObject
Przykłady kodu
Wyświetlanie podczas zmiany wyboru kontrolera
local GuiService = game:GetService("GuiService")
local function printChanged(value)
if value == "SelectedObject" then
print("Wybrany obiekt został zmieniony!")
end
end
GuiService.Changed:Connect(printChanged)

TopbarInset
Tylko do odczytu
Bez replikacji
Odczyt równoległy
Możliwości: UI
GuiService.TopbarInset:Rect
Przykłady kodu
Responsywny ramka w dostępnej przestrzeni górnego paska
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
Odczyt równoległy
Możliwości: UI, Input
GuiService.TouchControlsEnabled:boolean

ViewportDisplaySize
Tylko do odczytu
Bez replikacji
Odczyt równoległy
Możliwości: UI
GuiService.ViewportDisplaySize:Enum.DisplaySize
Przykłady kodu
Zmiany rozmiaru wyświetlacza
local GuiService = game:GetService("GuiService")
local function updateUI()
if (GuiService.ViewportDisplaySize == Enum.DisplaySize.Small) then
-- Zaktualizuj interfejs użytkownika do małego ekranu
elseif (GuiService.ViewportDisplaySize == Enum.DisplaySize.Large) then
-- Zaktualizuj interfejs użytkownika do dużego ekranu
else
-- Zaktualizuj interfejs użytkownika do średniego/domyslnego ekranu
end
end
GuiService:GetPropertyChangedSignal("ViewportDisplaySize"):Connect(updateUI)
updateUI()

Metody
AddSelectionParent
Przestarzałe

AddSelectionTuple
Przestarzałe

CloseInspectMenu
Możliwości: UI
GuiService:CloseInspectMenu():()
Zwroty
()

DismissNotification
Możliwości: UI
GuiService:DismissNotification(notificationId:string):boolean
Parametry
notificationId:string
Zwroty

GetEmotesMenuOpen
Możliwości: UI
GuiService:GetEmotesMenuOpen():boolean
Zwroty

GetGameplayPausedNotificationEnabled
Możliwości: UI
GuiService:GetGameplayPausedNotificationEnabled():boolean
Zwroty

GetGuiInset
Możliwości: UI
GuiService:GetGuiInset():Tuple
Zwroty

GetInsetArea
Możliwości: UI
GuiService:GetInsetArea(screenInsets:Enum.ScreenInsets):Rect
Parametry
screenInsets:Enum.ScreenInsets
Zwroty

GetInspectMenuEnabled
Możliwości: UI
GuiService:GetInspectMenuEnabled():boolean
Zwroty

InspectPlayerFromHumanoidDescription
Możliwości: UI, AvatarAppearance
GuiService:InspectPlayerFromHumanoidDescription(
humanoidDescription:Instance, name:string
):()
Parametry
humanoidDescription:Instance
name:string
Zwroty
()
Przykłady kodu
Otwieranie menu inspekcji z HumanoidDescription
local GuiService = game:GetService("GuiService")
local humanoidDescription = Instance.new("HumanoidDescription")
humanoidDescription.HatAccessory = "3339374070"
humanoidDescription.BackAccessory = "3339363671"
GuiService:InspectPlayerFromHumanoidDescription(humanoidDescription, "MyPlayer")

InspectPlayerFromUserId
Możliwości: UI, AvatarAppearance
GuiService:InspectPlayerFromUserId(userId:User):()
Parametry
userId:User
Zwroty
()
Przykłady kodu
Otwieranie menu inspekcji dla UserId
local GuiService = game:GetService("GuiService")
GuiService:InspectPlayerFromUserId(772462)

IsTenFootInterface
Przestarzałe

RemoveSelectionGroup
Przestarzałe

Select
Możliwości: UI
GuiService:Select(selectionParent:Instance):()
Parametry
selectionParent:Instance
Zwroty
()

SendNotification
Możliwości: UI
GuiService:SendNotification(notificationInfo:Dictionary):string
Parametry
notificationInfo:Dictionary
Zwroty

SetEmotesMenuOpen
Możliwości: UI
GuiService:SetEmotesMenuOpen(isOpen:boolean):()
Parametry
isOpen:boolean
Zwroty
()

SetGameplayPausedNotificationEnabled
Możliwości: UI
GuiService:SetGameplayPausedNotificationEnabled(enabled:boolean):()
Parametry
enabled:boolean
Zwroty
()

SetInspectMenuEnabled
Możliwości: UI
GuiService:SetInspectMenuEnabled(enabled:boolean):()
Parametry
enabled:boolean
Zwroty
()

Zdarzenia
MenuClosed
Możliwości: UI
GuiService.MenuClosed():RBXScriptSignal

MenuOpened
Możliwości: UI
GuiService.MenuOpened():RBXScriptSignal

©2026 Roblox Corporation. Nazwa Roblox, logo Roblox oraz hasło „Powering Imagination” należą do naszych zarejestrowanych i niezarejestrowanych znaków towarowych na terenie Stanów Zjednoczonych oraz w innych krajach.