As you know, iPhone 4 has an awesome 640 x 960 resolution. But how can we handle this resolution to be compatible with previous iPhones and iPod Touches?
I know there’s dynamic content scaling and I’ve wrote this little code to try it with iPhone 4 and previous models but I cannot try it on my iPod Touch since I’m waiting Apple to activate my Developer license.
Could you try this for me? Or have you wrote another solution for this problem?
Here is the code.
config.lua
[lua]application =
{
content =
{
width = 640,
height = 960,
scale = “zoomEven” – You can try also with “zoomStretch”, it seems to be the same on the simulator.
},
}[/lua]
main.lua
[lua]local image = display.newImage ( “Untitled-1.png” ) – I’ve designed a simple image at Photoshop. It’s 640 * 960.
– display.stageWidth is 640 (in simulator)
– display.stageHeight is 960 (in simulator)
local centerX = display.stageWidth / 2 – returns 320
local centerY = display.stageHeight / 2 – returns 480
image.x = centerX
image.y = centerY[/lua]
I tried this code on iPad, even if on simulator, and it seems to work for it.
Thanks,
William.
[import]uid: 7022 topic_id: 1361 reply_id: 301361[/import]