2D Toolkit Forum
2D Toolkit => Support => Topic started by: monoclesociety on June 13, 2014, 11:10:53 pm
-
I have an array of 12 sprites that I create with a with tk2dSprite.CreateFromTexture. I would like to be able to dynamically create a tk2dAnimation and add them these sprite to it. I've seen some code before that uses a tk2dSpriteCollectionData, but not sure if that would apply.
Thoughts?
-
each tk2dSprite you create in that manner will have a collection associated with it. You can get to it by using sprite.Collection
-
So then for each tk2dSpriteAnimationFrame I would have to associate the collection? I'll look at the previous example, and come back with sample code for a solution so that way anybody else will be able that needs it will have it :-D
-
each tk2dSprite you create in that manner will have a collection associated with it. You can get to it by using sprite.Collection
I'm assuming this is the code that would get me started:
http://2dtoolkit.com/forum/index.php/topic,3671.msg17641.html#msg17641
-
Yes, thats pretty much it. You will need to assign the correct sprite collection and spriteId per frame.