Question by
chattingtek · Mar 21, 2018 at 07:17 PM ·
textunity 2dhorizontaloverflow
[Unity2d] How to reduce text's horizontal size when overflow
So, I was hoping for some way to set "Horizontal Overflow" of a Text UI element to be shrunk horizontally to fit in a container. I'm not quite sure if there is an efficient way of doing so, or if I'll just have to trust "Best Fit". Basically, I'm using a Text element on a Canvas, and I want to fit in a text that's about 170 of width into a 150 width space. That's easy mathing, and it's not exactly difficult to do the long way.
My current solution is to get the width of the text, and do the math from there, but it seems almost impossible to get said width without a loop to keep track of it. Anyone got an idea to help?
Comment