http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Multi_resolution_support#designResolutionSize Multi-resolution support(since cocos2d-2.0-x-2.0.4)안드로이드 기기에서 다양한 해상도를 적용 하기는 어렵다. Cocos2d-x는 두가지 메서드를 제공한다 The principle
예를들어, 이 메서드를 사용하면 아이폰 4s의 가로모드 사이즈는 '960x640'이다. 레티나 장치에 레티나가 아닌 것을 사용 하는 방법은 무엇일까? 너는 두가지 메서드만 알고 있으면 된다. 하나는 designResolutionSize 이고 다른 하나는 contentScaleFactor 이다. designResolutionSizeAll your game's coordinates rely on design resolution no matter what the size of your device screen. If the UI layout of your game is the same on all resolutions, you just need only a set of coordinates. 디자인 해상도는 설정할수 있다.
첫번째와 두번째 피라미터 값은 디자인 해상도의 높이와 넓이 이고 세번째 값은 디바이스에 뿌려주는 방식 이다.
세번째 값에 대해서는 맨 마지막에 설명하겠다.
You could also use more than one set of resources on different devices to make a better display by Here are some code snippets in HelloCpp project. contentScaleFactorContentScaleFactor는 designResolutionSize에 ResourcesSize에서 비율을 설명합니다 ContentScaleFactor describes the ratio from ResourcesSize to designResolutionSize. 일반적으로 'ResourceBackGround.height/DesignResolution.height' 혹은 'ResourceBackGround.width/DesignResolution.width'. 둘중 하나를 사용하며, 너의 게임에 맞는 방법을 선택하면 된다. When using NoBorder mode, there are some areas of the backgroud out of scope. If you use absolute coordinates based on design resolution size(480x320), You can get the origin point of 'visible rectange' by 'CCDirector::sharedDirector()->getVisibleOrign()'. Together with 'CCDirector::sharedDirector()->getVisibleSize()', 당신은 9개의 점을 화면위에서 확인할수 있다. 'Left','Right', 'Top','Bottom','Center','LeftTop','RightTop','LeftBottom' and 'RightBottom'.
When RH/DH isn't equal to RW/RH, You should decide to select Width or Height ratio of resource to design resolution. Policies지금 cocos2d-x는 세 가지 방식을 지원합니다. Exact fitThe entire application is visible in the specified area without trying to preserve the original aspect ratio. Distortion can occur, and the application may appear stretched or compressed. 전체 응용 프로그램은 원래 가로 세로 비율을 유지하기 위해 노력하지 않고 지정된 지역에서 볼 수 있습니다. 왜곡이 발생할 수 있으며, 응용 프로그램은 늘어나거나 압축 나타날 수 있습니다. No borderThe entire application fills the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the application. 응용 프로그램의 원래 가로 세로 비율을 유지하면서 전체 응용 프로그램, 왜곡하지 않고 있지만, 아마도 몇 가지 자르기와 함께 지정된 영역을 채 웁니다. Show allThe entire application is visible in the specified area without distortion while maintaining the original aspect ratio of the application. Borders can appear on two sides of the application. 응용 프로그램의 원래 가로 세로 비율을 유지하면서 전체 응용 프로그램은 왜곡없이 지정된 영역에 표시됩니다. 국경은 응용 프로그램의 두면에 게재 될 수 있습니다.
Mark② and Mark③ are both black rectangle areas. But they are different, Mark③ is out of Opengl Viewport, so you can't put any game elements onto it.
|
'잡다한것들전부 > 팁' 카테고리의 다른 글
| autoRelease 및 retain() , release(), retainCount() (0) | 2014.01.13 |
|---|---|
| CCNode 및 CCArray 의 메모리 관리 (0) | 2014.01.13 |
| cocos2d-x multi-resolution (0) | 2014.01.13 |
| cocos2d-x 스크롤 테이블뷰 예제 소스 (0) | 2014.01.13 |
| cocos2d-x CCString 분리후 CCArray 에 넣기( 문자열 분리하기) (0) | 2014.01.13 |
| cocos2d-x 의 메모리 관리 (0) | 2014.01.13 |


