0
我試着在HelloWorld Android項目中更改設備方向。但是,我有一個小問題。我跟着從off.site指南:cocos2d-x Android設備定位:我做錯了什麼?
1. Add nativeInit(w, h); to cocos2dx/platform/android/java/src_common/org/cocos2dx/lib/Cocos2dxRenderer.java -> void onSurfaceChanged(GL10 gl, int w, int h).
2. Add this code to void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thiz, jint w, jint h):
cocos2d::CCEGLView* view = cocos2d::CCDirector::sharedDirector()->getOpenGLView();
if (!view) {
...
} else {
...
if (view->getFrameSize().width != w || view->getFrameSize().height != h) {
view->setFrameSize(w, h);
view->setDesignResolutionSize(w, h, kResolutionShowAll);
}
}
所以,我的問題:在縱向方向,我有一個很好的觀點:nice view,但是,在橫向我有:bad view。我做錯了什麼?