Keeping Consistent Text Size

I’m making a timer for a little chess prototype and I’m having trouble keeping a consistent size for the text in my timers.

Currently, I have tried two things.

  1. Set TextScaled to true

  2. Set a FontSize

Both haven’t worked so far.

  1. If I set it to textscaled then the size of the text changes every time the text is updated because of small differences in number size

  2. Setting a font size makes it so that players with a different resolution than the one I created the UI with, would have part of the text be cut off or maybe are too small

So I’m asking if there is any way to keep the text a consistent size without scripting, which would give me much fewer headaches in the future.

2 Likes

With a UITextSizeConstraint you’re able to set the minimum and maximum size that your textsize will reach.

2 Likes

Set the TextSize to workspace.CurrentCamera.ViewportSize.Y/25 (Change number divided by based on how big or small you want the text to be. Also put it in a While Loop so its always accurate.

This works because it is getting the amount of pixels the users screen is and is setting TextSize based off that changing depending on Screen Size.

Example:

while true do
	script.Parent.TextSize = workspace.CurrentCamera.ViewportSize.Y/25
	wait()
end
3 Likes