0

Whenever I add the following lines of code to change a scrolling background (for each switch-case), it becomes jittery for about a second. Each background theme has it's own sprite sheet so I use two batch nodes to handle the switch-cases for their changes.

 [backgroundFrameCache addSpriteFramesWithFile:@"firstThemedBg-hd.plist"];
 backgroundBatchNode2 = [CCSpriteBatchNode batchNodeWithFile:@"firstThemedBg-hd.pvr.ccz"];
 [gameLayer addChild:backgroundBatchNode2];
 currentBackgroundBatchNode = backgroundBatchNode2;

How can I add the batch nodes to the layer in a way that would prevent the jitter?

oopology
  • 1,072
  • 1
  • 10
  • 19
  • do you ever remove the backgroundBatchNode2 from gameLayer? The way i read this (and your previous post), i have the feeling that you keep piling on instances of batchNodes in the gameLayer without really cleaning them and releasing the associated resources. – YvesLeBorg Jul 03 '13 at 02:46
  • At first that was the case but I solved that by removing the batchNode from the layer when it's not in use since I'm using two. I put a CCLOG and realized that adding a batchNode is what's causing the jitter. – oopology Jul 03 '13 at 08:53

0 Answers0