1
NGUI 3 Support / UI2DSprite Pivot
« on: November 09, 2014, 11:36:16 PM »
I was a bit disappointed today to find that UI2DSprite doesn't seem to use the pivot that you can set in Unity's sprite editor.
I have a large number of character sprites which I need to display with the center of their face in the middle of the screen. Some of them are doing cute things like standing on their heads so the pivot point would be different in almost every image even though they are all the same size. Setting the pivot in the sprite import settings makes this really simple. Since UI2DSprite doesn't use the pivot information I added a normal unity sprite renderer into my UI hierarchy which seemed to work well enough, but now the panel alpha doesn't get applied to the sprite renderer. I can write a script to update the sprite alpha with the panel alpha every frame but I'm wondering is there no better solution for this?
I have a large number of character sprites which I need to display with the center of their face in the middle of the screen. Some of them are doing cute things like standing on their heads so the pivot point would be different in almost every image even though they are all the same size. Setting the pivot in the sprite import settings makes this really simple. Since UI2DSprite doesn't use the pivot information I added a normal unity sprite renderer into my UI hierarchy which seemed to work well enough, but now the panel alpha doesn't get applied to the sprite renderer. I can write a script to update the sprite alpha with the panel alpha every frame but I'm wondering is there no better solution for this?