Mel
Mel

Reputation: 2075

Loading sprite images from a subfolder in cocos2d

For the life of me I cannot figure out how to do this.

NSString *filename = @"starbackground.png";
CCSpriteBatchNode *batch = [CCSpriteBatchNode batchNodeWithFile:filename];

works great as long as the image is at the top level of my project.

How can I load an image from a subfolder such as resources? Or resources/images?

Upvotes: 0

Views: 666

Answers (1)

Andrew
Andrew

Reputation: 24846

When adding folder with your project in xcode there are to options. Choose create references. Then you will be able to do what you want. In your resources the references folder is shown blue, not yellow

Upvotes: 2

Related Questions