1
NGUI 3 Support / Possible bug in radial fill center coordinates?
« on: February 09, 2014, 01:00:55 AM »
This certainly isn't a critical bug or anything, but I was a little surprised to see that when using the radial fill feature of UISprite, it appears to use the optimized atlas size instead of the original image's dimensions for determining where the center is.
I have a couple of "arc" shapes that I'm doing radial fills on that represent about 220 degrees of circles. In one case, the original image was 512 x 512 with a transparent background. That got optimized to 453 x 502 and when using the Snap button on the UISprite inspector, it went to the original 512 x 512 size. So it knows what the original was.
When doing a radial fill though, NGUI is clearly using the 453 x 502 image to calculate the center, but it should be treating it like 512 x 512. So the center was off and it was screwed up.
I worked around it by putting pixels in the corners of the textures to force the full size in the atlas, which does work. But of course it's not great to use up extra space in the atlas. In my case, it's OK, since I've only got a few weird arcs like that and in this particular case, I'm not rendering the corners.
On that subject, it sure would be nice to have a starting and ending angle for doing arc-shaped radial fills.
As it stands, I end up having to author the images with the start or end at the top and then rotating the sprite into position in Unity.
I have a couple of "arc" shapes that I'm doing radial fills on that represent about 220 degrees of circles. In one case, the original image was 512 x 512 with a transparent background. That got optimized to 453 x 502 and when using the Snap button on the UISprite inspector, it went to the original 512 x 512 size. So it knows what the original was.
When doing a radial fill though, NGUI is clearly using the 453 x 502 image to calculate the center, but it should be treating it like 512 x 512. So the center was off and it was screwed up.
I worked around it by putting pixels in the corners of the textures to force the full size in the atlas, which does work. But of course it's not great to use up extra space in the atlas. In my case, it's OK, since I've only got a few weird arcs like that and in this particular case, I'm not rendering the corners.
On that subject, it sure would be nice to have a starting and ending angle for doing arc-shaped radial fills.
As it stands, I end up having to author the images with the start or end at the top and then rotating the sprite into position in Unity.
