Problem porting build from Android to Iphone

Some background: I've developed over a dozen games for Android using Corona. Now I am trying to transfer them onto iPhone but am running into trouble.

My problem is that when I open my application on the simulator in Windows, everything looks fine. But when I open it up on the Mac simulator everything is messed up.

This is the way the menu is supposed to look:

But when I open my application in Corona on an iMac, many images are out of place and/or have their scaling changed. Below is how the menu is glitching out on the iPhone simulator:

The menu background is the wrong size (it is too small) but the buttons are the correct size and in the correct position and only on the iPhone simulator?

The menu is not the only image that is being rescaled. There are other images, usually level backgrounds or decorations that have also had their scale changed. Why are some images being rescaled but others are not? Why do these differences between the PC/Mac simulator exist?

Below is the config file to the application that is glitchy. This glitch is only happening on my games that don't have their resolutions set to 320*480. Those games work fine.

1
2
3
4
5
6
7
8
9
10
-- config.lua
application =
{
        content =
        {
                width = 480,
                height = 854,
                scale = "zoomEven"
        },
}

Hey there,

You don't have to remake your Android projects but you do need the correct settings in config.lua for starters - why are your width and height set the way for the iPhone? Is there a reason you aren't using the correct height and width of 480x320?

Peach -

Thank you for your response.

The reason I didn't use 320*480 is because the Android version of Corona allows other resolutions without any problems and because I wasn't building for iPhone at the time I had no idea that Mac had the restrictions on the resolution in place.

After reading your reply I tried changing the screen resolution in my config from 480*854 to 320*480 but since my app was designed for 480*854 it still didn't look right.

I guess what I'm asking is, "Is there a way for me to fix the way my apps look on iPhone without scaling all my images proportionally down from 480*854 to 320*480 and then going through the lines of code of every one of my programs and multiplying the x and y values by their respective proportion?" I really hope there's an easy way out! :P

By the way Peach, kinda off topic but your data storage tutorial is great! Really helped me a lot with a few of my games.

The only way to do that would be with scaling because it just doesn't fit right. It wouldn't look native. (It's the same thing going from iOS to Android.)

Take a look at how objects are positioned in the Ghosts VS Monsters sample code; that lines up well regardless of device. (At least in my experience, naturally I don't have a million devices, though ;))

Thanks for the kind words; I love it when my tutorials can help people out :)

views:1659 update:2011/10/4 8:06:35
corona forums © 2003-2011