App Dynamic Sizing - Size differently from Phone to Tablet

Hi ho all,

Been trying to get my head around this for a few days, im savvy with the config.lua setup re content = {} for app sizing but what i cant find if there is anyway to change the available app size depending on screen resolution.

IE if the screen is => a 7inch tablet move the bottom nav bar to the side of the app screen.

There are apps now that are on Tablet/Phone that layout differently based on the available screen area with sidebars moving to the side of the screen instead of the bottom if its on a tablet instead of a phone.

At this stage im thinking ill just handle that inside the code itself and not worry about the Corona scaling (yes its going to be some very dynamic code lol). [import]uid: 75844 topic_id: 30842 reply_id: 330842[/import]

I have made my app universal for both iPhone and iPad, here is what I done in my config.lua.

I don’t know much about android devices, but you may be able to do something like the below

[lua]local targetDevice = ( system.getInfo( “model” ) )
if targetDevice == “iPhone” then
application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
fps = 60,
antialias = true,
xalign = “center”,
yalign = “center”,
imageSuffix =
{
["@2x"] = 2,
},
},
}
elseifif targetDevice == “ipad” then
application =
{
content =
{
width = 768,
height = 1024,
scale = “letterbox”,
fps = 60,
antialias = true,
xalign = “center”,
yalign = “center”,
imageSuffix =
{
["@2x"] = 2,
},
},
}
end[/lua] [import]uid: 62706 topic_id: 30842 reply_id: 123379[/import]

omg thank you thats perfect, wow didnt know you could do that

(lol guess im not as savvy with config.lua as i thought) [import]uid: 75844 topic_id: 30842 reply_id: 123380[/import]

No problems, we learn something new everyday with Corona :slight_smile: [import]uid: 62706 topic_id: 30842 reply_id: 123381[/import]

yep no way to handle Android effectively because of the device fragmentation but that just means we handle that in the code or assume that its a phone

[code]
local targetDevice = ( system.getInfo( “model” ) )

if targetDevice == “iPhone” then
application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
fps = 60,
antialias = true,
xalign = “center”,
yalign = “center”,
imageSuffix =
{
["@2x"] = 2,
},
},
}
elseif targetDevice == “iPad” then
application =
{
content =
{
width = 768,
height = 1024,
scale = “letterbox”,
fps = 60,
antialias = true,
xalign = “center”,
yalign = “center”,
imageSuffix =
{
["@2x"] = 2,
},
},
}
else
application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
fps = 60,
antialias = true,
xalign = “center”,
yalign = “center”,
imageSuffix =
{
["@2x"] = 2,
},
},
}
end
[/code] [import]uid: 75844 topic_id: 30842 reply_id: 123475[/import]

I have made my app universal for both iPhone and iPad, here is what I done in my config.lua.

I don’t know much about android devices, but you may be able to do something like the below

[lua]local targetDevice = ( system.getInfo( “model” ) )
if targetDevice == “iPhone” then
application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
fps = 60,
antialias = true,
xalign = “center”,
yalign = “center”,
imageSuffix =
{
["@2x"] = 2,
},
},
}
elseifif targetDevice == “ipad” then
application =
{
content =
{
width = 768,
height = 1024,
scale = “letterbox”,
fps = 60,
antialias = true,
xalign = “center”,
yalign = “center”,
imageSuffix =
{
["@2x"] = 2,
},
},
}
end[/lua] [import]uid: 62706 topic_id: 30842 reply_id: 123379[/import]

omg thank you thats perfect, wow didnt know you could do that

(lol guess im not as savvy with config.lua as i thought) [import]uid: 75844 topic_id: 30842 reply_id: 123380[/import]

No problems, we learn something new everyday with Corona :slight_smile: [import]uid: 62706 topic_id: 30842 reply_id: 123381[/import]

yep no way to handle Android effectively because of the device fragmentation but that just means we handle that in the code or assume that its a phone

[code]
local targetDevice = ( system.getInfo( “model” ) )

if targetDevice == “iPhone” then
application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
fps = 60,
antialias = true,
xalign = “center”,
yalign = “center”,
imageSuffix =
{
["@2x"] = 2,
},
},
}
elseif targetDevice == “iPad” then
application =
{
content =
{
width = 768,
height = 1024,
scale = “letterbox”,
fps = 60,
antialias = true,
xalign = “center”,
yalign = “center”,
imageSuffix =
{
["@2x"] = 2,
},
},
}
else
application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
fps = 60,
antialias = true,
xalign = “center”,
yalign = “center”,
imageSuffix =
{
["@2x"] = 2,
},
},
}
end
[/code] [import]uid: 75844 topic_id: 30842 reply_id: 123475[/import]