user843337
user843337

Reputation:

How to make a repeatedly scrolling background cocos2d (iPhone)?

I'm extremely new to cocos2D development and I have hit a problem with my background. I want it to repeat scrolling every 2000px so I have looked around and found this (in this tutorial):

[_backgroundNode incrementOffset:ccp(2000,0) forChild:background];

I have set this up in my program however it doesn't recognise the method 'incrementOffset'. Is there something I'm doing wrong? I have imported "CCParallaxNode.h", however it says I need to import "CCParallaxNode-Extras.h" which doesn't exist?!

Upvotes: 1

Views: 1331

Answers (1)

CodeSmile
CodeSmile

Reputation: 64477

To quote the tutorial:

I’ve created a category on CCParallaxNode that you can use to solve this problem, which you can find in the resources for this project in the Classes folder. Drag CCParallaxNode-Extras.h and CCParallaxNode-Extras.m into your project, make sure “Copy items into destination group’s folder” is checked, and click Finish.

Upvotes: 2

Related Questions