Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Splitting a label with multiple types of data into multiple text elements

Discussion in 'UGUI & TextMesh Pro' started by Isopood, Dec 5, 2023.

  1. Isopood

    Isopood

    Joined:
    Oct 25, 2023
    Posts:
    6
    Hi. I've built a UI element.

    In it's current state, it's nothing more than a giant text box and an unappealing infodump. This is made with a Canvas which contains a TextMeshPro and a png of a black box with green outlines.

    upload_2023-12-5_14-58-37.png

    I want to make this UI element better.

    The current idea on how to do this is by making the above as a png and importing it into a Canvas, and setting up multiple textboxes for each element. So, one for CreatureName, one for Location, one for HP, etc.
    upload_2023-12-5_14-58-21.png

    I don't know whether this is the "proper" way of doing it and would like to know if there's a better way of doing it. Please let me know if there's a better way of doing it.
     
    Last edited: Dec 5, 2023
  2. jamesf42

    jamesf42

    Joined:
    Mar 10, 2023
    Posts:
    10
    If you want columns or interior border lines like that then your approach makes sense to me.
    You can do a lot with the rich text tags though, even columns (awkwardly) ie.`<pos=50em>Column1<pos=100em>Column2`.
     
    Isopood likes this.