Windows 8 - View size issues need help

Windows 8 - View size issues need help
0.0 0


I have read that currently microsoft method of testing apps for publishing to the windows 8 market include using the simulator that comes with VS2012 to test for various components. These includes orientation change, snapped mode as well screen resolution change. It was mentioned that the app has to handle these changes “gracefully”.

Using the cocos2d-x-for-win8’s template hello world. I tested for the above and the following results:

This is the initial load, with the device in the default landscape mode (resolution default at 10.6" 1366x768)

This is in portrait mode, rotated using the simulator function

This is when the app is in snapped mode.

and this is when the resolution of the simulator has been changed to 10.6" 2560x1440

May I have some advice on how to technically handle the orientation and resolution changes gracefully? Having the view scaled and stretched is not exactly graceful, I’m looking more of detecting the resolution changes and rescaling (maintain aspect ratio) of the objects and repositioning the objects accordingly. A good example of how these changes are handled can be observed in Fruit Ninja for Win8 from the Win8 market.

landscape.png (58.3 KB)


i apologize for the initial post using imageshack, didnt know viewers needed to log in in order to see the images. Changed the image to be hosted on photobucket instead.

Advice appreciated.


Hi, Edmund Ching
Sorry about that , coccos2dx-win8 is not support resolution changing gracefully til now.
We also have a lot of work to do to reach the goal.
Here is my advice:
refer to win8 document and try to modfiy these code files:
cocos2dx-win8 / cocos2dx / platform / win8_metro/CCEGLView_win8_metro.cpp
cocos2dx-win8 / cocos2dx / platform / win8_metro/DirectXRender.cpp


thank you for pointing me in some direction. I will look at those files and report back if i manage to resolve the issue.


Hi, Ching
If you only want to support Landscape and LandscapeFlipped autoRotation, you can do this:
void CCFrameworkView::Initialize

//Set only support Landscape and LandscapeFlipped autoRotation
Windows::Graphics::Display::DisplayProperties::AutoRotationPreferences = 
Windows::Graphics::Display::DisplayOrientations::Landscape |

Set Rotation Preference in:


I was wondering if there’s any progress with the Win8 metro port? The last update on github was almost a month ago, Am I looking at the wrong place?


Has anyone been able to fix the resolution change issue?

It seems that if you want your game to be only on Landscape mode its possible, while doing so on portrait mode makes the view to be off place…

can anyone help with that issue?