I am kind of frustrated with this 
Let me provide a bit of code to make things easier, this is the credits.lua file
local composer = require( "composer" ) local scene = composer.newScene() --------------------------------------------------------------------------------- -- BEGINNING OF YOUR IMPLEMENTATION --------------------------------------------------------------------------------- -- Called when the scene's view does not exist: function scene:create( event ) local sceneGroup = self.view -- Add display object creditmessage = [[This is the first venture from SillyGames... I would like to mention openart and the freeassets... credit goes to Kenny for his assets... I want to thank my family and my wife for the support... Please support this game !! Thanks...]] credittext = display.newText( creditmessage, display.contentCenterX, 600, "Raleway-Bold.ttf", 25 ) credittext:setFillColor( 0, 0.5, 1 ) scrollSpeed = -1 print( "\n1: create event") end function scene:show( event ) local phase = event.phase if "did" == phase then print( "1: show event, phase did" ) end local function move(event) -- move backgrounds to the left by scrollSpeed, default is 2 credittext.y = credittext.y + scrollSpeed -- Set up listeners so when backgrounds hits a certain point off the screen, -- move the background to the right off screen if (credittext.y) \< -150 then Runtime:removeEventListener("enterFrame", move ) print("out of screen") exitmenubutton = display.newImage("Assets/button/mainmenuexit.png") exitmenubutton.width = 200; exitmenubutton.height=50 exitmenubutton.x = 200 exitmenubutton.y = 400 local function exitMainMenuTouchListener( event ) if ( event.phase == "began" ) then print( "object touched = " .. tostring(event.target) ) -- "event.target" is the touched object exitmenubutton.alpha = 0.5 composer.gotoScene( "mainmenu" ) end -- if end return true end -- local function end exitmenubutton:addEventListener( "touch", exitMainMenuTouchListener ) -- Add a "touch" listener to the object end -- if end end -- local function move event end -- Create a runtime event to move backgrounds Runtime:addEventListener( "enterFrame", move ) end -- function scene:show( event ) function scene:hide( event ) local phase = event.phase if "will" == phase then end end function scene:destroy( event ) print( "((destroying scene 1's view))" ) end --------------------------------------------------------------------------------- -- Listener setup scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) --------------------------------------------------------------------------------- return scene
This is the mainmenu.lua file :
-- ============================================================= -- Copyright Roaming Gamer, LLC. 2008-2017 (All Rights Reserved) -- ============================================================= -- scenes/splash.lua -- ============================================================= local composer = require( "composer" ) local scene = composer.newScene() composer.removeScene( "credits" ) ---------------------------------------------------------------------- -- scene:create( event ) - Called on first scene open ONLY (unless -- the scene has been manually or automatically destroyed.) ---------------------------------------------------------------------- function scene:create( event ) local sceneGroup = self.view \_G.menubackground = display.newImage( "Assets/Menu/menu.png" ) menubackground.x = display.contentCenterX - 80 menubackground.y = display.contentCenterY \_G.newgamebutton = display.newImage("Assets/button/Newgame.png") newgamebutton.width = 200; newgamebutton.height=50 newgamebutton.x = display.contentCenterX newgamebutton.y = display.contentCenterY \_G.creditbutton = display.newImage("Assets/button/credits.png") creditbutton.width = 200; newgamebutton.height=50 creditbutton.x = display.contentCenterX creditbutton.y = display.contentCenterY+150 sceneGroup:insert( menubackground ) sceneGroup:insert( newgamebutton ) sceneGroup:insert( creditbutton) local function newgameButtonTouchListener( event ) if ( event.phase == "began" ) then --composer.gotoScene( "scene1" ) -- Code executed when the button is touched print( "object touched = " .. tostring(event.target) ) -- "event.target" is the touched object newgamebutton.alpha = 0.5 elseif ( event.phase == "moved" ) then -- Code executed when the touch is moved over the object print( "touch location in content coordinates = " .. event.x .. "," .. event.y ) elseif ( event.phase == "ended" ) then -- Code executed when the touch lifts off the object print( "touch ended on object " .. tostring(event.target) ) newgamebutton.alpha = 1 local options = { effect = "fade", time = 800 } composer.gotoScene( "scene1", options ) end return true end newgamebutton:addEventListener( "touch", newgameButtonTouchListener ) -- Add a "touch" listener to the object local function creditButtonTouchListener( event ) if ( event.phase == "began" ) then --composer.gotoScene( "scene1" ) -- Code executed when the button is touched print( "object touched = " .. tostring(event.target) ) -- "event.target" is the touched object creditbutton.alpha = 0.5 elseif ( event.phase == "moved" ) then -- Code executed when the touch is moved over the object print( "touch location in content coordinates = " .. event.x .. "," .. event.y ) elseif ( event.phase == "ended" ) then -- Code executed when the touch lifts off the object print( "touch ended on object " .. tostring(event.target) ) creditbutton.alpha = 1 local options = { effect = "fade", time = 800 } composer.gotoScene( "credits", options ) end return true end creditbutton:addEventListener( "touch", creditButtonTouchListener ) -- Add a "touch" listener to the object end ---------------------------------------------------------------------- -- Custom Scene Functions/Methods ---------------------------------------------------------------------- ---------------------------------------------------------------------- -- scene:willShow( event ) - Replaces the scene:show() method. This -- method is called during the "will" phase of scene:show(). ---------------------------------------------------------------------- function scene:willShow( event ) local sceneGroup = self.view end ---------------------------------------------------------------------- -- scene:didShow( event ) - Replaces the scene:show() method. This -- method is called during the "did" phase of scene:show(). ---------------------------------------------------------------------- function scene:didShow( event ) local sceneGroup = self.view end ---------------------------------------------------------------------- -- scene:willHide( event ) - Replaces the scene:hide() method. This -- method is called during the "will" phase of scene:hide(). ---------------------------------------------------------------------- function scene:willHide( event ) local sceneGroup = self.view end ---------------------------------------------------------------------- -- scene:didHide( event ) - Replaces the scene:hide() method. This -- method is called during the "did" phase of scene:hide(). ---------------------------------------------------------------------- function scene:didHide( event ) local sceneGroup = self.view end ---------------------------------------------------------------------- -- scene:destroy( event ) - Called automatically by Composer scene library -- to destroy the contents of the scene (based on settings and memory constraints): -- https://docs.coronalabs.com/daily/api/library/composer/recycleOnSceneChange.html -- -- Also called if you manually call composer.removeScene() -- https://docs.coronalabs.com/daily/api/library/composer/removeScene.html ---------------------------------------------------------------------- function scene:destroy( event ) local sceneGroup = self.view end --------------------------------------------------------------------------------- -- Scene Dispatch Events, Etc. - Generally Do Not Touch Below This Line --------------------------------------------------------------------------------- -- This code splits the "show" event into two separate events: willShow and didShow -- for ease of coding above. function scene:show( event ) local sceneGroup = self.view local willDid = event.phase if( willDid == "will" ) then self:willShow( event ) elseif( willDid == "did" ) then self:didShow( event ) end end -- This code splits the "hide" event into two separate events: willHide and didHide -- for ease of coding above. scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) --------------------------------------------------------------------------------- return scene
Please note once the credit text disappears, then only the exit to main menu appears
What Issue am I seeing?
-
The exit to main menu button shows up in the menu scene
-
When I press credit button again, nothing shows, all black screen
Video link : https://screencast-o-matic.com/watch/cqn1ro3Gmw