New issue
 Projects > cocos2d-x > Issues > Bug #4624

Android Orientation error

Bug #4624 [New]
steliosrb 2014-03-31 14:51

Hi Everyone,

Cocos2dx is awesome, keep up the good work...
So I am using the new cocos2dx v3.0 rc0 to build a multiplatform game...
I manage to make the game working on all orientations on iOS and the I try to make this also on Android...:D

The main idea is to call the onOrientationChange of AppDelegate.
AppDelegate.h
virtual void onOrientationChange(bool isLandscape, int w, int h);

AppDelegate.cpp
void AppDelegate::onOrientationChange(bool isLandscape, int w, int h){}

CCApplicationProtocol.h
virtual void onOrientationChange(bool isLandscape, int w, int h) = 0;

nativeactivity.cpp
....

  • cocos2d::Application::getInstance()->onOrientationChange(newWidth>newHeight,newWidth, newHeight); cocos2d::Application::getInstance()->applicationScreenSizeChanged(newWidth, newHeight); ....

The strange thing is that the onOrientationChange function is called on my
samsung galaxy s3 and everything works fine...
on the Galaxy Tab 3 it is NOT working... onOrientationChange is not called at all!!!

Does anyone have any idea what is happening?

Thanks,
Stelios

Atom PDF

Status:New
Start date:2014-03-31
Priority:Low
Due date:
Assignee:-
% Done:

0%

Category:android
Target version:-

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.