1
NGUI 3 Support / Re: Reordering of sprite upon addition to Atlas
« on: June 06, 2014, 02:54:26 PM »
It seems the standard Sort() function in the RebuildSpriteList() function is producing an incorrect result.
As I labelled my spritesheet sprites from 1 and not zero, replacing the call to mSpriteNames.Sort() with the following did the trick:
int amountOfSprites=mSpriteNames.Count;
mSpriteNames.Clear();
for(int i = 1;i<amountOfSprites;i++)mSpriteNames.Add (mPrefix+i);
As I labelled my spritesheet sprites from 1 and not zero, replacing the call to mSpriteNames.Sort() with the following did the trick:
int amountOfSprites=mSpriteNames.Count;
mSpriteNames.Clear();
for(int i = 1;i<amountOfSprites;i++)mSpriteNames.Add (mPrefix+i);
