I am trying to switch from main.lua to menu.lua in my app . I was getting an error before but I fixed it now I just end up with a black screen .
main.lua code :
----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- local composer = require( "composer" ) local widget = require( "widget" ) local ads = require( "ads" ) local myData = require( "mydata" ) local gameNetwork = require("gameNetwork") local device = require( "device" ) display.setStatusBar( display.HiddenStatusBar ) composer.gotoScene( "menu" )
menu.lua code:
local composer = require( "composer" ) local scene = composer.newScene() function scene:createScene( event ) local group = self.view -- display background image local background = display.newImage( "background.png" ) background.x = 10; background.y = 308 -- display ground image local ground = display.newImage( "ground.png" ) ground.x = 145; ground.y = 480 -- display play button local button = display.newImageRect( "button.png", 100, 80 ) button.x = 160 button.y = 350 group:insert( background ) group:insert( ground ) group:insert( button ) end function scene:enterScene( event ) local group = self.view end function scene:exitScene( event ) local group = self,view end function scene:destroyScene( event ) local group = self.view end scene:addEventListener( "createScene", scene ) scene:addEventListener( "enterScene", scene ) scene:addEventListener( "exitScene", scene ) scene:addEventListener( "destroyScene", scene ) return scene
Why is there only a black screen and not the images I wanted to be displayed ? What should I do to fix my code?
Thank you.