How to implement HD “Retina Display” graphics in Cocos2D

前端 未结 2 1806
孤独总比滥情好
孤独总比滥情好 2021-02-07 15:06

I am not quite sure how use HD images for sprites in cocos2d. I looked through the documentation, and downloaded the newest beta which supports points instead of pixels, but I

相关标签:
2条回答
  • 2021-02-07 15:36

    I think the "-hd" is for Cocos2D-iPhone, the "@2x" is for icons used by Apple (e.g. Default.png).

    If you want to see the difference, 1) setup slightly diff images (e.g diff colour, add minor changes) between normal and the "-hd" version, then 2) run it in simulator with "iPhone" (for iPhone 3 GS) and then with "iPhone(Retina)" (for iPhone 4+) and you should see different one been displayed.

    Hope this helps.

    0 讨论(0)
  • 2021-02-07 15:42

    If you're using the latest beta, the only change you should need to make is export all your images at twice the size and use the "-hd" suffix, similar to Apple's "@2x". The documentation also says you need to set the content scale factor of the director, but in my case I didn't seem to need to do that.

    Though it sounds like you've already read through it, I'll link to the documentation in hopes that someone will benefit.

    0 讨论(0)
提交回复
热议问题