Everytime i click the pause button the showOverlay wont appear? but the thing that worked is the user does not allow to tap any objects. My pause.lua is my Overlay and all of its image won’t appear.
pause.lua
local function btnTap(event) event.target.xScale = 0.95 event.target.yScale = 0.95 composer.gotoScene ( event.target.destination, { params ={levelNum = params.levelNum}, time=800, effect = "fade"} ) return true end function catchBackgroundOverlay(event) return true end -- Called when the scene's view does not exist: function scene:createScene( event ) local group = self.view local backgroundOverlay = display.newRect (group, leftScrn-1000, topScrn-1000, withScrn+1000, heightScrn+1000) backgroundOverlay:setFillColor( black ) backgroundOverlay.alpha = 0.6 backgroundOverlay.isHitTestable = true backgroundOverlay:addEventListener ("tap", catchBackgroundOverlay) backgroundOverlay:addEventListener ("touch", catchBackgroundOverlay) local overlay = display.newImage ("images1/Pause/overlayv2.png", 900 , 500) overlay.x = centerX overlay.y = centerY group:insert (overlay) local levelBtn = display.newImageRect ("images1/Pause/levelBtn.png", 112, 116 ) levelBtn.x = centerX levelBtn.y = centerY + overlay.height/2.2 levelBtn.destination = "levels" levelBtn:addEventListener("tap", btnTap) group:insert(levelBtn) local playBtn = display.newImageRect ("images/Pause/playBtn.png", 112, 116) playBtn.x = centerX - overlay.width / 3 playBtn.y = centerY + overlay.height/2.2 local function hideOverlay(event) composer.hideOverlay("fade", 800) end playBtn:addEventListener ("tap", hideOverlay) group:insert(playBtn) local reloadBtn = display.newImageRect ("images/Pause/reloadbutton.png" ,112, 116) reloadBtn.x = centerX + overlay.width / 3 reloadBtn.y = centerY + overlay.height/2.2 params = event.params reloadBtn.destination = "reloading" reloadBtn:addEventListener ("tap", btnTap) group:insert (reloadBtn) end
gameEasyAddition.lua This is were i tapped the pause button
btnTap = function(event) event.target.xScale = 0.95 event.target.yScale = 0.95 -- composer.showOverlay( "scenes.pauseoverlay" ,{effect = "fade" , params ={levelNum = "scenes.difficulty.gameEasyAddition"}, isModal = true} ) return true end local pauseTime = display.newImage( "images1/Buttons/Pause.png" ) pauseTime.x = 100 pauseTime.y = 90 pauseTime.destination = "pauseTime" pauseTime:addEventListener("touch", btnTap)