2D Toolkit Forum

2D Toolkit => Support => Topic started by: Companella on January 20, 2014, 09:47:02 am

Title: About SpriteID
Post by: Companella on January 20, 2014, 09:47:02 am
Hi all!
When I make a SpriteCollection, the spriteID is 58,30,0,7..... why not is 0, 1, 2, 3... ?
What inside rule to make ID?
I want to use a script adapte tk2dSprite, need linear indices to animate on Mecanim.
Title: Re: About SpriteID
Post by: unikronsoftware on January 20, 2014, 11:39:08 am
SpriteID is assigned in the order in which the sprites are added to the collection. If you aren't using your sprite collection explicitly anywhere, you can reorder it by writing an editor script to sort the tk2dSpriteCollection.textureParams array the way you want to. After that call tk2dSpriteCollectionBuilder.Rebuild( collection ) to rebuild it. Remember though if you have existing sprites using this collection, the references will be broken.
Title: Re: About SpriteID
Post by: Companella on January 20, 2014, 01:15:25 pm
Oh, I drag imgs one by one, then it makes linear indices.
Thank you~