Search Unity

Word Wrap and Checking The Edge of a GUI Window. Help!

Discussion in 'Editor & General Support' started by Zen-Davis, Jun 11, 2014.

  1. Zen-Davis

    Zen-Davis

    Joined:
    Aug 14, 2009
    Posts:
    285
    Basically what is happening is that we're writing a large paragraph of words for a visual novel inside a GUI textbox. When a word reaches the end of the GUI textbox it moves itself down to the next line thanks to word wrap. However this also creates a weird effect where the first few letters of a word write out until they hit the end of the GUI area and when they do the entire word moves itself down to the next line.

    This causes a weird disorientation because as you're reading a word will suddenly move to the next line and it pulls you out of what you're reading because now you need to reorient your eyes to the next line. Is there a way to check where the edge of a GUI window is so that we can automatically send the words to next line without the letters of a word first having to the hit the edge of the GUI window? This way we can automatically move the words to next line before they ever hit the edge.

    What we've been thinking is that you can check for how big the GUI window is and then check how many characters can fit inside that window including spaces and then automatically move the words down to the next sentence. But we're having difficulty implementing this. Any help or direction would be great.
     
  2. Zen-Davis

    Zen-Davis

    Joined:
    Aug 14, 2009
    Posts:
    285