Hi, I’ve developed a game using the iPad resolution and now I’d like to support the iPhone. For this particular game I just need to autoscale the entire game to fit the device. It actually looks good. I’ve tested this using another game sdk that supports virtual resolution (Moai SDK)… Unfortunately I decided not to use it because it’s still in beta and I need to implement a lot of things that are already supported in cocos2d-x.
Any tips to support this? I understand autoscale is for Android, but I’m sure there is a way to modify Cocos2d-x to scale an iPad resolution down.
If not, I thought of a different alternative which did not involve rescaling the game view, but modifying the coordinates based on the device resolution.
Center position would be:
iPhone: (160, 240)
iPhone-Ret: (320, 480)
iPad: (384, 512)
If I am not mistaken I would be able to support correct placement on every device by modifying ccp() to figure out where to place the object based on the device size. I understand this is built-in for iPhone and retina but why not iPad as well? Perhaps we should include the ability to set a virtual resolution and ccp() would calculate correct position based on that.
Now I got placement setup correctly, I am thinking I could create the assets by scaling them based on different scale factor from the original resolution (which is 1024x768) in my case.
So to prepare the iPhone assets I scale all assets by (320/768, 480/1024). If I am not mistaken, this should produce the same effect as scaling the entire game to the device size, correct?
If so, why isn’t this built-in? If I am wrong, could you explain my error.