Ghi chú phát hành
Học
Lớp công cụ
GuiService
Không Thể Tạo
Dịch Vụ
Không Sao Chép

*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.



Tài Liệu Tham Khảo API
Thuộc Tính
AutoSelectGuiEnabled
Đọc Song Song
Các khả năng: UI, Input
GuiService.AutoSelectGuiEnabled:boolean

CoreGuiNavigationEnabled
Ẩn
Không Sao Chép
Đọc Song Song
Các khả năng: UI, Input
GuiService.CoreGuiNavigationEnabled:boolean

GuiNavigationEnabled
Đọc Song Song
Các khả năng: UI, Input
GuiService.GuiNavigationEnabled:boolean

IsModalDialog
Đã Lỗi Thời

IsWindows
Đã Lỗi Thời

MenuIsOpen
Chỉ Đọc
Không Sao Chép
Đọc Song Song
Các khả năng: UI
GuiService.MenuIsOpen:boolean

PreferredTextSize
Chỉ Đọc
Không Sao Chép
Đọc Song Song
Các khả năng: UI
GuiService.PreferredTextSize:Enum.PreferredTextSize
Mẫu mã
Phát hiện/Áp dụng thay đổi kích thước văn bản ưa thích
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 = "Kiểm tra nhãn văn bản"
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 thêm", addedTextHeight, " vào kích thước văn bản mặc định")
textLabel.Size = UDim2.new(0, 0, 0, FONT_SIZE + addedTextHeight + PADDING)
end
applyAddedTextHeight()
GuiService:GetPropertyChangedSignal("PreferredTextSize"):Connect(applyAddedTextHeight)

PreferredTransparency
Ẩn
Chỉ Đọc
Không Sao Chép
Đọc Song Song
Các khả năng: UI
GuiService.PreferredTransparency:number
Mẫu mã
Phát hiện/Áp dụng thay đổi độ trong suốt ưu tiên
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
-- Lưu trữ các thể hiện gán thẻ ban đầu
for _, object in CollectionService:GetTagged(TAG) do
onInstanceAdded(object)
end
-- Phát hiện khi một thể hiện gán thẻ được thêm hoặc xóa
CollectionService:GetInstanceAddedSignal(TAG):Connect(onInstanceAdded)
CollectionService:GetInstanceRemovedSignal(TAG):Connect(onInstanceRemoved)
-- Khi cài đặt trong trò chơi được thay đổi, điều chỉnh các thể hiện gán thẻ
GuiService:GetPropertyChangedSignal("PreferredTransparency"):Connect(function()
for object, defaultTransparency in transparentBackObjects do
object.BackgroundTransparency = defaultTransparency * GuiService.PreferredTransparency
end
end)

ReducedMotionEnabled
Ẩn
Chỉ Đọc
Không Sao Chép
Đọc Song Song
Các khả năng: UI
GuiService.ReducedMotionEnabled:boolean

SelectedObject
Đọc Song Song
Các khả năng: UI, Input
GuiService.SelectedObject:GuiObject
Mẫu mã
In thông báo khi thay đổi lựa chọn Gamepad
local GuiService = game:GetService("GuiService")
local function printChanged(value)
if value == "SelectedObject" then
print("SelectedObject đã thay đổi!")
end
end
GuiService.Changed:Connect(printChanged)

TopbarInset
Chỉ Đọc
Không Sao Chép
Đọc Song Song
Các khả năng: UI
GuiService.TopbarInset:Rect
Mẫu mã
Khung phản hồi trong không gian thanh trên có sẵn
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
Đọc Song Song
Các khả năng: UI, Input
GuiService.TouchControlsEnabled:boolean

ViewportDisplaySize
Chỉ Đọc
Không Sao Chép
Đọc Song Song
Các khả năng: UI
GuiService.ViewportDisplaySize:Enum.DisplaySize
Mẫu mã
Thay đổi Kích thước Hiển thị Khung nhìn
local GuiService = game:GetService("GuiService")
local function updateUI()
if (GuiService.ViewportDisplaySize == Enum.DisplaySize.Small) then
-- Cập nhật UI cho màn hình nhỏ
elseif (GuiService.ViewportDisplaySize == Enum.DisplaySize.Large) then
-- Cập nhật UI cho màn hình lớn
else
-- Cập nhật UI cho màn hình trung bình/mặc định
end
end
GuiService:GetPropertyChangedSignal("ViewportDisplaySize"):Connect(updateUI)
updateUI()

Phương Pháp
AddSelectionParent
Đã Lỗi Thời

AddSelectionTuple
Đã Lỗi Thời

CloseInspectMenu
Các khả năng: UI
GuiService:CloseInspectMenu():()
Lợi Nhuận
()

DismissNotification
Các khả năng: UI
GuiService:DismissNotification(notificationId:string):boolean
Tham Số
notificationId:string
Lợi Nhuận

GetEmotesMenuOpen
Các khả năng: UI
GuiService:GetEmotesMenuOpen():boolean
Lợi Nhuận

GetGameplayPausedNotificationEnabled
Các khả năng: UI
GuiService:GetGameplayPausedNotificationEnabled():boolean
Lợi Nhuận

GetGuiInset
Các khả năng: UI
GuiService:GetGuiInset():Tuple
Lợi Nhuận

GetInsetArea
Các khả năng: UI
GuiService:GetInsetArea(screenInsets:Enum.ScreenInsets):Rect
Tham Số
screenInsets:Enum.ScreenInsets
Lợi Nhuận

GetInspectMenuEnabled
Các khả năng: UI
GuiService:GetInspectMenuEnabled():boolean
Lợi Nhuận

InspectPlayerFromHumanoidDescription
Các khả năng: UI, AvatarAppearance
GuiService:InspectPlayerFromHumanoidDescription(
humanoidDescription:Instance, name:string
):()
Tham Số
humanoidDescription:Instance
name:string
Lợi Nhuận
()
Mẫu mã
Mở Menu Kiểm tra với HumanoidDescription
local GuiService = game:GetService("GuiService")
local humanoidDescription = Instance.new("HumanoidDescription")
humanoidDescription.HatAccessory = "3339374070"
humanoidDescription.BackAccessory = "3339363671"
GuiService:InspectPlayerFromHumanoidDescription(humanoidDescription, "MyPlayer")

InspectPlayerFromUserId
Các khả năng: UI, AvatarAppearance
GuiService:InspectPlayerFromUserId(userId:User):()
Tham Số
userId:User
Lợi Nhuận
()
Mẫu mã
Mở Menu Kiểm Tra cho UserId
local GuiService = game:GetService("GuiService")
GuiService:InspectPlayerFromUserId(772462)

IsTenFootInterface
Đã Lỗi Thời

RemoveSelectionGroup
Đã Lỗi Thời

Select
Các khả năng: UI
GuiService:Select(selectionParent:Instance):()
Tham Số
selectionParent:Instance
Lợi Nhuận
()

SendNotification
Các khả năng: UI
GuiService:SendNotification(notificationInfo:Dictionary):string
Tham Số
notificationInfo:Dictionary
Lợi Nhuận

SetEmotesMenuOpen
Các khả năng: UI
GuiService:SetEmotesMenuOpen(isOpen:boolean):()
Tham Số
isOpen:boolean
Lợi Nhuận
()

SetGameplayPausedNotificationEnabled
Các khả năng: UI
GuiService:SetGameplayPausedNotificationEnabled(enabled:boolean):()
Tham Số
enabled:boolean
Lợi Nhuận
()

SetInspectMenuEnabled
Các khả năng: UI
GuiService:SetInspectMenuEnabled(enabled:boolean):()
Tham Số
enabled:boolean
Lợi Nhuận
()

Sự Kiện
MenuClosed
Các khả năng: UI
GuiService.MenuClosed():RBXScriptSignal

MenuOpened
Các khả năng: UI
GuiService.MenuOpened():RBXScriptSignal

©2026 Roblox Corporation. Roblox, logo Roblox và Powering Imagination là các nhãn hiệu đã đăng ký và chưa đăng ký của chúng tôi tại Hoa Kỳ và các quốc gia khác.