Cocos2d v.2 to v.3: All my resources scale up like crazy

半腔热情 提交于 2020-01-06 14:51:30

问题


I´ve just created an new cocos2d 3.3 project using SpriteBuilder. I imported my art resources and code from my cocos2d v2 project and got it to run, but all my resources scale up to about 3x their original size and the positions I set seems to be and all touch handling seems to be broken.

I only have one sprite sheet and it does not have any suffix (like -hd). I´ve commented out [CCBReader configureCCFileUtils]; in AppDelegate.m but that didn´t change anything.

Do I have to add a suffix or place my art in a special folder to make it work like before? I´m not actually using SpriteBuilder, just created the project with it.


回答1:


When not using SpriteBuilder you should comment out [CCBReader configureCCFileUtils] in AppDelegate.m as you have done already.

The following suffixes should work:

  • "-ipad", non-retina iPad
  • "-ipadhd", retina iPad
  • "-hd", retina iPhone
  • "-iphone5hd", iPhone 5+
  • no suffix, non-retina iPhone (will get upsized on higher resolution devices)
  • "-iphone5", non-retina assets used for iPhone 5+ if no "-iphone5hd"

Since you don't have a suffix and it's looking upscaled, I suspect you may have originally hardcoded a scale factor to use assets meant for a retina device. Try adding -hd to your sprite sheet.



来源:https://stackoverflow.com/questions/28101120/cocos2d-v-2-to-v-3-all-my-resources-scale-up-like-crazy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!