Sorry if I have to repost my question. I've tried to ask this before but it's been 3+ weeks & I haven't got any answer yet. I've tried many ways but still I can't find a way to solve it. My problem is I'm scrolling 3 background sprites for my game scene. And I got horizontal gap between sprites. Plz help me with this. The gap is pretty small on simulator. But when I tried on device, the gap became bigger. I'm doing some testing on iPad simulator. Amazingly the gap's gone. Here's my code. Plz analyze it. Thanks.
- (void)addBackground {
CGSize winSize = [[CCDirector sharedDirector] winSize];
_bg = [[NSMutableArray alloc] initWithObjects:
[CCSprite spriteWithFile:@"level1-a.png"],
[CCSprite spriteWithFile:@"level1-b.png"],
[CCSprite spriteWithFile:@"level1-c.png"],
[CCSprite spriteWithFile:@"level1-a.png"],
nil];
[[_bg objectAtIndex:3] setPosition:ccp(winSize.width * 0.5, winSize.height * 1.5)];
[[[[_bg objectAtIndex:3] textureAtlas] texture] setAliasTexParameters];
[[_bg objectAtIndex:2] addChild:[_bg objectAtIndex:3]];
[[_bg objectAtIndex:2] setPosition:ccp(winSize.width * 0.5, winSize.height * 1.5)];
[[[[_bg objectAtIndex:2] textureAtlas] texture] setAliasTexParameters];
[[_bg objectAtIndex:1] addChild:[_bg objectAtIndex:2]];
[[_bg objectAtIndex:1] setPosition:ccp(winSize.width * 0.5, winSize.height * 1.5)];
[[[[_bg objectAtIndex:1] textureAtlas] texture] setAliasTexParameters];
[[_bg objectAtIndex:0] addChild:[_bg objectAtIndex:1]];
[[_bg objectAtIndex:0] setPosition:ccp(winSize.width * 0.5, winSize.height * 0.5)];
[[[[_bg objectAtIndex:0] textureAtlas] texture] setAliasTexParameters];
[self addChild:[_bg objectAtIndex:0] z:0];
[[_bg objectAtIndex:0] runAction:[CCRepeatForever actionWithAction:
[CCSequence actions:
[CCMoveBy actionWithDuration:30 position:ccp(0, -winSize.height * 3)],
[CCMoveTo actionWithDuration:0 position:ccp(winSize.width / 2, winSize.height / 2)],
nil]]];
}