Simulator Rotation

Hi all,

I have started to investigate running cocos2d-x on Windows using the airplay port. It all compiled fine and the tests run in the simulator but the airplay simulator is rotated the wrong way. The CCDirector is said to be landscape but the simulator is portrait. I’ve tried the ‘Configuration - Surface - Surface Orientation’ setting in the simulator but it doesn’t work.

I did try changing the ‘Preferences - Display Preferences - Auto-rotate Simulator window…’ and then I could rotate the orientation but the cocos-2d input was then incorrect.

I know this is probably a really simple thing to do but can anybody help me?

Thanks in advance

Jam

Yes - there is such an inconvenience.

I solve it this way:

Take for example the project tests cocos2d-x with Airplay SDK (… / tests / test.airplay / test.mkb)

  1. in TestController:: TestController () change

CCDirector:: sharedDirector () > setDeviceOrientation ;
on
CCDirector:: sharedDirector
> setDeviceOrientation (kCCDeviceOrientationPortrait);

(It should be done only for testing on the simulator airplay - for testing the device will need to return the value CCDeviceOrientationLandscapeLeft)

2.in airplay simulator set Configuration~~> Surface~~> Predefined Resolution = iPhone Landscape.

as a result in must to get something like this:

yes,me too:)

Hi, max
How can I do it on mac? I cannot find the entry of surface configuration on airplaysdk mac version, oops…
The official documentation only gives the screenshot on x86 http://www.airplaysdk.com/docs.php#/main/programmertools/airplaysimulator/configurationmenuoption/surfaceconfiguration.html

It’s my situation now, the source is

bool AppDelegate::initInstance()
{
    // ..., other platforms
#if (CC_TARGET_PLATFORM == CC_PLATFORM_AIRPLAY)
        // MaxAksenov said it's NOT a very elegant solution. I agree, haha
        CCDirector::sharedDirector()->setDeviceOrientation(kCCDeviceOrientationLandscapeLeft);
#endif
}

And the result is:

Unfortunately for the Mac version this method does not work.
All the settings of emulator contain in a file development.icf, which is created automatically in the folder project resources.
Theoretically, we must edit the SurfacePredefinedResolution or SurfaceRotation but in practice it has no effect.
Consequently, need talk with developers of Airplay SDK about this issue .

This is not the most intuitive approach ever but you can fix the orientation on the mac by changing

SurfaceWidth Value = “480”
SurfaceHeight Value = “320”

in the development.icf file.

then set orientation to
pDirector->setDeviceOrientation(kCCDeviceOrientationPortrait);

SurfaceRotation is ignored for some random reason but surface width and height seem fine.

I hope that is of some help.