Hi. I’m a first time poster with a starter issue. I’ve almost got the Android-NDK-port all straightened out except for this: the orientation is always either landscape or upside down. This issue is present both for the emulator and physical device. Here are some details.
Calls to “CCDirectory~~>setDeviceOrientation" have limited effect in the win32 version but this parameter seems to have no effect in the NDK-port.
Changes to the "android:orientation" in the NDK-port’s application manifest, however, show up as upside-down portrait for "landscape" and sideways for "portrait".
I’ve included 2 pictures to illustrate what I mean and below is some of the code that is used in my project. If you need anything else, just ask.
I’m sure this is a silly misstep on my part, but I can’t seem to resolve it. I started with the "hello world" app as a template to build from, which might have something to do with my problems. I’d done a good amount of searching before starting this post, and couldn’t see any references to the issue or a resolution.
Thanks for any help you can provide.
daySky = CCSprite::spriteWithFile(”media/scene_sky1.png“);
tree = CCSprite::spriteWithFile(”media/scene_tree.png“);
ground = CCSprite::spriteWithFile(”media/scene_ground.png");
CCSize size = CCDirector::sharedDirector()~~>getWinSize;
// initialize director
CCDirector pDirector = CCDirector::sharedDirector;
// sets landscape mode
// turn on display FPS
// set FPS. the default value is 1.0/60 if you don’t call this
// create a scene. it’s an autorelease object
CCScenepScene = PuppyComeHome::scene();
<?xml version="1.0" encoding="utf-8"?>
android1.png (177.8 KB)
android2.png (206.5 KB)