Actually Andrew, several of the 16:9 devices are not exactly 16 x 9. The iPhone 5 at 640x1136 is 1.775. 16:9 is 1.77777777778. And with soft button bars on many devices, it’s not unusual to see a 1.8xxxxxx ratio screen.
Ah, that’s a good point Rob. In that case, I’d be interested if anyone playing around with this config.lua file sees a difference forcing the dimensions to be integers versus not. All of the devices I test on look fine without doing that, but perhaps others would be a pixel off.
- Andrew
To be honest, I haven’t had a problem yet either. But I figure better safe than sorry
Hey everyone… I’m going to re-address the Ultimate config.lua in another blog post. I’ve got a few other things I want to cover in it and I think what you’ve done here really makes life easier for people using the one I wrote. Simple is good right? So I’m going to use what you’ve done here if that’s okay (giving credit back to this thread and to Andrew for the concept).
Thanks
Rob
Sounds good Rob, looking forward to reading the other topics you’re going to cover in the post.
- Andrew
Hi rob
Can you tell me what is the reason not istalls on iphone 5 , but installs on iphone 4 , ipad2 and others
is it somthing to do with this splash image? do i have to add this to allow me to install it or there are other guide lines
“Default-568h@2x.png”
You still have to provide a file named Default-568h@2x.png that is case sensitive and must be 640px wide and 1136px tall. It must be in the same folder as your main.lua. Any deviation from this will cause iOS to not recognize your app as supporting tall iPhone and Apple will reject your app if you submit it.
if i dont have this image can cause to not to install on device? I am only doing adhoc installation at this stage but i guess what you say it might be cause the same issue.
The Default-568h@2x.png file affects Apple rejecting your app and not being able to use the full screen. If you are not able to install an AdHoc version on the iPhone 5, we would need to see the error message you are getting but likely the cause is you have not added that device to your Provisioning Portal and updated you provisioning profile with that device and downloaded the latest version of that profile.
you saved my bacon, aukStudios!!! this was the first solution that actually worked for my project which needed to display on all i devices. when I dropped this into the beginning of Rob’s ultimate lua code…:
if ( string.sub( system.getInfo(“model”), 1, 2 ) == “iP” and display.pixelHeight == 1134 ) then
device.width = 640 * (display.pixelHeight/display.pixelWidth>1.5 and 1 or 1.5/(display.pixelHeight/display.pixelWidth))
device.height = 1134 * (display.pixelHeight/display.pixelWidth<1.5 and 1 or (display.pixelHeight/display.pixelWidth)/1.5)
device.scale = “letterbox”
…my app instantly loaded up in perfect proportion. I just had to add another design element at the bottom to cover the gap, but it is a beauiful thing! THANK YOU!!!
If I can put in my two cents (pure speculation here)…
This proposed code would end up possibly giving widths or heights in fractional pixels. Though that may be okay for the simulator and popular devices, it might (?) cause problems on other devices. How about this minor change, which would round up any fractional heights/widths to the next highest pixel (possibly giving a fractional “bleed” offscreen, which I think would be better than a fractional pixel of empty space) and eliminate the possibility of running into fractional pixel widths or heights:
local aspectRatio = display.pixelHeight/display.pixelWidth application = { content = { width = aspectRatio\>1.5 and 320 or math.ceil( 480/aspectRatio ), height = aspectRatio\<1.5 and 480 or math.ceil( 320\*aspectRatio ), scale = "letterBox", fps = 30, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, }
@joe413, I see where you’re coming from, it’s a potentially good suggestion. I’d be curious if you’ve encountered a device and use case where this actually makes a difference. All of the major aspect ratios I’m aware of (3:2, 4:3, 16:9, 16:10, and 5:4) would give integer results, but maybe there are others that wouldn’t.
That said, I wonder, as you do, whether a non-integer result would make any observable difference.
- Andrew
Actually Andrew, several of the 16:9 devices are not exactly 16 x 9. The iPhone 5 at 640x1136 is 1.775. 16:9 is 1.77777777778. And with soft button bars on many devices, it’s not unusual to see a 1.8xxxxxx ratio screen.
Ah, that’s a good point Rob. In that case, I’d be interested if anyone playing around with this config.lua file sees a difference forcing the dimensions to be integers versus not. All of the devices I test on look fine without doing that, but perhaps others would be a pixel off.
- Andrew
To be honest, I haven’t had a problem yet either. But I figure better safe than sorry
Hey everyone… I’m going to re-address the Ultimate config.lua in another blog post. I’ve got a few other things I want to cover in it and I think what you’ve done here really makes life easier for people using the one I wrote. Simple is good right? So I’m going to use what you’ve done here if that’s okay (giving credit back to this thread and to Andrew for the concept).
Thanks
Rob
Sounds good Rob, looking forward to reading the other topics you’re going to cover in the post.
- Andrew
Hi rob
Can you tell me what is the reason not istalls on iphone 5 , but installs on iphone 4 , ipad2 and others
is it somthing to do with this splash image? do i have to add this to allow me to install it or there are other guide lines
“Default-568h@2x.png”
You still have to provide a file named Default-568h@2x.png that is case sensitive and must be 640px wide and 1136px tall. It must be in the same folder as your main.lua. Any deviation from this will cause iOS to not recognize your app as supporting tall iPhone and Apple will reject your app if you submit it.
if i dont have this image can cause to not to install on device? I am only doing adhoc installation at this stage but i guess what you say it might be cause the same issue.