How to calculate text size from screen size

Simple, perhaps not so simple question.

How does one calculate the largest text size for a GUI object using the player’s screen size? (Deliberately avoiding text scaled property.)

Causing me a headache and would appreciate some suggestions, thanks.

This will basically make the size of text object(not the text) fill all your screen and but op wants to calculate maximum text size that the guiobject can be.

1 Like

By the way if no one responds to this and you cannot find a solution, i have a hacky workaround for it that you can use.

Basically make a for i = 1,100 (100 because max size for text is 100) then set them as text size, then use text.TextFits property to check if it fits for the text, then repeat this until the textfits property return falses so you can use the last text size that text fits it.

As i said this is really real hacky solution so if this thread goes unnoticed you can use this.

@fireboltofdeath showed me this and it seems to work

this is only if anyone experiences this in the future

1 Like