图片不是“真正的”.png文件,我刚刚更改了扩展名。我下载了一个png文件,现在可以了!
我用cocos2D完成了一个简单的游戏,我试图在我的iphone 5上运行它。图标加载并且laungh图像加载但是我得到一个有错误的长消息等。例如它可以'找到图像的文件,即使它们位于正确的位置并拼写正确。
游戏在模拟器中完美运行,我下载的另一个cocos2D游戏在我的iPhone上运行正常。我有IOS 7 BETA,但它没关系,因为我下载的游戏效果很好。
有没有人知道它可能是什么?
提前致谢!
这是我在控制台中遇到的整个错误:
cocos2d: cocos2d-iphone v2.1
cocos2d: compiled with Profiling Support: NO
cocos2d: OS version: 7.0 (0x07000000)
cocos2d: GL_VENDOR: Imagination Technologies
cocos2d: GL_RENDERER: PowerVR SGX 543
cocos2d: GL_VERSION: OpenGL ES 2.0 IMGSGX543-95
cocos2d: GL_MAX_TEXTURE_SIZE: 4096
cocos2d: GL_MAX_TEXTURE_UNITS: 8
cocos2d: GL_MAX_SAMPLES: 4
cocos2d: GL supports PVRTC: YES
cocos2d: GL supports BGRA8888 textures: YES
cocos2d: GL supports NPOT textures: YES
cocos2d: GL supports discard_framebuffer: YES
cocos2d: GL supports shareable VAO: NO
2013-08-16 00:28:34.936 brick jumper[3349:60b] cocos2d: animation started with frame interval: 60.00
2013-08-16 00:28:34.950 brick jumper[3349:60b] cocos2d: surface size: 1136x640
2013-08-16 00:28:35.001 brick jumper[3349:60b] -[CCFileUtils fullPathForFilename:resolutionType:] : cocos2d: Warning: File not found: wall.png
2013-08-16 00:28:35.002 brick jumper[3349:60b] cocos2d: Couldn't find file:wall.png
2013-08-16 00:28:35.004 brick jumper[3349:60b] *** Assertion failure in -[HelloWorldLayer addChild:], /Users/tonymichaelsen/Documents/documents/Xcode-projects/brick jumper/brick jumper/libs/cocos2d/CCNode.m:382
2013-08-16 00:28:35.005 brick jumper[3349:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Argument must be non-nil'
*** First throw call stack:
(0x2fa944a3 0x39a926c7 0x2fa94375 0x30451c03 0x54c37 0xc8ab5 0x530ad 0xc86f3 0xc98cf 0xb42b5 0xb2ed9 0x55d15 0x3080b 0xaa0b5 0x303e553d 0x3040e4f5 0xaa84f 0xc7b73 0xab009 0xae3fd 0x320c6b2b 0x31d5b893 0x31d5b457 0x31d89f95 0x32163f07 0x32162fa9 0x3216222f 0x322856a9 0x321621f7 0x32285461 0x32123ee7 0x32123b61 0x32123485 0x32119573 0x32115c15 0x32152edd 0xc817f 0x3211a375 0x32119dbb 0x32112ad5 0x320c4a1b 0x320c3d11 0x320c3af9 0x34543bc5 0x345437af 0x2fa5bfdf 0x2fa5bf7b 0x2fa5a737 0x2f9d0d09 0x2f9d0aeb 0x32111791 0x3210d4ad 0xc799b 0x2b08)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
答案 0 :(得分:1)
你说图像拼写正确,但你有双重检查案例?模拟器将接受错误的套接图像(例如,文件名为“cocosImage.png”,您的代码要求“CocosImage.png”),但设备本身会抛出错误。
(这就是为什么在设备本身上进行开发总是一个好主意 - 当它们发生时你会发现这些错误,并且更好地了解从哪里开始,而不是想知道什么时候开始破坏。))< / p>
答案 1 :(得分:1)
cocos2d找不到wall.png。我的猜测是你在视网膜设备上进行测试。如果是,请在您的应用代表中,将行[sharedFileUtils setEnableFallbackSuffixes:NO];
更改为[sharedFileUtils setEnableFallbackSuffixes:YES];
或者,使用App Delegate中列出的扩展名添加更高分辨率的图像(用于视网膜设备),即wall-ipadhd.png
,分辨率为4x(每个维度)。