Recommended config.lua for latest devices?

Hi all,

I peeked around at some sample code and lifted it into my game, but when testing for iPad Retina the graphics didn’t change to accommodate the larger graphics I dropped in:

  
if display.pixelHeight \> 960 then  
   
application =   
{   
   
 content =   
 {   
  
 width = 320,  
 height = 480,  
  
 imageSuffix =   
 {  
 ["@2x"] = 1.6,  
 ["@2x~ipad"] = 3.6  
 }   
  
  
  
 },  
  
}   
   
   
else  
   
application =   
{   
   
 content =   
 {   
  
 width = 320,  
 height = 480,  
 scale = "zoomEven",  
  
 imagePrefix =   
 {  
 ["@2x"] = 1.6,  
 ["@2x~ipad"] = 3.6  
 }   
  
  
 },  
  
}   
   
end  

Or is it better to just go with http://www.coronalabs.com/blog/2011/01/27/dynamic-image-resolution-made-easy/?

Thanks,

L [import]uid: 144359 topic_id: 32996 reply_id: 332996[/import]

I know I used Suffix and Prefix in different areas, but I did change that. Also upgraded to the most recent build yesterday. [import]uid: 144359 topic_id: 32996 reply_id: 130986[/import]

this is mine

[code]

local mm = system.getInfo( “model” )

if mm == “iPhone” or mm == “iPhone Simulator” or mm == “iPod touch” or mm == “iPod Touch” then

if( display.pixelHeight > 960 ) then

application =
{
content =
{
width = 320,
height = 568 ,
scale = “letterbox”,
fps = 60,
antialias = false,
xAlign = “center”,
yAlign = “center”,
audioPlayFrequency = 44100,

imageSuffix =
{
–TODO
["-568h@2x"] = 2,
["@2x"] = 1.95,
},
},
}
else
application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
fps = 60,
antialias = false,
xAlign = “center”,
yAlign = “center”,
audioPlayFrequency = 44100,

imageSuffix =
{
–TODO
–["-568h@2x"] = 2.1,
["@2x"] = 2,
},
},
}
end

end

if mm == “iPad” or mm == “iPad Simulator” then

application =
{
content =
{
width = 384 ,
height = 512,
scale = “letterbox”,
fps = 60,
antialias = false,
xalign = “center”,
yalign = “center”,
audioPlayFrequency = 44100,

imageSuffix =
{
["-Landscape"] = 2,
["@2x"] = 2,
},
},

}

end

[/code] [import]uid: 111283 topic_id: 32996 reply_id: 130990[/import]

Here is what I’m currently using to support the various iOS sizes as well as a generic Android one.

[code]
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,
},
},
notification =
{
iphone = {
types = {
“badge”, “sound”, “alert”
}
}
}
}

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,
},
},
notification =
{
iphone = {
types = {
“badge”, “sound”, “alert”
}
}
}
}

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,
},
},
notification =
{
iphone = {
types = {
“badge”, “sound”, “alert”
}
}
}
}

else
application =
{
content =
{
width = 320,
height = 570,
scale = “letterBox”,
xAlign = “center”,
yAlign = “center”,
imageSuffix =
{
["@2x"] = 1.5,
["@4x"] = 3.0,
},
},
notification =
{
iphone = {
types = {
“badge”, “sound”, “alert”
}
}
}
}

end
[/code] [import]uid: 19626 topic_id: 32996 reply_id: 130992[/import]

I know I used Suffix and Prefix in different areas, but I did change that. Also upgraded to the most recent build yesterday. [import]uid: 144359 topic_id: 32996 reply_id: 130986[/import]

Excellent. Thanks so much. [import]uid: 144359 topic_id: 32996 reply_id: 131014[/import]

this is mine

[code]

local mm = system.getInfo( “model” )

if mm == “iPhone” or mm == “iPhone Simulator” or mm == “iPod touch” or mm == “iPod Touch” then

if( display.pixelHeight > 960 ) then

application =
{
content =
{
width = 320,
height = 568 ,
scale = “letterbox”,
fps = 60,
antialias = false,
xAlign = “center”,
yAlign = “center”,
audioPlayFrequency = 44100,

imageSuffix =
{
–TODO
["-568h@2x"] = 2,
["@2x"] = 1.95,
},
},
}
else
application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
fps = 60,
antialias = false,
xAlign = “center”,
yAlign = “center”,
audioPlayFrequency = 44100,

imageSuffix =
{
–TODO
–["-568h@2x"] = 2.1,
["@2x"] = 2,
},
},
}
end

end

if mm == “iPad” or mm == “iPad Simulator” then

application =
{
content =
{
width = 384 ,
height = 512,
scale = “letterbox”,
fps = 60,
antialias = false,
xalign = “center”,
yalign = “center”,
audioPlayFrequency = 44100,

imageSuffix =
{
["-Landscape"] = 2,
["@2x"] = 2,
},
},

}

end

[/code] [import]uid: 111283 topic_id: 32996 reply_id: 130990[/import]

Here is what I’m currently using to support the various iOS sizes as well as a generic Android one.

[code]
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,
},
},
notification =
{
iphone = {
types = {
“badge”, “sound”, “alert”
}
}
}
}

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,
},
},
notification =
{
iphone = {
types = {
“badge”, “sound”, “alert”
}
}
}
}

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,
},
},
notification =
{
iphone = {
types = {
“badge”, “sound”, “alert”
}
}
}
}

else
application =
{
content =
{
width = 320,
height = 570,
scale = “letterBox”,
xAlign = “center”,
yAlign = “center”,
imageSuffix =
{
["@2x"] = 1.5,
["@4x"] = 3.0,
},
},
notification =
{
iphone = {
types = {
“badge”, “sound”, “alert”
}
}
}
}

end
[/code] [import]uid: 19626 topic_id: 32996 reply_id: 130992[/import]

For a universal app I would make all graphics for ipad retina display, and make the display width and height match the ipad retina one. Then just use letterbox scaling to scale down. Then just stretch the background images, and place buttons according to the origin of the display, and pixel width height.

Does anyone one know if this is a good idea if you don’t want to deal with multiple images of different resolutions? Or does this slow down the application?

It seems like the app would weigh more with images of different resolutions. [import]uid: 130035 topic_id: 32996 reply_id: 131032[/import]

Excellent. Thanks so much. [import]uid: 144359 topic_id: 32996 reply_id: 131014[/import]

For a universal app I would make all graphics for ipad retina display, and make the display width and height match the ipad retina one. Then just use letterbox scaling to scale down. Then just stretch the background images, and place buttons according to the origin of the display, and pixel width height.

Does anyone one know if this is a good idea if you don’t want to deal with multiple images of different resolutions? Or does this slow down the application?

It seems like the app would weigh more with images of different resolutions. [import]uid: 130035 topic_id: 32996 reply_id: 131032[/import]