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

Question Change style sheet at runtime

Discussion in 'UGUI & TextMesh Pro' started by draky, Nov 30, 2022.

  1. draky

    draky

    Joined:
    Nov 24, 2016
    Posts:
    12
    Hey everyone,

    I was wondering if its possible to change the TMP default style sheet at runtime? Were looking at having different style sheets with same named styles, just formatted differently.

    So for example:
    Style sheet 1:
    Heading 1 - font size 20, color purple
    Heading 2 - font size 20, color yellow

    Style sheet 2:
    Heading 1 - font size 12, color red
    Heading 2 - font size 12, color green

    If when the the program is loaded the user has selected 'style 1', we load in Style Sheet 1, if not we load in Style Sheet 2.

    I cant seem to find much at all in regards to this, and any help would be greatly appreciated.

    Thanks!