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

Resolved More convenient text customization

Discussion in 'UGUI & TextMesh Pro' started by JiRo_Dev, Aug 26, 2022.

  1. JiRo_Dev

    JiRo_Dev

    Joined:
    Jun 8, 2018
    Posts:
    48
    I learned not so long ago that Unity is developing a new UI system, I was wondering if it's going to support better customization like the ability to change colors of letters in a single Text (TextMeshPro) rather than having to create a new text for each color.

    Thanks.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,225
    JiRo_Dev likes this.
  3. JiRo_Dev

    JiRo_Dev

    Joined:
    Jun 8, 2018
    Posts:
    48
    Thanks for the answer,

    I wasn't aware of RichText, apparently it's doing just that and more.
     
    karl_jones likes this.
  4. seldemirov

    seldemirov

    Joined:
    Nov 6, 2018
    Posts:
    48
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,225
    What do you mean? You want to change the text color so people can type like an ide?
    You would do this by having 2 versions of the text, 1 is the original and the other is the version that has been parsed and populated with color tags, this one gets displayed but the other version is what you edit. We already do this for the InputField when you are using IME. Im not aware of us adding additional support for this at the moment though.
     
    seldemirov likes this.
  6. Trisibo

    Trisibo

    Joined:
    Nov 1, 2010
    Posts:
    245
    That link seems to be missing several tags that can be used with TextMeshPro, this one has all (AFAIK): https://docs.unity3d.com/Packages/com.unity.textmeshpro@4.0/manual/RichText.html. It's indeed possible to do a lot with them.
     
    karl_jones likes this.
  7. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Yes there are some tags that are not supported fully in TextCore that are supported in TextMeshPro. We are working on closing this gap so UI Toolkit has the same functionality as TextMeshPro does for uGUI.
     
    karl_jones likes this.
  8. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,113
    Is that TextCore is only for UI Toolkit runtime UI or it also can support uGUI?
     
  9. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,225
    TextCore is currently UI Toolkit but parts of TextMeshPro are now using it. It will gradually over time shift more to TextCore but from a UGUI standpoint you wont notice, you will still be using TextMeshPro with UGUI.
     
  10. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,113
    Does it mean TextMeshPro with UGUI won't get any more improvement like making multiple different font asset render 1 batches instead increase 1 batches per different font asset?
     
  11. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Thats not a limitation of TextMeshPro but of uGUI, so in this case you would be correct i dont think we'd ever get to that state of 1 batch for fonts.
     
  12. seldemirov

    seldemirov

    Joined:
    Nov 6, 2018
    Posts:
    48
    I meen this:
    https://docs.microsoft.com/en-us/visualstudio/ide/using-intellisense?view=vs-2022

    If we need to write code inside the editor, then we would like to have such tools.
     
  13. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,225