I have 20 images in my game which are used in a gallery and on the score screen. They are quite memory consuming on my iPhone 4 (via CocoonJS Launcher App, using Canvas 2D/WEBGL).
my layout buildup is like this:
title screen -> game screen -> score screen -> game screen or title screen
gallery screen (via menu button on title screen)
option screen (via menu button on title screen)
hidden layout to initial spawn all highscore screens, otherwise I cant let them spawn in my gallery
currently the game loads every single file (*.png) on start of the game, even if the highscore images arent used in the first 2 layouts (title screen -> game).
This makes the game extremely laggy. If I remove all highscore images from the game it runs smoothly, so the problem is definitely with the images. strangely enough the gallery navigates without lag.
Is there an option, that the game only loads the images when it is supposed to do it? ( gallery and score screens, NOT the beginning of the game)
I also placed a "On Start of Layout => HighscoreParent -> Destroy" to every layout, but nothing changed (as expected)
gallery image usage:
score screen image usage
thanks in advance for help! (=