Support => NGUI 3 Support => Topic started by: Markov on October 09, 2013, 07:01:47 PM
Title: change spriteName problem in ngui 3
Post by: Markov on October 09, 2013, 07:01:47 PM
Hello! I used to change sprites in this way: sprite.spriteName = "spriteName"; sprite.MarkAsChanged(); But now in new NGUI this isn't working. What should I do? A little clues: - new sprite changes and appears, but doesn't show. If I set alpha to non 1, I see my changed sprite. - also, if I click on sprite in editor it's staeting showing too.
Title: Re: change spriteName problem in ngui 3
Post by: ArenMook on October 10, 2013, 07:34:43 AM
MarkAsChanged shouldn't be needed. The sprite already gets marked as changed when you change its sprite name. This should work just fine. This is how all sprites are changed. Even in the UISpriteAnimation script. What else are you doing?
Title: Re: change spriteName problem in ngui 3
Post by: Markov on October 10, 2013, 03:09:18 PM
Yea I deleted MarkAsChanged() but problem is still here. And it's everywhere in my project where Im changing a sprite name.
Title: Re: change spriteName problem in ngui 3
Post by: ArenMook on October 11, 2013, 08:22:10 AM
What version of NGUI?
The following script works just fine on a sprite with a collider on it, using the Wooden Atlas: