I was looking today into the animation API trying to understand it...
And I saw the packing function where you give it a bunch of files and it packs using MaxRects for you.
This is slower than just loading something packed. But I figured if I could load each file separately and do a coroutine.yield() between them I could load huge animations without interrupting gameplay/loading bar (a problem my current version of the engine in Corona has... iPad Retina animations are crazy slow to load and freeze everything).
So, how I do it?
If it is not possible... can you add that as feature, please?
Comments
So even with coroutines, if file is large enough, it will freeze the gameplay.
Most common suggestion is to preload all the files on the beginning of the scene.
You can either create a static packed texture (using Texture Packer) and load it on scene start.
Or load all separate files by creating Texture instances for them and storing as scene properties and use them later (you can even create a loading bar and update it between loaded textures this way).
But unfortunately these are the all available options for now.
I think you ALMOST understood me.
I know large enough files will freeze things, that is my point, I want to load smaller files, one after the one using coroutines, instead of loading a large file.
For memory efficiency reasons, it would be awesome if I could load those files separately, and then pack them in memory using maxrects.
so you want to know the progress of loading texture separately, but then also using all the perks of packed texture
Unfortunately yes I don't think it's possible yet.
While you could load all the graphics separately and then try to create the dynamically packed texture like this:
So currently your best bet would be to create static preloader:
http://www.giderosmobile.com/forum/discussion/995/how-can-i-create-preloader#Item_1
or load separate files.
As loading separate file may turn inefficient and won't provide smooth animation, I would go with a static preloader
or even integrate it with SceneManager to appear automatically with every scene:
http://www.giderosmobile.com/forum/discussion/comment/24059#Comment_24059
http://www.giderosmobile.com/forum/discussion/3733/implement-loading-scene-/p1