Hello Guest

Author Topic: Load and Unload Texture Atlas  (Read 7227 times)

Siddharth3322

  • Newbie
  • *
  • Posts: 29
    • View Profile
Load and Unload Texture Atlas
« 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Load and Unload Texture Atlas
« Reply #1 on: January 28, 2014, 10:38:20 am »
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.

Siddharth3322

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Load and Unload Texture Atlas
« Reply #2 on: January 28, 2014, 11:20:13 am »
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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Load and Unload Texture Atlas
« Reply #3 on: January 28, 2014, 11:23:11 am »
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.

Siddharth3322

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Load and Unload Texture Atlas
« Reply #4 on: January 28, 2014, 11:28:53 am »
Based on requirement if I want to load collection again then how to do it?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Load and Unload Texture Atlas
« Reply #5 on: January 28, 2014, 11:34:56 am »
Depends on what you do.
Please search the forums - there are so many ways of doing this and this has been covered numerous times.

Siddharth3322

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Load and Unload Texture Atlas
« Reply #6 on: January 28, 2014, 12:29:39 pm »
Ok, First I will read some posts then I will ask if I don't able to understand any concept.

Siddharth3322

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Load and Unload Texture Atlas
« Reply #7 on: January 29, 2014, 05:46:20 am »
If I create a sprite collection and does not create any sprite from it then it gets loaded into GPU or not?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Load and Unload Texture Atlas
« Reply #8 on: January 29, 2014, 12:00:48 pm »
Yes. This is how everything behaves in Unity. tk2d doesn't do anything special.

Siddharth3322

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Load and Unload Texture Atlas
« Reply #9 on: January 29, 2014, 12:50:29 pm »
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.