Author Topic: Atlas seems fine, but unaligned?  (Read 2768 times)

Whiskan

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 5
    • View Profile
Atlas seems fine, but unaligned?
« 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!

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Atlas seems fine, but unaligned?
« Reply #1 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.

Whiskan

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Atlas seems fine, but unaligned?
« Reply #2 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!