Lớp công cụ
GetTextBoundsParams
*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óm Tắt
Mẫu mã
Đo kích thước văn bản
local TextService = game:GetService("TextService")
-- Khai báo tham số
local params = Instance.new("GetTextBoundsParams")
params.Text = "Xin chào thế giới!"
params.Font = Font.new("rbxasset://fonts/families/GrenzeGotisch.json", Enum.FontWeight.Thin)
params.Size = 20
params.Width = 200
local success, bounds = pcall(function()
return TextService:GetTextBoundsAsync(params)
end)
if success then
print(bounds)
endTài Liệu Tham Khảo API
Thuộc Tính