How to keep all text the same size and scaled

I am wanting to keep descriptions for my passes all the same size, but can’t find a good solution. I have a textsizeconstraint inside them, set to max 24, but I can’t really rely on that, as 24 is way too big for mobile, but way too small on larger screens.

I tried using GetTextSize, but it’s not really useful for my situation. But basically, it should set the descriptions to be all at the same size as the ‘smallest’ one, being the one at the top. That way they all look the same size

3 Likes

Something that could work is setting some less tall than others, until it looks the same on all texts. Let me know if you have questions.

https://developer.roblox.com/en-us/api-reference/property/TextLabel/TextScaled

I have that property set. You didn’t read my question. I want ALL the text to be the SAME size. So if text is only a single word, it should be the EXACT same size as a text which is longer.

Then get the size which would be required to bound the text inside of a box and change the FontSize accordingly.

Once again, you haven’t read my question. Please, read the question before trying to give solutions

You mentioned you used GetTextSize() but I assume you did so incorrectly, since it’s perfect for this kind of task, if you really need text to be the same size then why are you setting the FontSize of each label differently?

Can you provide a coded example then? Telling me to try something, that I clearly stated I have already tried is no help

There’s a text size and scale constraint instance you can apply to the UI.

“I have a textsizeconstraint inside them, set to max 24, but I can’t really rely on that, as 24 is way too big for mobile, but way too small on larger screens.”

He already tried this, read the post before trying to help.

Well then he’s probably doing it wrong. That’s the easiest and only reliable way to do it. :joy:

OP needs to look into UI AR and UI Scale constraints.

Tell me how to do it then… I have it set to 24 max, 1 min. There’s nothing I can really do with them to get it perfect. As 24 is way too big for mobile, but 24 is too small for console. Explain how can I can get it perfect across all devices, but for all the descriptions to have the exact same font size, without them being too big for their textlabel

1 Like

Check online for the dev manual, they explain it pretty well there. You just have to test it and see what settings work for you. There’s no coding solution that doesn’t modify one of these properties so changing around the UI properties and setting a few constraints is your only option.

I’ve made many UIs before and I’ve never had to do anything to get size to work properly besides edit the UI property and set a constraint or two. Just look into it a bit more and tweak the settings to see what works for you.

Already tried. I’m telling you, textsizeconstraint is not what I am after. It is of no use to me with this problem

1 Like

Using the text size constraint, I suppose you could identify the ideal max size for your computer, and then scale that max size for each client based on their gui absoluteSize compared to yours.

Say the ideal size on computer is 80, when the gui absoluteSize.X is 600 pixels. If the mobile client gui’s absoluteSize.X is 250 pixels, you would set the max value of the constraint to 80 * (250 / 600).

In this case, the test size would appear the same on all devices (relative to the gui’s size).

Note: I can’t say I’ve tested this out myself, but it makes sense in my head. If you can’t find another solution you may as well give it a shot. I also think it would work best on guis with an aspect ratio set.

12 Likes

I do not get what is the problem you are having here because you seemed to have already solved the problem ._.

But basically, it should set the descriptions to be all at the same size as the ‘smallest’ one, being the one at the top. That way they all look the same size

Is the textscaled property disabled? If you turn it off, you can select a text size yourself.

If this solution helped you, please make sure to mark this comment as your solution :smile: )

I’m aware that this has already been solved, however, for anyone who wants an a different solution, you can find it here: Keeping same Text Size with multiple Text Labels

My solution works by getting the maximum possible text size can be while fitting in the GUI object. Then applies that text size to all text labels

Consider this as an alternative option :smiley:

1 Like