开发者

Corona - how to accommodate different device resolutions whilst retaining quality for hi-res devices?

How is it possible to accommodate lower resolutions from Corona but primarily target high resolution devices?

I know you can specifically set content width and height via Corona, and scale the content, but this seems to be for scaling upwards (method detailed here http://blog.anscamobile.com/2011/01/use-dynamic-layouts-in-universal-builds-with-corona-sdk/).

I've been creating an iPad app but I'd not targeted any resolution - my app appears fine on iPad 1 / 2 and on iPhone 4, but not on t开发者_如何学JAVAhe original iPhone.


There are two terms you need to pay attention to: dynamic content scaling and dynamic image resolution. The former refers to scaling the stage in Corona to fit on different displays, and the latter refers to swapping different versions of images on different displays. Here's documentation about both:

http://blog.anscamobile.com/2010/11/content-scaling-made-easy/#more-3756

http://developer.anscamobile.com/content/configuring-projects#Dynamic_Image_Resolution

First setup dynamic content scaling in config.lua so that the display will scale on different devices.

Then setup dynamic image resolution (also set in config.lua) so that you can swap in higher resolution versions of your graphics on devices with higher resolution. This is done through naming of the image files; basically, when you call newImageRect("image.png") in your code, it'll load image.png on lower resolution devices and image@2x.png on higher res devices.

(incidentally, while the dynamic image resolution configuration on the linked page uses the suffix "@2" I would recommend "@2x" because that is the standard suffix Apple uses. That is, in Corona you don't have to use Apple's standard, but it's less confusing if you do.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜