iPhone screen sizes?

Hi Folks,

I am experimenting with the simulator and some of the Corona examples. I noticed that most of the samples I have played with have a config file with width=320 height=480. Is that the best resolution to use for iPhone? Isn’t the new iPhone 960x640? I made a sample at that resolution, with appropriately sized graphics, and I noticed in the simulator at least when the graphics get a bit rough around the edges when being scaled down. Would that be different in the actual iPhone at 960x640? I guess my question is what is the best resolution to target when building an app for the iPhone? How would you set up a config file and your graphics to give you the best results on both screen sizes?

Thanks!

[import]uid: 8139 topic_id: 3384 reply_id: 303384[/import]

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

Explains the config file and how to include graphics for both resolution [import]uid: 7911 topic_id: 3384 reply_id: 10061[/import]

jstrahan,

That’s excellent, thank you for the link!

[import]uid: 8139 topic_id: 3384 reply_id: 10063[/import]

I wonder which would be better: Targeting 960x640 and then using dynamic scaling to scale down to 480x320, or doing to the opposite (targeting 480x320 and then scaling up for the iPhone4)? It seems like the former would result in smoother animations and such, yet most people seem to be using the latter method… [import]uid: 10327 topic_id: 3384 reply_id: 10159[/import]

though a delayed response… to @Hookflash (and anyone else who may be wondering…)

I just did some tests and the issue is that scaling down can be very ungraceful.

For example, while a 1 pixel line can be scaled up to 2 pixels, it can’t be scaled down. Thus, in my tests, things shifting (like a scrollView) tend to lose a pixel here and there. Lacking grace is the best way to describe it.

… Meanwhile, the various system do provide good options for scaled up images with the @2, etc.

So it does seem creating for the smaller resolution is the way to go. [import]uid: 13859 topic_id: 3384 reply_id: 18156[/import]

I used scale up in the prototype interface I created for my app. I started with the iPhone 3g resolution, and when I start, I look at the width and height and calculate the ratio. I then use the smaller ratio to scale both X and Y. That way, I keep my aspect ratios, and ensure I won’t scale beyond the edge of the screen.

For example, the Droid is like 1.5 and 1.77. If you scale both width and height by 1.77, there is a chance it will expand beyond the width of the phone. By only using 1.5, you are ensuring that while it will leave a little bit of extra space open on the top and bottom, it will all fit on the display.

-Todd [import]uid: 25195 topic_id: 3384 reply_id: 18268[/import]

I made an app on the droid display now I want to know how to scale it for use with the iphone without having to go in and change everything [import]uid: 31928 topic_id: 3384 reply_id: 33250[/import]

Hey guys, does any one know how the code would look if I had an animation loaded into corona (a movieclip of images) to be able to dynamically switch the images to my @2x suffix…

I understand how to dynamically change a single image by using:

display.newImageRect( "myImage.png", 100, 100 )

This would dynamically change to use my @2x image if viewed on iPhone4 (as setup in my config.lua file)

But i’m using something like this:

[code]imageTable = {}
for i = 1,34 do
table.insert( imageTable, “Images/Seqs/BGSeq” … i … “.jpg” )
end

bg = movieclip.newAnim(imageTable)
bg.x = SW/2
bg.y = SH/2
bg:play() – play the animation
[/code]

How could I implement the above code to dynamically change to use my “BGSeq…@2x.jpg” images?

[import]uid: 14137 topic_id: 3384 reply_id: 40209[/import]