Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I change font size on a TextButton?

I have written a little script and i want to change the size of the font on it.

I have the script here:

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent
 
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 10, 0, 10)
textButton.Size = UDim2.new(0, 170, 0,25 )
textButton.BackgroundColor3 = BrickColor.White().Color 
textButton.Text = "Spawn"
 
textButton.MouseButton1Down:connect(function()
	textButton.Text = "Spawn"
	
end)

If you know how to change the font size it please answer.

1 answer

✓ Accepted answer

It's simple. Just do the following:

Object.FontSize = Enum.FontSize.Size16

When typing the Size from Enum.FontSize.Size a list will popup showing you all available sizes.

wiki

2 comments

0

I'd recommend him/her to use textscaled, it works extremely well and all the text will always be inside the box!

0

Thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.