As a Roblox developer, it is currently too hard to use AutomaticSize with TextLabels.
I use AutomaticSize to make sure my TextLabels wrap tightly with currency amounts. Then as a child of the TextLabel I add an ImageLabel to show which currency the amount is in.
If Roblox is able to address this issue, it would improve my development experience because this behavior prevents me from being able to easily center text with an image offset of the TextLabel.
This is inconvenient because it causes text to feel off-center. Here is what it looks like with AutomaticSize:
What I want it to look like (text is centered with button)
Hi @Usering - from what I understand, it sounds like you want to be able to automatically size just the TextLabel and ignore child hierarchy from the automatic sizing, is that correct?
One possible way of achieving this is that we could add a constraint to omit an object from automatic sizing, or perhaps new automatic size enum values where child hierarchy is ignored.
With the constraint, the hierarchy would look something like this:
TextLabel
– Coins
— AutomaticSizeConstraint
I’d have to think about this some more, as I’m not sure this approach would work in all cases…
from what I understand, it sounds like you want to be able to automatically size just the TextLabel and ignore child hierarchy from the automatic sizing, is that correct?
Yep that’s the case I need here. From what I could find, Roblox has no AutomaticSizeConstraint object. It’s just a property of any GuiObject that applies to all of its children, as well as whatever content it has itself.
Thanks all for the feedback and request! I’ve created a ticket to investigate this. For now, the solution suggested by @Polyhex - to use a UIListLayout - is your best option.
Thanks for the suggestion. That ends up with the same result as the issue I’m running into; the text is off center with the rest of the button. Hopefully this can be resolved soon!