Zoomstretch Background Image Only

Hi

Following the reccomendations I have set my “config.lua” file to

scale =  "letterbox"  

but using their method by oversizing the background image results in th bacnground getting cropped. Because of the design of my app I need the entire background image visible so in my case I need

scale =  "zoomStretch"  

for the background image and

scale =  "letterbox"  

for everything else.

Anyone have any ideas?

If you stick to letterbox you can use the following to fill up any screen with a background image.

[lua]

local xMin = display.screenOriginX

local yMin = display.screenOriginY

local xMax = display.contentWidth - display.screenOriginX

local yMax = display.contentHeight - display.screenOriginY

local _W = display.contentWidth

local _H = display.contentHeight

local image = display.newImageRect(“image.png”, xMax-xMin, yMax-yMin)

image.x = _W*0.5

image.y = _H*0.5

[/lua]

There may be a few little errors as i just typed that out, but thats the general gist of doing it :smiley:
Try it in the simulator on the various phone sizes!

If you stick to letterbox you can use the following to fill up any screen with a background image.

[lua]

local xMin = display.screenOriginX

local yMin = display.screenOriginY

local xMax = display.contentWidth - display.screenOriginX

local yMax = display.contentHeight - display.screenOriginY

local _W = display.contentWidth

local _H = display.contentHeight

local image = display.newImageRect(“image.png”, xMax-xMin, yMax-yMin)

image.x = _W*0.5

image.y = _H*0.5

[/lua]

There may be a few little errors as i just typed that out, but thats the general gist of doing it :smiley:
Try it in the simulator on the various phone sizes!