Eyeball
Eyeball

Reputation: 3317

Corona SDK: iPhone 5 adjustment

I am using the following config.lua file when creating my mobile application.

The screen will not adjust to iPhone5 when building to device. It will, however, adjust when running on the simulator that corona provides.

Can you tell me if the problem lies in this file, or if it depends on some other implementation issue.

Thanks!

/S

local isTall = ( "iPhone" == system.getInfo( "model" ) ) and ( display.pixelHeight > 960 )

 -- iPad Configuration
 if ( string.sub( system.getInfo("model"), 1, 4 ) == "iPad" ) then
   application =
   {
      content =
      {
         width = 360,
         height = 480,
         scale = "letterBox",
         xAlign = "center",
         yAlign = "center",
         imageSuffix =
         {
            ["@2x"] = 1.5,
            ["@4x"] = 3.0,
         },
      },
   }

   -- iPhone5 Configuration
   elseif ( string.sub( system.getInfo("model"), 1, 2 ) == "iP" and display.pixelHeight > 960 ) then
   application =
   {
      content =
      {
         width = 320,
         height = 568,
         scale = "letterBox",
         xAlign = "center",
         yAlign = "center",
         imageSuffix =
         {
            ["@2x"] = 1.5,
            ["@4x"] = 3.0,
         },
      },
   }

   -- iPhone 3,4 and Older iPod Touch
   elseif ( string.sub( system.getInfo("model"), 1, 2 ) == "iP" ) then
   application =
   {
      content =
      {
         width = 320,
         height = 480,
         scale = "letterBox",
         xAlign = "center",
         yAlign = "center",
         imageSuffix =
         {
            ["@2x"] = 1.5,
            ["@4x"] = 3.0,
         },
      },
   } 

   -- Android, Kindle Fire, and Nook
   elseif ( display.pixelHeight / display.pixelWidth > 1.72 ) then
   application =
   {
      content =
      {
         width = 320,
         height = 570,
         scale = "letterBox",
         xAlign = "center",
         yAlign = "center",
         imageSuffix =
         {
            ["@2x"] = 1.5,
            ["@4x"] = 3.0,
         },
      },
   }

else
   application =
   {
      content =
      {
         width = 320,
         height = 512,
         scale = "letterBox",
         xAlign = "center",
         yAlign = "center",
         imageSuffix =
         {
            ["@2x"] = 1.5,
            ["@4x"] = 3.0,
         },
      },
   }

end

Upvotes: 2

Views: 2262

Answers (2)

Eyeball
Eyeball

Reputation: 3317

Solved it!.

Apperently, and this is not clear at all in my opinion, one needs to add (To the application's root) a file called "[email protected]" which tells the device to go iPhone5 mode!

This file should be a png with dimensions 640x1136

More info can be found at:

Under "Supporting tall apps"

Upvotes: 12

Reaper
Reaper

Reputation: 124

If you are building for landscape mode like

orientation = {
    default = "landscapeLeft",
    content = "landscapeLeft",
    supported = { "landscapeRight", "landscapeLeft"}
},

Use "[email protected]" with dimensions 1136x640, otherwise you will have problems.

Upvotes: 0

Related Questions