2D Toolkit Forum

2D Toolkit => Support => Topic started by: emmettoc on September 26, 2013, 08:37:12 am

Title: SpriteCollection in Resources
Post by: emmettoc on September 26, 2013, 08:37:12 am
Hello,

I want to load sprite collections in code, so I move them in "Resources" directory. But the following error appears:
 
Quote
Spirit Collection is in a resources directory. All source textures will be included in build.

What actually does this mean? Should not I use sprite collections in "Resources"?

Thank you.
Title: Re: SpriteCollection in Resources
Post by: unikronsoftware on September 26, 2013, 12:07:05 pm
You only need to move the sprite collection data object. That is what you'll load at runtime and feed into tk2dSprite.SetSprite(...)
Title: Re: SpriteCollection in Resources
Post by: wagenheimer on February 19, 2014, 01:48:26 pm
I need to change the SpriteCollection on Code.

I added a variable public tk2dSpriteCollectionData spriteCollection where I set the SpriteColletion in Editor.

So after I can use :

spriteItem.SetSprite(spriteCollection, id);

But If I use this variable, all source images from SpriteCollection seems to be loaded. How the correct way of doing this?
Title: Re: SpriteCollection in Resources
Post by: unikronsoftware on February 19, 2014, 01:53:05 pm
The source images won't be loaded if you're only referencing tk2dSpriteCollectionData. There is no reference to them in there. If you put something in resources, make sure its ONLY the data object and nothing else.