Saturday, April 14, 2012

cocos2d에서 iPhone4 이상(retina display)을 위해 해줘야 할 것

cocos2d에서 retina display 쓸 수 있게 하는 법
디폴트로는 오리지널 아이폰 해상도인 320 x 480 으로 동작한다.
iPhone 4의 640 x 960 에서 그에 걸맞는 해상도로 동작하게 하려면 다음과 같이 해줘야 한다.

1. 레티나 디스플레이를 enable 해준다
우선 AppDelegate.m 에서 다음 부분을 uncomment 해준다.
// Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices
// if( ! [director enableRetinaDisplay:YES] )
// CCLOG(@"Retina Display Not supported");

2. 기존의 이미지의 hd 버전을 만들어 준다
예를 들어 게임 상에서 hero.png 라는 100 x 100 이미지를 사용하고 있다면
hero-hd.png 라는 200 x 200 이미지를 만들어 넣어준다.

출처 :
HowTo: Cocos2d – Enable Retina Display. Part One
HowTo:Cocos2d – Enable Retina Display. Part Two – The Graphics

No comments:

Post a Comment