Quick Question About Retina Graphics.

Hi,

I am creating my first iOS game and am only supporting iPhone 4/4s/5.  I am only implementing retina graphics.  Can i do the following?

application =

{

    content =

    {

        width = 640,

        height = 960,

          scale = “letterbox”,

        fps = 30,

        antialias = “true”

       

    }

}

I am worried that if I dont following @2x standards and set the width and height to 320px x 480 respectively, I will encounter problems when I do a final build to submit to apple. Everything seems to work perfectly on both iPhone 4 and 5. Is this something I should worry about or not?

Best

Scott Shapiro

That should be fine, except that you’re not supporting the iPhone 5’s tall mode.  Apple is going to start requiring tall mode soon.

But if you don’t care about the 3Gs and older, then your base assets can be scaled to 640px with no problem.

Rob thanks for your response. I am supporting tall mode by checking ifTall. It seems to be working fine. Do I need to add 640x1136 to the settings above? I am using the same assets and for both iPhone 5 and 4. And aligning them by using a offset.

Your config.lua file needs to set the height to 1136 if you want display.contentHeight/display.contentWidth to be right…  Try this.

[lua]

  if display.pixelHeight > 960 then

     application =

     {

       content =

       {

          width = 640,

           height = 1136,

           scale = “letterbox”,

           fps = 30,

           antialias = “true”

       }

   }

  else

     application =

     {

       content =

       {

          width = 640,

           height = 960,

           scale = “letterbox”,

           fps = 30,

           antialias = “true”

       }

   }

  end

[/lua]

Thanks Rob!

That worked perfect! If I need to add other parameters that are not part of the case you set up can I add them after the if statement?

Everything needs to be in the application table, so based on this structure you would need to add things in multiple places.  If you want to extend it, you can add other “elseif” clauses and continue the pattern.

That should be fine, except that you’re not supporting the iPhone 5’s tall mode.  Apple is going to start requiring tall mode soon.

But if you don’t care about the 3Gs and older, then your base assets can be scaled to 640px with no problem.

Rob thanks for your response. I am supporting tall mode by checking ifTall. It seems to be working fine. Do I need to add 640x1136 to the settings above? I am using the same assets and for both iPhone 5 and 4. And aligning them by using a offset.

Your config.lua file needs to set the height to 1136 if you want display.contentHeight/display.contentWidth to be right…  Try this.

[lua]

  if display.pixelHeight > 960 then

     application =

     {

       content =

       {

          width = 640,

           height = 1136,

           scale = “letterbox”,

           fps = 30,

           antialias = “true”

       }

   }

  else

     application =

     {

       content =

       {

          width = 640,

           height = 960,

           scale = “letterbox”,

           fps = 30,

           antialias = “true”

       }

   }

  end

[/lua]

Thanks Rob!

That worked perfect! If I need to add other parameters that are not part of the case you set up can I add them after the if statement?

Everything needs to be in the application table, so based on this structure you would need to add things in multiple places.  If you want to extend it, you can add other “elseif” clauses and continue the pattern.