Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: ivarhill on January 30, 2013, 07:57:39 PM
-
I have a script that changes the sprites of an image button if certain conditions are met - however, the new sprites do not show unless I actively mouseover/press the buttons in question. How can I refresh the image button in order to show the new sprites instantly?
-
Set them via spriteName, not via sprite.
-
Hm - I'm setting them using the normalSprite, hoverSprite and pressedSprite properties of UIImageButton - isn't spriteName a UISprite property? Might be doing something wrong though...
-
Changing those won't update the current state of the background sprite -- you have to update it yourself via its spriteName property.
-
Ah, I see - thank you :)
-
I'm having a further issue with this - the sprite updates correctly now, but the scale is wrong - whenever I change the sprite through spriteName, the buttons are upscaled quite a bit and remains so until I mouse over them - any idea why this might be happening?
-
MakePixelPerfect() on it.
-
Thanks, got it all working now :)