MaxFontSize for TextScaled GUIs

We should be able to set a maximum font size for TextScaled-enabled GUIs.

This is important for box GUIs which can contain varying amounts of text - item descriptions, dialog boxes, etc. TextScaled is necessary if you have a large amount of text that would exceed the boundaries of the container, but it will also give you undesirable results when there is only a small amount of text in it.

Good (the standard, desired text size):

blob.png

Bad (this text is needlessly large, and the font size will vary way too much):

blob.png

Good (TextScaled allowing the large description to fit):

blob.png

Bad (the description doesn’t fit without TextScaled on):

blob.png

Text should not scale above the MaxFontSize. It should only scale down once the text at the MaxFontSize can no longer fit in the alotted area. With this functionality, TextScaled GUIs will always be able to handle any amount of text in a desirable manner.

7 Likes

I just don’t mess with TextScaled at all. Everything I make has a set font size. For something like your description I would put that in a scrolling frame and stick to your nice size.

It’s just an ugly solution to scaling right now.

It’d be interesting to set a clamping for TextScaled to set a Min and a Max value

I’m not sure if I’d use it though

2 Likes

If they did that then I’d try to at least give TextScaled another chance.

In the meantime you could reduce the size of your font if the length of your string is too large (not too accurate since we don’t have monospaced fonts, but you could ballpark it. That, or hack together something with TextBounds).

Adding minimum and maximum clamping to TextScaled would be the cleanest and the best approach in my opinion - and to be honest, I think that anything that scales with GUIs should have a min and max to it, including size and position.

1 Like

We really need this.

As ROBLOX’s future is mobile, we need dynamically scaled text for mobile devices.

This is actually doable now with the UITextSizeConstraint :slight_smile:

http://wiki.roblox.com/index.php?title=API:Class/UITextSizeConstraint

8 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.