Search Unity

How to change a button's sprites via code?

Discussion in 'UGUI & TextMesh Pro' started by joa-baur, Oct 7, 2014.

  1. joa-baur

    joa-baur

    Joined:
    May 14, 2013
    Posts:
    24
    Is there any way to change the graphics of a button at runtime via code?

    I have different button images (sprites) for multiple languages and I just want to assign the target graphic / highlighted sprite / pressed sprite of my buttons dynamically, but I can not for the life of me figure out how to do this in code 8-(