problem with image

When i run the code on the iphone/iphone 4/droid device in the simulator, the background image exceeds the screen limit (it doesnt fit the screen) but when i run it on ipad/ipad with retina, the image works perfectly (it fits the screen)… what should i do to make my background image fit on both iphones/droids device and ipads without any problem ?

here’s my code for the config.lua file

– config.lua

application =
{
content =
{
width = 768,
height = 1024,
scale = “zoomEven”
},
}
and here’s my code for the build.settings file

settings = {
orientation = {
default = “landscapeRight”,
supported = { “landscapeLeft”, “landscapeRight” },
},
}
[import]uid: 159148 topic_id: 35901 reply_id: 335901[/import]

Check this blog entry out:

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

Then, what I do typically is create some global variables in my main.lua to delineate various screen elements like:

screen =
{
left = display.screenOriginX,
top = display.screenOriginY,
right = display.contentWidth - display.screenOriginX,
bottom = display.contentHeight - display.screenOriginY,
middleX = display.contentWidth * 0.5,
middleY = display.contentHeight * 0.5,
}
screen.width = screen.right - screen.left
screen.height = screen.bottom - screen.top

Then, when you go to create your background you can do something like this:

local background = display.newImageRect(“myimage.png”, screen.width, screen.height)
This should work across devices when you use the config.lua in the blog post I linked to. [import]uid: 92150 topic_id: 35901 reply_id: 142759[/import]

@ greenrift

Thanks… i will check that out :slight_smile: [import]uid: 159148 topic_id: 35901 reply_id: 142838[/import]

Check this blog entry out:

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

Then, what I do typically is create some global variables in my main.lua to delineate various screen elements like:

screen =
{
left = display.screenOriginX,
top = display.screenOriginY,
right = display.contentWidth - display.screenOriginX,
bottom = display.contentHeight - display.screenOriginY,
middleX = display.contentWidth * 0.5,
middleY = display.contentHeight * 0.5,
}
screen.width = screen.right - screen.left
screen.height = screen.bottom - screen.top

Then, when you go to create your background you can do something like this:

local background = display.newImageRect(“myimage.png”, screen.width, screen.height)
This should work across devices when you use the config.lua in the blog post I linked to. [import]uid: 92150 topic_id: 35901 reply_id: 142759[/import]

@ greenrift

Thanks… i will check that out :slight_smile: [import]uid: 159148 topic_id: 35901 reply_id: 142838[/import]

Check this blog entry out:

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

Then, what I do typically is create some global variables in my main.lua to delineate various screen elements like:

screen =
{
left = display.screenOriginX,
top = display.screenOriginY,
right = display.contentWidth - display.screenOriginX,
bottom = display.contentHeight - display.screenOriginY,
middleX = display.contentWidth * 0.5,
middleY = display.contentHeight * 0.5,
}
screen.width = screen.right - screen.left
screen.height = screen.bottom - screen.top

Then, when you go to create your background you can do something like this:

local background = display.newImageRect(“myimage.png”, screen.width, screen.height)
This should work across devices when you use the config.lua in the blog post I linked to. [import]uid: 92150 topic_id: 35901 reply_id: 142759[/import]

@ greenrift

Thanks… i will check that out :slight_smile: [import]uid: 159148 topic_id: 35901 reply_id: 142838[/import]

Check this blog entry out:

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

Then, what I do typically is create some global variables in my main.lua to delineate various screen elements like:

screen =
{
left = display.screenOriginX,
top = display.screenOriginY,
right = display.contentWidth - display.screenOriginX,
bottom = display.contentHeight - display.screenOriginY,
middleX = display.contentWidth * 0.5,
middleY = display.contentHeight * 0.5,
}
screen.width = screen.right - screen.left
screen.height = screen.bottom - screen.top

Then, when you go to create your background you can do something like this:

local background = display.newImageRect(“myimage.png”, screen.width, screen.height)
This should work across devices when you use the config.lua in the blog post I linked to. [import]uid: 92150 topic_id: 35901 reply_id: 142759[/import]

@ greenrift

Thanks… i will check that out :slight_smile: [import]uid: 159148 topic_id: 35901 reply_id: 142838[/import]