Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: eventropy on August 31, 2013, 05:45:41 PM
-
I want to apply a mouse over effect that changes the background texture of a UISprite, how would I go about this?
-
public UISprite YourSprite;
void OnHover (bool isOver) //Is called on any widget when you hover the cursor over it
{
if(isOver) //If cursor is hovering
{
YourSprite.spriteName = "String name of your sprite in the same atlas"
}
else
{
YourSprite.spriteName = "Previous name"
}
}
If you need to change the atlas just call YourSprite.atlas and set it to whatever atlas you need.