Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Whiskan on November 11, 2014, 12:27:40 PM

Title: Atlas seems fine, but unaligned?
Post by: Whiskan on November 11, 2014, 12:27:40 PM
Hey, I tried searching the forum but couldn't come up with anything (likely because I'm not sure what to ask, per se).

I create an atlas at the largest size (4096 I believe) and everything looks fine within the atlas itself. However, when I go to create a sprite or button (or whatever) the images are all unaligned. For instance, if I had an apple and an orange for two separate icons, the top half of the apple is raised beyond view, while the orange's top half appears at the bottom. I would love to provide screen shots but they are on a separate machine and I don't have the time currently.  :'( sorry!

Anyway, what would my issue be? I realize that unity works in powers of 2, and some of my menu items are NOT following that trend. Does this cause NGUI to get wonky when dealing with objects within the atlas? If I don't have an answer by tomorrow, I'll try to adjust the file sizes and post my findings here.

Until then, if anyone has any useful information, I would greatly appreciate the assistance! Thanks!
Title: Re: Atlas seems fine, but unaligned?
Post by: Nicki on November 11, 2014, 02:09:44 PM
This is usually because the prefab hasn't been saved properly to disc, so the position of each sprite is off. Try updating the atlas, then save project and scene that should make it save properly.
Title: Re: Atlas seems fine, but unaligned?
Post by: Whiskan on November 12, 2014, 09:29:05 AM
This is usually because the prefab hasn't been saved properly to disc, so the position of each sprite is off. Try updating the atlas, then save project and scene that should make it save properly.

Turns out, this quickly and easily fixed my problem! Thanks so much!

For anyone who wishes to use this information in the future:

1 - Make sure your "Atlas Maker" tab is open (NGUI / Open / Atlas Maker).
2 - Select every image contained within the atlas (they should be somewhere in your project folder under "Assets").
3 - You'll notice then when they are selected, the word "Update" appears next to each image in the Atlas Maker tab. Click the button above the sprite list called "Add/Update"
4 - This should update each image. You may then save your project how you would normally.

There! I hope this helps people in the future!