Hopefully this will be my last question relating to AtlasAnimations for a while :/.
The game I am working on is a series of minigames I have set up each as separate Scenes. All of these minigames feature the same character. This character is a sprite which contains 4 AtlasSpriteManagers each with a single AtlasSprite and a single AtlasAnimation (it's a big character with pretty specific animations).
When I create each scene, I create this character Sprite and init and add as children all the AtlasSpriteManagers and their AtlasSprite children. I then do setVisible: NO on them all. So they are all present and ready to be used when the scene appears on screen.
To play one I setVisible: YES on the relevant AtlasSpriteManager and then call a runAction: with the AtlasAnimation to actually play the animation.
When I test on the phone (and on the phone only) the following happens: the very first time I play any individual animation I seem to only see a couple frames of the animation. It almost looks like what is happening is the animation starting playing before the setVisible: YES takes effect. Or maybe it's just dropping frames? There is a small but noticeable lag when this happens.
Every subsequent play of the same animation works fine.
I know it's hard to say anything without seeing the code, but does anyone have any thoughts about how I can avoid this problem? Is there some kind of caching or preloading I can do -- I thought creating all the AtlasSpriteManagers and AtlasAnimations and adding them to the Layer would do this, but maybe not?
Would it help to retain the character and pass him from scene to scene? Right now I'm deallocing the old one and creating a new one for each scene, which seemed cleaner.
Thanks in advance for any tips!