Search Unity

TextMesh Pro TMPRos using joint material

Discussion in 'Unity UI & TextMesh Pro' started by kitsoRik, Jan 9, 2019.

  1. kitsoRik

    kitsoRik

    Joined:
    Aug 28, 2018
    Posts:
    3
    Hi all, in general, I need to do some TMPro objects (TextMeshPro) on canvas, everyone should have one font, but different settings (stroke color, etc.), but if all the texts use one font, then the settings will be common, as an option you can simply grab the project folder, and set new settings, do not want to occupy the memory of excess 200-300 kb. How can I change the material?

     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,269
    To manage visual styles for individual font assets, you would use Material Presets. See the following video which explains the feature.



    Material Presets are very efficient and avoid resources duplication as they are simply a material with the relevant settings for the visual style but referencing the same atlas texture of the font asset.
     
    kitsoRik likes this.
  3. kitsoRik

    kitsoRik

    Joined:
    Aug 28, 2018
    Posts:
    3
    Thank you, i watched this video yesterday, buy i skiped moment when he created other material.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,269
    BTW: The Create Material option was renamed a while back to "Create Material Preset" which more accurately reflects what it does.