Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I change font size on a TextButton?

Asked by 7 years ago

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

Log in to vote
3
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

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

0
I'd recommend him/her to use textscaled, it works extremely well and all the text will always be inside the box! xEmmalyx 285 — 7y
0
Thanks Dannzvmp 4 — 7y
Ad

Answer this question