Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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!