Setting the correct sprite size from Atlas


I am new in nGUI.

I have created a widget (UISprite) and I want to change the sprite during the game. My problem is, when I change it, the sprite’s size is the same as the sprite’s before.

Is it possible to get somehow the size from the atlas or create a new sprite in the scripts.


I don’t get exactly what you are asking, but could you write a script to scale the sprite according to some variable?