我的支持视网膜显示的cocos2d游戏出现问题.一切正常,但现在我正在进行更新.在此更新中,我仅添加了3个新图像(也以高清格式).我正在使用由zwoptex制成的纹理图集.生成的png是gameart.png和gameart-hd.png.我正在使用以下代码加载文件:
I am having a problem with my cocos2d game that supports retina display. Everything used to work fine but now i am working on an update. In this update i have only added 3 new images (also in hd). I am using texture atlases made with zwoptex. the png's generated are gameart.png and gameart-hd.png. I am loading the files using this code:
CCSpriteFrameCache* frameCache = [CCSpriteFrameCache sharedSpriteFrameCache]; [frameCache addSpriteFramesWithFile:@"gameart.plist"];当我使用spriteWithFrameName:方法获取任何精灵时.以前一切正常(即使在iPhone 4上也可以),但现在我仅在iPhone 4上遇到以下错误:
when getting any sprite i am using spriteWithFrameName: method. Everything used to work fine before (Even on iPhone 4) but now i am getting the following error only on iPhone 4:
cocos2d: CCSpriteFrameCache: Frame 'tilei.png' not found *** Assertion failure in -[BoardTile initWithSpriteFrame:]文件tilei在gameart.png和gameart-hd.png(tilei.png和tilei-hd.png)以及plist文件中均可用.我再次检查了一千遍.可能出什么问题了?请注意,即使仅在iPhone 4上运行时,该错误也没有显示-hd后缀.
the file tilei is available in both gameart.png and gameart-hd.png (tilei.png and tilei-hd.png) and the plist files. i rechecked it a thousand times. what could be going wrong? notice that the error is not showing the -hd suffix even though its only occurring while running on iPhone 4.
推荐答案对于hd精灵表中的 精灵,您不需要-hd的后缀.
You don't need the suffix of -hd for the sprites inside the hd spritesheet.
您似乎拥有:
- sd-spritesheet
- image1.png
- image2.png
- 等
- sd-spritesheet
- image1.png
- image2.png
- etc.
- image1-hd.png
- image2-hd.png
- 等
- image1-hd.png
- image2-hd.png
- etc.
- sd-spritesheet
- image1.png
- image2.png
- 等
- sd-spritesheet
- image1.png
- image2.png
- etc.
- image1.png
- image2.png
- 等
- image1.png
- image2.png
- etc.
您需要:
更多推荐
cocos2d视网膜支持不再起作用
发布评论