Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: jeldrez on March 17, 2014, 01:05:42 PM

Title: Change widgets color at runtime
Post by: jeldrez on March 17, 2014, 01:05:42 PM
There's a way to change the color of several widgets at runtime?
I'm using white/light-grey assets so I add color using the widget property. But I'll like to change all the assets colors at the same time.

Example:
Change all widgets with this color to the next one:

Base)           To)
R: 255          R: 150
G: 255          G: 200
B: 150          B: 150
A: 255          A: 255

Any help will be appreciated!
Title: Re: Change widgets color at runtime
Post by: ArenMook on March 18, 2014, 02:59:04 PM
GetComponentsInChildren<UIWidget>() and iterate through them changing the color to what you want.
Title: Re: Change widgets color at runtime
Post by: jeldrez on March 19, 2014, 08:50:56 AM
yeah, but I was thinking to change the color itself, like Black is not Black anymore it it's Yellow.

A colleague recommend me to use Tag to all the assets I want to change and then look for all of them and change ir looking for that specific tag. Apparently that's the approach.