Ever since the recent change to TextBounds, I’ve noticed that TextBounds will always be set to the absolute-shown size of fonts, regardless of any UIScale object acting on that text.
This caused a few bugs in my game when released, but that’s because I was manually multiplying TextBounds by the scale I had set with my UIScale to get the absolute TextBounds (TextBounds now always shows the absolute TextBounds, regardless of UIScale shinking/growing the text).
It turns out this change also affects UITextSizeConstraint objects, in that UITextSizeConstraints will apply after a UIScale constraint object’s effects, rather than before.
I use UIScale to easily design UI for the smallest supported screen size, and scale up to arbitrary screen sizes when needed, while keeping everything looking the same. This means I usually expect UIScale to always show its decendants consistently. However, with the new TextBounds changes, UITextSizeConstraints no longer respect this scaling, and instead limit the TextSize absolutely:
Old behavior (should look the same no matter what resolution it is scaled up to):
New behavior:
The setup looks something like this:
“ButtonText” has “TextScaled” set to true so it can scale down to any size, but can only scale up to size 20.
If you had removed the constraint, disabled TextScaled, and set the TextSize to 20 manually, it would show this:
However, since UITextSizeConstraint checks against the absolute TextBounds rather than the actual TextSize property, it shows up like this, even though the TextSize should, according to the constraint, scale up to 20 relatively: