2D Toolkit Forum

2D Toolkit => Support => Topic started by: bahaahamza on March 28, 2015, 01:57:27 pm

Title: Sprite collection - why both atlas and images included in build
Post by: bahaahamza on March 28, 2015, 01:57:27 pm
Hi

i have a sprite collection with multiple images. I thought an atlas will be created, and this atlas will be used in the final build.
But checking the Editor.log file, i found both the atlas and the separate images included during build.
Is this the normal behavior, or is there a way to exclude the images and use only the atlas?

This is how the Editor.log looks like:
Used Assets, sorted by uncompressed size:
 8.0 mb    17.0% Assets/Test/SpriteCollection/Images1 Data/atlas0.png
 1.2 mb    2.5% Assets/Test/Images/Small/image1.jpg
 982.6 kb    2.0% Assets/Test/Images/Small/image2.jpg
 960.1 kb    2.0% Assets/Test/Images/Small/image3.jpg
 900.1 kb    1.9% Assets/Test/Images/Small/image4.jpg
.....

There are many images, their total size ~27M. The atlas is 8M, so the total is 35M.

Sorry if it's a duplicate question, i already searched in FAQ and in the forum but failed to find a similar one.

Thank you.
Title: Re: Sprite collection - why both atlas and images included in build
Post by: unikronsoftware on March 28, 2015, 02:09:24 pm
Have you dragged a reference to the sprite collection (tk2dSpriteCollection) object anywhere in your project? The tk2dSpriteCollectionData object, i.e. the one thats used at runtime, doesn't have any references to the source images.
Title: Re: Sprite collection - why both atlas and images included in build
Post by: bahaahamza on March 28, 2015, 02:25:16 pm
Thanks a lot.
Indeed that was the problem, I've been always using the sprite collection (attaching it to a script then getting the Data inside script).
I used the sprite collection data instead, and the issue is resolved.

Thank you :)