2D Toolkit Forum
2D Toolkit => Support => Topic started by: Siddharth3322 on January 28, 2014, 06:21:01 am
-
I want to know that when texture atlas are loaded and unloaded in 2d Toolkit?
I am experience 2d programmer of AndEngine in that I have way to handle manually each texture atlas. But in 2d Toolkit I don't know same thing.
Basically as per my consideration new graphics are loaded when new scene is created and unloaded when scene is destroyed.
I know that it is pretty broad question but I want to know about basic working of the tool so that I can define my further work strategy.
-
Its loaded the same way anything works in Unity. It gets loaded when the scene is loaded, unloaded when you load a new scene. It is uploaded to the GPU the first time it is visible and renders.
-
If I want to unload some of the texture then is it possible?
If yes, then please guide me in this. Any link describing that content become enough to me.
-
Check the documentation. You can call UnloadTextures on the sprite collection to unload all the textures.
http://2dtoolkit.com/docs/latest/html/classtk2d_sprite_collection_data.html#a76c62e0526249d60ad545290c6c63552
Or delete the sprites, and call Resources.UnloadUnusedAssets.
-
Based on requirement if I want to load collection again then how to do it?
-
Depends on what you do.
Please search the forums - there are so many ways of doing this and this has been covered numerous times.
-
Ok, First I will read some posts then I will ask if I don't able to understand any concept.
-
If I create a sprite collection and does not create any sprite from it then it gets loaded into GPU or not?
-
Yes. This is how everything behaves in Unity. tk2d doesn't do anything special.
-
Thanks for your reply. Previously I am working with Andengine.
I don't have more experience with core unity principle also. I want to know more about this so where I can able to get more information?
If it is a core unity feature then I also want to know about it so that I can able to grab working of unity engine.