Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to display text in columns in GUI.Label & Why unity imgui not support special symbol "\r" ?

Discussion in 'Editor & General Support' started by Gold_Rush, Feb 18, 2021.

  1. Gold_Rush

    Gold_Rush

    Joined:
    Jan 10, 2018
    Posts:
    64
    I was doing IMGUI Label tests and came to the conclusion that it does not support carriage return by special character "\r".

    But if it was be supported in IMGUI it could be displayed as even columns without problems.

    For example:

    "First column \r\t\t\t data1 \r\t\t\t\t\t data2\r\nMore longer text \r\t\t\t data1 \r\t\t\t\t\t data2\r\nShort \r\t\t\t data1 \r\t\t\t\t\t data2";

    Result:

    | tab 1 | tab 2 | tab 3 | tab 4 | tab 5 | tab 6 |
    Furst column..............data1............data2
    More longer text........data1............data2
    Short..........................data1............data2

    Similar techniques were used in old terminals, but for some reason this was not taken into account in the Unity.
     
  2. daveMennenoh

    daveMennenoh

    Joined:
    May 14, 2020
    Posts:
    101
    TextMeshPro will do what you want - except it's \n for linefeed