Loading Screen Background

I am having problems with my loading screen where the background is not centered. I had my game in landscape and now have turned it to portrait. I adjusted the build.settings and the other screens are working fine it’s just the loading screen. The logo is positioned fine. It’s just the background that is off. I also went in and adjusted the background size to 320 X 480 so that’s not the issue.

[lua]module(…, package.seeall)

– Main function - MUST return a display.newGroup()
function new()
print (“in load titlescreen file”)
local localGroup = display.newGroup()

local theTimer
local loadingImage

local showLoadingScreen = function()
loadingImage = display.newImageRect( “blackbackground.png”, 1600, 820 )
localGroup:insert(loadingImage)

local logo = display.newImage (“logo.png”)
localGroup:insert(logo)
logo.x = 165
logo.y = 180

local goToLevel = function()
director:changeScene( “titlescreen” )
end

math.randomseed( os.time() )
theTimer = timer.performWithDelay( 1500, goToLevel, 1 )
end

showLoadingScreen()

unloadMe = function()
end

– MUST return a display.newGroup()
return localGroup
end[/lua] [import]uid: 72372 topic_id: 13794 reply_id: 313794[/import]

try to attach a reference point for your background, like:
[lua]background:setReferencePoint(CenterReferencePoint)[/lua] [import]uid: 16142 topic_id: 13794 reply_id: 50640[/import]

Ok …

first this is off…

loadingImage = display.newImageRect( "blackbackground.png", 1600, 820 )  

Your targeting a 320x480 display so this is more accurate :

loadingImage = display.newImageRect( "blackbackground.png", 320, 480 )  

if that still doesn’t position it as required add this :

loadingImage.x = display.contentWidth \* 0.5 loadingImage.y = display.contentHeight \* 0.5 [import]uid: 6981 topic_id: 13794 reply_id: 50643[/import]

Infuseddreams,

I had to do both items but it worked perfectly! Thank you! [import]uid: 72372 topic_id: 13794 reply_id: 50649[/import]