Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Jeffom on May 12, 2016, 08:54:33 PM

Title: Updating two or more sprites with one button?
Post by: Jeffom on May 12, 2016, 08:54:33 PM
I have two sprites that are mirrored parts of a texture,
and I need to update their color using only one button, can I achieve this only using UIButton?

Thanks for any help
Title: Re: Updating two or more sprites with one button?
Post by: ArenMook on May 14, 2016, 06:26:56 PM
You can have more than one UIButton script attached. You can also attach multiple UIButtonColor components, which is likely better for what you're doing.
Title: Re: Updating two or more sprites with one button?
Post by: Jeffom on May 17, 2016, 02:58:50 PM
Hello,
I've tried adding two buttons each pointing to one sprite in one object with one collider,
and only the first component is being updated.

I forgot to tell, but I'm using the version 3.7.7 of NGUI (and I'm not able to update it because we're still working with an old release version and we dont want anything to break because of an update)

Title: Re: Updating two or more sprites with one button?
Post by: ArenMook on May 18, 2016, 05:11:54 AM
Not much I can do with an old version of NGUI. I can only support the latest. That said, I am pretty sure nothing button-related has changed since then. Assuming you actually didn't forget to reference different sprites on your two UIButton components, it should work as expected.