Author Topic: UISprite not changing colors  (Read 3047 times)

schwarzenego

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
UISprite not changing colors
« on: May 31, 2015, 05:02:27 PM »
Hi,

I am tweening the color of a Sprite, tried using both NGUI tweener as HOTween, but both yield the same result on this SPECIFIC sprite. I have a "UIButtonEnhanced" script that I use on all buttons along the project, and it works perfectly... but THIS specific sprite... is not applying the changed color.

Here are a couple of images:

Here is what is happening. The sprite has the gray color, it shows the gray color on the editor... but the color is not being applied to the sprite at all.


Here I just moved like 1 pixel in the Color palette and the sprite finally got the color as it should be, becoming this "dark yellow".


I tried absolutely everything... changing panel configs, refreshing the panel manually... nothing works. I'm using NGUI 3.8.2 and Unity 4.6.4f1, and this happened before but this time I just cant get this to work.

PS: As you can see, the UILabel inside is being changed, and is gray instead of white.

Thanks!
« Last Edit: May 31, 2015, 05:17:24 PM by schwarzenego »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UISprite not changing colors
« Reply #1 on: June 01, 2015, 09:03:28 PM »
TweenColor is fully capable of tweening the color, however if you have a button component on it affecting the same sprite, then you're going to have a conflict as both use TweenColor to accomplish their task.

schwarzenego

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: UISprite not changing colors
« Reply #2 on: June 01, 2015, 11:10:31 PM »
Unfortunately thats not the case. I have a custom "button" script on it, and it is the only script affecting the colors of the sprite. It affects all widgets recursively, thats why the text inside is getting grayed out. What I don't understand is that I am using this same script across the whole project (not a small game, tons of buttons lol), and this is the only case this is happening... mostly I'm not even using NGUI tweens (even though they are awesome, I'm using Hotween because this is what everyone is using on the project), and everytime I start a tween on the color or any component I kill the previous tween so I make sure there is no conflict.

What I think is strange is that it does tween to the right color... it just doesnt show up... can this be related to something like executing on awake/start, idk...?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UISprite not changing colors
« Reply #3 on: June 07, 2015, 12:13:08 PM »
What does HOTween actually animate though? If it's interpolating MColor -- a private value -- then you're going to have a bad time as it should be going through the "color" property -- which NGUI tweens do by default.