Kelas Engine
GetTextBoundsParams
*Konten ini diterjemahkan menggunakan AI (Beta) dan mungkin mengandung kesalahan. Untuk melihat halaman ini dalam bahasa Inggris, klik di sini.
Rangkuman
Contoh Kode
Mengukur Ukuran Teks
local TextService = game:GetService("TextService")
-- Deklarasikan parameter
local params = Instance.new("GetTextBoundsParams")
params.Text = "Halo dunia!"
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)
endReferensi API
Properti