-[CCFileUtils fullPathForFilename:resolutionType:]:cocos2d:警告:找不到文件:play.png
Cocos2d游戏....超简单的刚开始玩。
这是整个班级,没有找到“play.png”和“sound.png”。它们都位于“buttons.plist”(纹理打包器文档)中,并包含在构建阶段中。
班级:
- (id) init {
if ((self = [super init]))
{
//[[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"looped.mp3" loop:YES];
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"buttons.plist"];
CGSize winSize = [CCDirector sharedDirector].winSize;
CCSprite* background;
if( winSize.width == 568 || winSize.height == 568 )
background = [CCSprite spriteWithFile: @"title_bg-5x.png"];
else
background = [CCSprite spriteWithFile: @"title_bg.png"];
[background setPosition: ccp(winSize.width/2, winSize.height/2)];
[self addChild: background];
CCMenuItemImage *play = [CCMenuItemImage itemWithNormalImage:@"play.png" selectedImage:@"play.png"
target:self selector:@selector(actionGame:)];
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
play.position = ccp(winSize.width/2,winSize.height/2);
}
else
{
play.position = ccp(winSize.width/2,winSize.height/2);
}
CCMenuItemImage *sound = [CCMenuItemImage itemWithNormalImage:@"sound.png"
selectedImage: @"sound.png"
target: self
selector:@selector(actionSound:)];
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
sound.position=ccp(winSize.width/2,winSize.height/2);
}
else
{
sound.position=ccp(winSize.width/2,winSize.height/2);
}
CCMenu *menu = [CCMenu menuWithItems:play, menu, nil];
[self addChild:menu z:4];
}
return self;
}
航海家:
Build Phases 也有所有的 .plist 文件和 .png 文件。
任何想法为什么我会收到此错误/为什么按钮没有显示?这只是项目的开始,我以前从未遇到过这个问题。
感谢您为我提供的任何帮助。