To create a button in NGUI looks like we need to create something called
Atlas that is a material that contains a lot of little images called
I created a set of 40 sprites (for 20 buttons needed in game, normal state and clicked state) in photoshop in a
2048x2048 image file. When i tried to use NGUI atlas maker i realized that atlas maker requires each sprite in a separate file and wants to merge them in the atlas itself!
Well, i already have them in one file, should i slice all these buttons and save them in 40 other separate files and let the atlas maker merge them again for me? (Sounds very stupid!)
Isn't there any way to give the merged 2048x2048 file to atlas maker (or any other equivalent plugin/software) and then tell the software "Hey! I have 40 sprites in this image, let me tell you where they are! The first one is in (3,3) with size of (150px, 150px), The second one is..."?
UPDATE: I found a part of solution, unity could identify my 40 sprites in texture using
sprite editor tool, but NGUI cannot still find them.
I created a material using "Unlit/Transparent Colored" shader and referencing the atlas to it, then i created a new empty game object, added
UI Atlas component to it and referenced the material in it, but it says there are no sprites. If i make a prefab out of this game object then NGUI can use it as an atlas and my problem will be solved