Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: sachaM on December 09, 2012, 06:27:16 AM
-
Hello
I did a classic button (unbutton) and changed its textures manually (swapping the pressed and normal one) by script to signal an event.
i'm using the xx.spritename="my texture".
The inspector shows the changes correctly but visually nothing happens until the mouse goes hover the button.
i tried a forced panel update , xx.markaschanged but nothing works.
I guess i missed something somewhere...
thanks for your help
-
Changing the sprite on the button script won't do anything. You need to change the spriteName of the actual background sprite.
-
i did it on both : background (slicedSprite) and Button itself (UIImageButton) :
_icon.spriteName=_on;
_button.normalSprite=_on;
_button.hoverSprite=_on;
_button.pressedSprite=_on;
-
Then it should work. What version of NGUI, Unity, and is the panel your sprite belongs to clipped or not?
-
yes, the panel is clipped one with a dragable panel and the usual parented scrollbar.
The release used is the last one.
I'm trying to do something like a classic tab panel with tabs added on demand.
-
I saw no issues with swapping of normal sprites belonging to a clipped panel. There is an issue with swapping textures belonging to a clipped panel, however. See this topic: http://www.tasharen.com/forum/index.php?topic=2465.0