1
\$\begingroup\$

I'm adding 3 sprites (layers) to CCParallaxNode:

BGLayer = [CCSprite spriteWithFile:@"Layer.png"];
[_backgroundNode
    addChild:BGLayer
    z:2
    parallaxRatio:layer1Speed   
    positionOffset:ccp(screenSize.width/2,screenSize.height/2)
];

How can I create the scroll when swiping?

\$\endgroup\$
0
\$\begingroup\$

Found it! Add the sprites or layers to a parralaxNode object and enable touch on your init method, Cocos2D will do the magic for you.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.