So, I am trying to use Unity2D to create a TCG/CCG video game, and I seem to have hit a light bump: I cannot seem to efficiently resize horizontally text that ends up being larger than its container. (Example: Text has a width of 200, I want to fit it in 170). I mean, Unity did have a "fixing" with the option "Best Fit", but it didn't quite work as well as it should have, instead changing the font size to better fit it (Which is not the expected result.)
Now, I know that I could just find the width of a text, check if it overflows, and then apply simple math to scale it on the width side. That's something I'm currently trying to put into the code: But! I am looking for something I would have overlooked within Unity. Something that would do it faster, without me having to hard code it.
Now, what I have tried thus far (to avoid repeat of those offers):
- Best Fit (actually changed the font size, which didn't fit my needs)
- Both "Horizontal Overflow" settings
- Content Size Fitter (Additionally, I seem to not be able to GetComponent<> that one.)
If you know of any trick I should probably know, feel free to let me know: It'd help my coding a lot.
Thanks in advance!