Hey everybody,
I’m beginning to put the finishing touches on an app I’m hoping to release in the next month or so and part of my clean-up has been to consolidate all of my images (which I’d been keeping in separate PNGs during development) into image sheets: one sheet for each scene in the app. I use storyboard to manage my scenes, and only load a single scene into memory at a time - I call storyboard.removeAll in every scene’s “enterScene” function. On average, these image sheets contain anywhere from 20 to 30 images on them. (I’m using TexturePacker to prepare my image sheets.) My understanding, based on official Corona Labs documentation and blog posts, is that consolidating into image sheets will maximize texture memory usage and should result in zippier performance. And my project’s image folder gets considerably tidier and easier to manage, which is indeed a nice perk.
In practice, however, I’ve noticed that while my texture memory usage is indeed (slightly) lower because I’ve consolidated images, load times for my scenes have actually gotten noticeably longer - scenes that previously loaded with no noticeable lag on-device can now take up to a second or a two, during which time the app becomes unresponsive (while the new scene’s “createScene” function is being called). Once the scene is loaded, performance is no different than before, but the loading delay struck me as odd. At the end of the day, I can always add a spinning wheel or other “I’m loading” indicator to cover the slight delay, but I was surprised to find that performance seems to have taken a hit because of a step I took to improve performance. It sounds weird, but I may just go back to using separate PNGs because the app felt more responsive that way.
Has anybody else noticed this in their projects? Any ideas of how I can keep using image sheets instead of separate PNGs but get that faster load time back? I’d love to get any feedback on this.
Thanks,
Jason