I am trying to scale a text label to fit the text indide perfectly. I have tried to use this API reference page, but I requires the text label’s size and returns a vector 3. So that didnt work.
Text properties
Font - Gotham bold
Size - 18
Text X Alignment - Left
Some useful info
It needs to return offset, not scale
If theres any other info you might need please ask
Thanks in advance for anyone who solves this !
EDIT: Text scaled doesn’t work if you want a lot of labels to be under each other, because they are all different text sizes.
EDIT:
What I have with text scaled:
(Notice that the texts are all different sizes)
What I need:
(Notice that the sizes are diffrent but the text sizes are all 24)
I have but then if you try to put more text labels under each other, they are all different sizes. I am trying to set the text labels size to perfectly size the text. Sorry if I wasn’t clear enough.
No, I want the text size to permanently stay the same, and only the size of the text label changes. A good example is the default ROBLOX chat system, when a player chats you can notice that their names text size is constant across all messages, but the size changes.
He’s asking for the text sizes along with resizing of devices to be the same size. Honestly the only way I do this is by making the text longer on the y axis so words fit inside, if it reaches the end of the textlabel’s y size it will become smaller otherwise it stays the same
Maybe you could use the :GetPropertyChangedSignal() on the ViewportSize property in the workspace.CurrentCamera, or the AbsoluteSize property of your TextLabel??
local myContainer = --[[wherever your frame/ScreenGui containing your buttons is]]
for i,v in pairs(myContainer:GetChildren()) do
if v:IsA('TextLabel') then
v:GetPropertyChangedSignal('AbsoluteSize'):Connect(function()
v.TextSize = v.AbsoluteSize.Y - 10 -- can be whatever, just an example
end
end
end