"LineCount" property for TextLabels, TextBoxes, and TextButtons

As a Roblox developer, it is currently too hard to make text of varying lengths scale well with TextScaled enabled. We need some way of telling Roblox “hey, this text container’s text should be scaled as if there are going to be [x] lines of text, regardless of whether the text will completely fill that space.”

As an example, take a look at this dialogue box. The screenshot resolution is 720p, and the text is more or less the proper font size.

However, the text does not have TextScaled enabled, which means at a higher resolution (let’s say 1080p), the text will be far too small! It will look like this:

So what happens if I now enable the `TextScaled`` property? The text will scale to fill all available space and I end up with this:

Obviously, this is less than ideal. This happens because the string of text is so short that the text can be as tall as the TextLabel itself and still fit on one line. If we as developers had access to something like MinLineCount and MaxLineCount properties that made sure the text would always be rendered as though it required that many lines to fit, regardless of whether or not it actually required that many lines, then it would be much easier to have dynamic text that scales the way I intend it to.

23 Likes

Hi @Rocky28447 - would UITextSizeConstraint work for you?

With TextScaled + UITextSizeConstraint, I believe you’ll be able to achieve what you’re looking for.

I don’t believe that it would. If UITextSizeConstraint could constrain text as a percentage of frame height rather than an absolute text size then yes it would. But this is not how UITextSizeConstraint works afaik.

Here is a quick drawing that visualizes what this feature request is asking for:

5 Likes