2D Toolkit Forum
2D Toolkit => Support => Topic started by: brain56 on September 19, 2012, 02:30:16 am
-
Noob question. Haha. I'd like to extract the tk2dSpriteCollectionData from a given tk2dSpriteCollection. How do I do this? I can't seem to find any methods related to this. Thanks! ;D
-
The member you want is .spriteCollection
Why do you need this? Its probably not a good idea to rely on this - the next version will have more than 1 data object attached to one object for runtime atlas swapping, etc. If you tell me your needs then perhaps I could suggest something which won't break in the next version.
-
Well... I need to change the SpriteCollection from the sprite in RunTime, how this is possible without breaking anything (SetSprite requires a SpriteCollectionData for this)?
-
Why do you need to assign the SpriteCollection rather than the data object? The SpriteCollection itself contains references to your source images, etc. and should never be used at runtime. The data object is what contains the optimised atlas and no references to the source images.