TextLabel.TextScaled Multiplier

As a roblox developer, it is currently too hard to give TextLabels and TextBoxes borders between their text and the end of the box. Currently, TextScaled must be checked to avoid problems with resolutions. Here’s an example of the same text box on XBOX vs iPhone:
XBOX:
image
iPhone X:
image

Note that the iPhone X has a noticably higher resolution than many other mobile devices.

Obviously this is not desired behavior, and has to do with the fact that TextSize is calculated based on Offset and not Scale. The only way around this is to:
A) make your own Size calculator based on screen resolution
B) Make a TextScaled copy of the button and parent it to the other button.

The problem is that these both are hacky solutions that could break hierarchical scripts that rely on things within the button, or the button itself.

An easy way to fix this solution would be to add a multiplier value to TextScaled. at the moment, TextScaled has a default and unchangable multiplier of 1, but if devs can set that value to, for instance, 0.5, the text would scale as if the TextLabel were half the size it is.

Borders make text easier on the eyes, and I have to say I’m surprised roblox doesn’t already have this considering how easy it would be to implement. This would make platform support easier by not requiring devs to redo menus that they may have already coded and prepared for PC or Xbox.

Thanks!

5 Likes

Your solution is good, but I think this problem could potentially be solved better if we were given an option to configure text margins themselves, with a UDim2 property that works similar to the Padding properties in UI layout objects. This would mean this feature is also useful for developers who are using the offset text system, and would let people configure where text actually gets cut off (and new lines created) when using TextWrapped/ClipsDescendants. It would also let people make the margin only apply to one side of the text (e.g. 0 left margin, 0.5 right margin) for whatever use that may have.

2 Likes

Using a UDim for the Padding would be a neat feature actually - UDim2, X for horizontal padding, Y for vertical padding; I never thought of that but it would give more freedom to those who (freely choose to) make their life hard using offset :smiley: (lmao)

Actually now that I think of this it’s basically just a multiplier (Scale) with the option to add offset with it.

1 Like