Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

App Looks Great In Corona Iphone 5 Simulator, Looks Un-Optimized In Xcode And Actual Iphone 5.
Started by nilesmitchell Apr 07 2013 05:28 PM

- - - - -
35 replies to this topic
[TOPIC CONTROLS]
Page 1 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

I am trying to update my app for the new iPhone 5 screen.  I use Zoom Stretch, since my app is text only....and this works great for me across multiple platforms.  On the Corona simulator under iPhone 5, it looks optimized for the longer screen.  However, if you run the compiled app on the Xcode simulator, or on the actual iPhone 5, it looks like an older, un-optiimised app.  (pre-iPhone 5 apps).

 

What gives?



[TOPIC: post.html]
#2

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi @nilesmitchell,

This is caused by omitting a "tall" launch image from the project, something that Apple started requiring when the iPhone5 launched. It's a common oversight and I see this issue mentioned twice a week or more. ;)

 

See here:

http://docs.coronalabs.com/guide/distribution/buildSettings/index.html#launchimage

 

This will fix the issue you describe; just include that image, even if it's a solid black rectangle for the time being.

 

Best regards,

Brent Sorrentino



[TOPIC: post.html]
#3

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

Brent,

 

 

Still a no-go!  I added a 640 × 1136 PNG display image and named it Default-568h@2x.png.  I still have the same problem as before.  Any ideas?

 

Niles



[TOPIC: post.html]
#4

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi Niles,

Have you experimented with the other scale factors? Zoom Stretch isn't a very "popular" one, but if it works for you, then that's fine. I'm just curious if you've tried "zoomEven" or "letterbox". Also, did you read through the following guide about working with multiple devices? Many people have found this useful, or at least as a launchpad for building their config setup:

 

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

 

Brent

 



[TOPIC: post.html]
#5

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

It was a year ago when I wrote the app, so I don't remember all the details, but ZoomSretch is the setting that met my needs across the board.  Very easy to use.

 

Still doesn't explain why this is behaving correctly in the Corona Simulator, but looking un-optimized in Xcode or on the device.  That has to be a bug....



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,622 posts
  • Enterprise

What does your config.lua look like?



[TOPIC: post.html]
#7

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

application = {
content = {
  width = 320,
  height = 480,
  scale = "ZoomStretch",
  fps = 30,
}
}



[TOPIC: post.html]
#8

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

Then I tried...

 

if ( string.sub( system.getInfo("model"), 1, 2 ) == "iP" and display.pixelHeight > 960 ) then
   application =
   {
      content =
      {
         width = 320,
         height = 568,
         scale = "ZoomStretch",
  fps = 30,
}
}

else

application = {
content = {
  width = 320,
  height = 480,
  scale = "ZoomStretch",
  fps = 30,
}
}


end

 

 

 

 

No go!  It just doesn't work with ZoomStretch.  The other settings mentioned, letterbox and zoomeven, don't look right.



[TOPIC: post.html]
#9

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

I'm having no luck using if then statements.  That's making matters worse!  Not behaving at all like it should.

 

 

This simple config has served me well across all devices until the iPhone 5.  I have no idea why it's not working.  It's clearly a bug.

 

application = {
content = {
  width = 320,
  height = 480,
  scale = "ZoomStretch",
  fps = 30,
}
}



[TOPIC: post.html]
#10

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi Niles,

I notice you misspelled the "scale" parameter. It should be "zoomStretch" (lowercase "z"), not "ZoomStretch". Please test that out and see what happens.

 

Brent



[TOPIC: post.html]
#11

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

No change.  It's always been capital Z in my past builds and worked.  I tried it just to see.  No change.



[TOPIC: post.html]
#12

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi Niles,

What happens when you put this test print value in main.lua?

print(1/display.contentScaleX, 1/display.contentScaleY)

 

Then change (in the Simulator) from iPhone to iPhone4 to iPhone5? Can you show me which numbers are output in the Terminal?

 

Also, could you attach a screenshot of what the "unoptimized" output looks like?

 

Thanks,

Brent



[TOPIC: post.html]
#13

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

iPhone:

 

2013-04-27 21:50:22.140 Corona Simulator[23245:707] 1 1
 

 

iPhone 4:

 

2013-04-27 21:53:32.960 Corona Simulator[23245:707] 2 2
 

 

iPhone 5:

 

2013-04-27 21:53:36.464 Corona Simulator[23245:707] 2 2.3666666690177
2013-04-27 21:53:36.467 Corona Simulator[23245:707] WARNING: Due to system limitations, display.newText() height is going to be increased to nearest multiple of 4: 1183 ===> 1184.



[TOPIC: post.html]
#14

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

Attached File  Untitled.tiff   398.18KB   162 downloads

 

Corona on left, Xcode simulator on right.

 

Text looks good in Corona simulator, then looks un-optimized for iPhone 5 on Xcode or device.



[TOPIC: post.html]
#15

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi Niles,

Thanks for the info. Can you please test this using just one line of text? In other words, don't specify a width and height parameter in the newText() call. I'd like to see if this is a factor of a multi-line text box, or something else.

 

local text1 = display.newText( "testingTESTING", 66, 60, "Arial", 60 )

 

Best regards,

Brent



[TOPIC: post.html]
#16

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

For iPhone 5

 

2013-04-28 20:54:44.635 Corona Simulator[45723:707] 2 2.3666666690177
2013-04-28 20:54:44.635 Corona Simulator[45723:707] 2 2.3666666690177

 

 

No longer optimized for iPhone 5 in Corona Simulator.  Attaching pic.

Attached Files



[TOPIC: post.html]
#17

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,622 posts
  • Enterprise

attachicon.gifUntitled.tiff

 

Corona on left, Xcode simulator on right.

 

Text looks good in Corona simulator, then looks un-optimized for iPhone 5 on Xcode or device.

 

In the first .tiff you posted, it looks like the iPhone 5 is not recognizing the Default-568h@2x.png file.  If you copied the name from our blog post, then the dash was being converted to a fancy n-dash and that won't work. 

 

If you have other Default.png files, why not drop some graphics on the Default-568h@2x.png file to make sure you see that file show when your app boots up on your iPhone 5.



[TOPIC: post.html]
#18

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

Took the dash out and typed it back in.

 

No change.



[TOPIC: post.html]
#19

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi Niles,

Can you post your basic code (for the scene) here? Just the part where you display the green text, and maybe one of the white "button" boxes below. I don't need to see the entire project code.

 

Also, can you attach your full config.lua to this post?

 

Thanks,

Brent



[TOPIC: post.html]
#20

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

Config.lua

 

launchPad = false

application = {
content = {
  width = 320,
  height = 480,
  scale = "zoomStretch",
  fps = 30,
}
}



[TOPIC: post.html]
#21

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

Code for scene:

 

title = display.newText( "You awaken in a desert.  It is morning, and although you are still cold from the night, you know that it will soon reach inhospitable temperatures.  All around you is endless desert expanse, except to the east, where there appears to be a town.", 0, 0, 320, 500, native.systemFont, ts )
title:setTextColor( r, g, b )


 
local northbutton = display.newRect(0, 0, 76, 30, 4)
northbutton.strokeWidth = 2
northbutton:setFillColor(0)
northbutton.x = display.contentWidth / 2
northbutton.y = display.contentHeight - 160



[TOPIC: post.html]
#22

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi Niles,

OK, I'm doing a bit of testing with this. But may I ask, when you mean "unoptimized", do you mean that the text on the phone isn't going "flush" to the (taller) top of the iPhone5? Or is there something else that I'm just not seeing in the screenshots?

 

Would you be open to using a different scale method than "zoomStretch" if I provided an alternative? That's generally not a scale mode that I recommend to anybody, even a text-based app.

 

By the way, the "launchPad" setting in the config should go within the application table, not outside it. Just an FYI.

 

Brent



[TOPIC: post.html]
#23

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK

Yes, it isn't going flush to the taller iPhone 5 screen.  Ironically, it does in the Corona Simulator.

 

Yes,  i'm open to anything the works.



[TOPIC: post.html]
#24

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,622 posts
  • Enterprise

This is 99% likely to be a problem with your Default-568h@2x.png file.  Can you email it to me at:

 

rob AT coronalabs DOT com (putting an @ and . in the right places) and let me take a look at your image and see if there is something amiss?



[TOPIC: post.html]
#25

nilesmitchell

[GLOBAL: userInfoPane.html]
nilesmitchell
  • Enthusiast

  • 56 posts
  • Corona SDK


[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]