Making the Textsize scale the same for every device

I need help to set TextSize to scale and fit on every device.

Include screenshots / videos if possible!
What it looks like on my screen:
https://gyazo.com/5ead5a0dd96187e469b9d11af690d19d

What it looks like on a emulated device:
https://gyazo.com/ad15275d0b9bee705e5acaeb6f9e2ebf

So far I have tried using, UITextSizeConstraint and I have also tried using UIAspectRatioConstraint .

Also I know about TextScaled but it is just to big for my UI design.

2 Likes

What I do for scaling GUI is, I set the scale to 0.1, 0, 0.1, 0 and then scale and it should fit the same on all devices.

Just tried this, it worked but its just now that my buttons are not scaled for every device.

1 Like

You just do that with all your Guis and it should work

An easy thing you can do is set the text size of your labels to be half of the absolute Y size of the frame. You can do this everytime the frame size updates.

3 Likes

Yes this worked very well, thanks.

Code I used:

while wait() do
	script.Parent.TextSize = script.Parent.AbsoluteSize.Y / 2
end
2 Likes
local textLabel = script.Parent

local function updateTextSize()
   textLabel.TextSize = textLabel.AbsoluteSize.Y / 2
end

updateTextSize()

-- This is so we only update when the text label size changes, which means we're not performing more calculations than we need to
textLabel:GetPropertyChangedSignal("AbsoluteSize"):Connect(updateTextSize)
16 Likes