Search code examples
unity-game-engineunity-ui

UI Text Horizontal Overflow Wrap mode


As shown in the image below, I have set the text to wrap and overflow in the box, but no matter what combinations I pick, when the sentence runs long, it continues to the right and disappears from the game view. What am I doing wrong that I cannot contain the text in the box and get it to enlarge if the user keeps talking?

enter image description here


Solution

  • Set horizontal overflow to Wrap, vertical to Overflow, and Size fitter's vertical fit to Preferred size. By modifying width of element, you decide which sentences are considered "long". Long sentences will be wrapped, and size fitter will change the height of the element.