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

How can I scale a TextLabel based on the amount of Text inside?

I want to make a TextLabel's Size increase with how much text is inside, TextWrapping and having the Label increase in size.

(Not a request, but a question you may help me with, even answer if you want)

3 answers

✓ Accepted answer

You could know how many characters are in the text by doing

local Characters = #”Hello World”

Then you can scale it based on the amount of characters

local Size = UDim2.new(0,Characters*10,0,Characters*10)

It’s basically Characters multiplied by the amount of pixels

add a 'UITextSizeConstraint' to the textlabel/textbutton

I believe ROBLOX already has a TextScaled implemented within their Gui systems to help with this.

1 comment

0

Yeah and it sucks. It gives horrible results with large numbers and with small values literally consuming the entire gui

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