Quantcast
Channel: UGUI & TextMesh Pro
Viewing all articles
Browse latest Browse all 23263

TMPro text bounds doesn't count end whitespace

$
0
0
Hey folks!

I'm currently trying to create an InputField that dynamically resizes based on the size of the text content.

I've had great success with the following code:
Code (CSharp):
  1. ((RectTransform)transform).sizeDelta = new Vector2(((RectTransform)transform).sizeDelta.x, Mathf.Max(80, myText.textBounds.size.y + 40));
However when entering any spaces or returns at the end of the text in the input field, the textBounds value doesn't update. It seems that it only registers visible...

TMPro text bounds doesn't count end whitespace

Viewing all articles
Browse latest Browse all 23263

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>