Hello Guest

Author Topic: About SpriteID  (Read 3500 times)

Companella

  • Newbie
  • *
  • Posts: 29
    • View Profile
About SpriteID
« 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: About SpriteID
« Reply #1 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.

Companella

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: About SpriteID
« Reply #2 on: January 20, 2014, 01:15:25 pm »
Oh, I drag imgs one by one, then it makes linear indices.
Thank you~