I have an issuue with replacing scenes: scene replacement goes on for 5 to 10 seconds. I thought that this problem is caused by heavy initialization sequences (I’m using 2048*1536 resolution and I also happen to load lot’s of animations), so I “extracted” some heavy initialization routines via creating some kind of cache and preloading some resources while playing “Loading” animation. That didn’t help, regretably. So it seems that the main problem is actual scene rendering routine.
Is there any way to speed the application up (some hacks for manual texture rendering, maybe)? Alternativelly I’m looking for a technique to keep “Loading” animation running, until my next scene is 100% ready: all actions and animations are stopped right after replaceScene is called, so I ither need a hack to run this animation until scene replacement is finished, or do something in order to speed up replaceScene routine itself.
Hello @Farrel7786729,
Am not so sure about how to speed up loading scene. You can even look into **Texture Packer** to reduce the size.
If your are thinking about Loading animation until scene is completely ready, then we can try this.
For each Layer we have one built in functions namely onEnterTransitionDidFinish
Initialization sequence of images can be done in Init function. and Add Loading animation Here.
Check once in your criteria when the onEnterTransitionDidFinish function will be called.
Then remove the Loading Animation & start the game from onEnterTransitionDidFinish function.
Regards,
Gurudath
Well, thank you answer anyway, but your solution does not work for me, in case I understood you right. It seems that I I can solve part of my problems by reducing amount of memory used. What actually helped me a bit is separate Loading Scene creation. It does not speed up loading, of course, but it reduces peak memory usage dramatically and adds some “movement” to my scene replacement routine, so app doesn’t look like it’s hang up.