local function gotoscenepause() -- go to the modal scene where my button is local options = -- (You can ignore it) { isModal = true, effect = "slideLeft", time = 450, } composer.showOverlay( "pause\_scene" , options ) end local function onstopBtnRelease() gotoscenepause() return true end -- below is a modal scene script -- theres a lot of unnecessary there, so I left the code associated with my button local composer = require( "composer" ) local scene = composer.newScene() local widget = require "widget" widget.setTheme("widget\_theme\_android") local continuebutton local function oncontinueBtnRelease() local options = { effect = "fade", time = 350, } composer.hideOverlay("pause\_scene", options) return true -- indicates successful touch end function scene:create( event ) local sceneGroup = self.view local other = display.newGroup() continuebutton = widget.newButton { label = "tap to continue...", font="Helvetica", width=(height2-(height2-(height2/2.5)))+30, height=width2, onRelease = oncontinueBtnRelease -- event listener function } continuebutton.x = (height2-(height2-(height2/2.5)))/2+20 continuebutton.y = width2/2 other:insert( continuebutton ) end function scene:show( event ) local sceneGroup = self.view local phase = event.phase if phase == "will" then elseif phase == "did" then end end function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if event.phase == "will" then elseif phase == "did" then end end function scene:destroy( event ) local sceneGroup = self.view if continuebutton then continuebutton:removeSelf() -- widgets must be manually removed continuebutton = nil composer.removeScene('pause\_scene') end end --------------------------------------------------------------------------------- scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) ----------------------------------------------------------------------------------------- return scene
Sorry for the wait.