cocos2d-x / cocos2dx-win8

102 stars 66 forks source link

Support for devices with ResolutionScale + some minor fixes #12

Closed mingulov closed 12 years ago

mingulov commented 12 years ago

Hi,

Win8 supports ResolutionScale property to improve UX for high-density displays: http://msdn.microsoft.com/en-us/library/windows/apps/hh465362.aspx http://msdn.microsoft.com/en-us/library/windows/apps/windows.graphics.display.resolutionscale

It means that for 10.6" 2560x1440 display it will report the full window size as 1422x800 (180% less, can be checked with simulator - start simulator, change resolution and start your app). The similar - for 10.6" 1920x1080 it will be 140% less, for example. Some other cases are possible with other resolutions.

So the current cocos2d version does not handle it properly, and uses just a part of available screen space to show the data. This pull request is intended to fix the issue and improve the situation.

As a part of the fix - pointer press events are fixed (it was possible before that the coord is calculated incorrectly in some cases).

Also here is some other fixes: