Hi all,
I have an image that I want to be the background of all my scenes. I tried loading the image in main.lua
background\_all = display.newImageRect( "graphics/clouds.png", 768, 1024 ) background\_all.x = display.contentCenterX background\_all.y = display.contentCenterY composer.gotoScene( "intro\_screen")
Then in intro_screen.lua I have:
function scene:create( event ) local sceneGroup = self.view -- Code here runs when the scene is first created but has not yet appeared on screen local background = display.newImageRect( sceneGroup, "graphics/intro\_screen.png", 768, 1024 ) background.x = display.contentCenterX background.y = display.contentCenterY end
Where the intro_screen.png is transparent.
The intro_screen.png doesn’t show. I think the cloude.png is on top of it.
If I add buttons (widget.newButton) then those show on top of the clouds.png but if I add them to the scene, they disappear.
I tried to add background:toFront() in intro_screen.lua but still I can’t see the intro_screen.png
I know that I can load the clouds.png in each scene instead of just once at the beginning but wouldn’t that use more memory?
What is the correct way to do this?
Thanks.