开发者

Loading sprite images from a subfolder in cocos2d

开发者 https://www.devze.com 2023-02-18 17:00 出处:网络
For the life of me I cannot figure out how to do this. NSString *f开发者_开发百科ilename = @\"starbackground.png\";

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

NSString *f开发者_开发百科ilename = @"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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号