I’m currently working on the interesting example in cocos2d. I have a sprite, that is a line, that just moving(with the help of CCAction) on my background. But the line is 4000 pixels wide. iOS 4.x is supporting not more then 2048 pixels by 2048 pixels. So I decided to cut the line in to two pieces. So, now I have two images, 1920 x 1920. Now I want to do the same thing that I did previously. This is really simple code:
CCSprite *abstractFigureLine = [CCSprite spriteWithFile:@"Abstract Figures Line.png"];
abstractFigureLine.position = CGPointMake(960.0f, 160.0f);
[self addChild:abstractFigureLine z:1];
CCAction *moveAbstractFigureLineAction = [CCMoveTo actionWithDuration:10.0f position:CGPointMake(-900.0f, 160.0f)];
[abstractFigureLine runAction:moveAbstractFigureLineAction];
Now I need to insert the image of another sprite, as well really simple, but is there any way to connect this two sprites in to one single sprite?
Create a base node for you sprites, add your sprites to this node, and run actions on this node:
Note, that CCSprite’s position – is it’s center, but CCNode’s position – is it’s bottom-left courner.