Hi ,
I’m looking for a way to get the device native resolution within the config.lua. This would be great because It could bypass the need for testing the the actual model devices, and work as well with future devices.
This is my config.lua which is working well in all corona skins.
[blockcode]
model = system.getInfo(“model”)
print("Device = ", model)
_W = 360
– If it was possible to get the device native resolution the following code could be replaced by
– something like this
– _H = deviceNativeHeight / deviceNativeWidth * _W
if (model==“iPad”) then
_H = 480
elseif (model==“iPhone” or model ==“iPhone Simulator” or model ==“iPod touch”) then
_H = 540
elseif (model==“Galaxy Tab” or model==“Nook Color” or model==“Kindle Fire”) then
_H = 615
elseif(model==“Sensation” or model==“Droid”) then
_H = 640
elseif(model==“Nexus One” or model==“GT-I9100”) then
_H = 600
else
_H = 560
end
– _W and _H are the dimensions of the screen regardless the device.
– For example (0.5 * _W , 0.5 *_H ) point the center of the screen on any device
_G.fps=60
application =
{
content =
{
width = 360,
height = 480,
scale = “letterBox”,
xAlign=“left”,
yAlign=“top”,
fps = _G.fps,
antialias = false,
imageSuffix =
{
["@2x"] = 1.5,
},
},
}
[/blockcode]
All objects in my code are placed in relative coordinates to _W and _H .
Have anyone found a solution for this?
Thanks in advance… [import]uid: 109913 topic_id: 18225 reply_id: 83767[/import]