cocos2d-x/cocos2dx-webos — pull request #4 by ImperialPenguin (2012-07-08 16:26:21+00:00)
Title: Touchpadfixes

I just realized that I never sent you this pull request. I've added some pretty important things. One of them was properly carding apps, but I saw that you did that as well using applicationWillEnterForeground and applicationWillEnterBackground, which I think is a better way than my way of just pausing and unpausing the CCDirector so I merged that into my changes.

What I've done with this update is correctly handle the fact that Touchpads default to landscape and phones default to portrait. If everything worked, you won't notice a difference. As an added test to make sure everything works, you can turn the volume up or down and make sure that the volume control that appears is in the right orientation.

The biggest thing I've done is allow for scaling on Touchpad. Now we can code to the target 320x480 point coordinate system and it should scale correctly to Touchpad's 768x1024 pixel coordinate system. That is why I left the appDelegate at the lower resolution for this pull. The screen should appear letterboxed, just like it would on an Android tablet or an Android phone with a different aspect ratio.

If everything works, we can enable retina display so Touchpads benefit from higher resolution graphics. You can test this now by building the changes and going to the bug tests section of the test app and running the bug 899 test. There should be an image that says "Retina Display" you should be able to see all of the text, and it should be high resolution.

Right now, the hi-res test doesn't work, but if the bug 899 test works, I'll enable proper support for retina display in Touchpads and Pre 3s. I've done it for Mac and Android and it works beautifully.