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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Text Horizontal Overflow "Truncate"?

Discussion in 'UGUI & TextMesh Pro' started by DarkSchneider, Oct 28, 2015.

  1. DarkSchneider

    DarkSchneider

    Joined:
    May 25, 2015
    Posts:
    12
    I need to truncate the text to its container horizontally, but I see no option for that.

    One solution, while is not available, could be to cut the string. How can I get the width of the text and its container for this?.
     
  2. DarkSchneider

    DarkSchneider

    Joined:
    May 25, 2015
    Posts:
    12
    I finally have done it with a mask.
     
    greenpower likes this.
  3. greenpower

    greenpower

    Joined:
    Jan 8, 2013
    Posts:
    4
    Yep, it works with the mask. Just include the mask in the parent object. If you have a toggle, like I do, put the Mask and Image componentes in the toggle and voilá.

    Thanks.
     
  4. Inter-Illusion

    Inter-Illusion

    Joined:
    Jan 5, 2014
    Posts:
    597