Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Auto-Fit Bounds of Text

Discussion in 'UGUI & TextMesh Pro' started by JAKJ, Aug 24, 2014.

  1. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    There needs to be a button and script method to "auto fit" the bounding box of a text object that does not have the "best fit" thing set. I'm trying to use text with a scroll rect, but I cannot just set the text to overflow and have it scroll: The bound box has to be larger than the text, which is problematic when my text is long enough to not fit comfortably in my editing space, or when the text is altered at run-time and I can't even tell how long it is with wrapping. And I can't just make the text bounds larger than predicted need because it'll scroll into empty space.
     
  2. Melang

    Melang

    Joined:
    Mar 30, 2014
    Posts:
    166
    Did you try adding a Layout - Content Size Fitter component to the text object?
     
  3. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    Yeah, that did it. It'll be nice when the beta is done and the documentation is filled out so I don't feel silly asking dumb questions. :p