Struggling with Composer Overlays

I used storyboard overlays extensively in the past.  I am not grokking composer overlays.

composer.showOverlay() has been working great, as expected.

composer.hideOverlay() does nothing for me.

My basic conception looks like this

----------------------------------------------------------------------------------------- -- -- any-scene.lua -- ----------------------------------------------------------------------------------------- local composer = require( "composer" ) local scene = composer.newScene() -- "scene:create()" function scene:create( event ) local sceneGroup = self.view local pad = display.newRect(sceneGroup, display.contentCenterX, display.contentCenterY, 200, 100 ) pad.fill = {.2,.2,.2} local function overlayUp(event) local phase = event.phase if phase == "ended" then composer.showOverlay( "any-overlay", { effect = "fromBottom", time = 500, isModal = true, } ) end end pad:addEventListener( "touch", overlayUp ) end -- "scene:show()" function scene:show( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then elseif ( phase == "did" ) then end end -- "scene:hide()" function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then elseif ( phase == "did" ) then end end -- "scene:destroy()" function scene:destroy( event ) local sceneGroup = self.view end -- ------------------------------------------------------------------------------- -- Listener setup scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) return scene

------------------------------------------------------------------------------ -- -- any-overlay.lua -- ------------------------------------------------------------------------------ local composer = require( "composer" ) local scene = composer.newScene() -- "scene:create()" function scene:create( event ) local sceneGroup = self.view local awayPad = display.newRect(sceneGroup, display.contentCenterX, display.contentCenterY, 400, 300 ) awayPad.fill = {0,0,0,0.5} local overlayDown = function (event) local phase = event.phase if phase == "ended" then composer.hideOverlay() end end awayPad:addEventListener( "touch", overlayDown) end -- "scene:show()" function scene:show( event ) local sceneGroup = self.view local phase = event.phase local parent = event.parent if ( phase == "will" ) then elseif ( phase == "did" ) then end end -- "scene:hide()" function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then elseif ( phase == "did" ) then end end -- "scene:destroy()" function scene:destroy( event ) local sceneGroup = self.view end -- Listener setup scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) return scene

Hmm… “Does nothing” isn’t completely accurate.

composer.hideOverlay() seems to remove the isModal = true so the events can be triggered for the widgets underneath.

But it is not hiding the overlay itself.  All the overlay widgets are still visible and continue to be active.

What am I missing here?

What happens if you define the parameters within the hideOverlay() call? Like:

composer.hideOverlay("fade",400)

Ok.  I have the overlay working on the test app above.  The object wasn’t getting into the sceneGroup.  So I expect my issue is groups.  Start working backward now.  Thanks for the suggestion.

Bingo.  Super complex custom keyboard overlay.  Group layering wasn’t right.  Sorry to trouble you folks.

Hmm… “Does nothing” isn’t completely accurate.

composer.hideOverlay() seems to remove the isModal = true so the events can be triggered for the widgets underneath.

But it is not hiding the overlay itself.  All the overlay widgets are still visible and continue to be active.

What am I missing here?

What happens if you define the parameters within the hideOverlay() call? Like:

composer.hideOverlay("fade",400)

Ok.  I have the overlay working on the test app above.  The object wasn’t getting into the sceneGroup.  So I expect my issue is groups.  Start working backward now.  Thanks for the suggestion.

Bingo.  Super complex custom keyboard overlay.  Group layering wasn’t right.  Sorry to trouble you folks.

testing again.

more testing testing.

testing again.

more testing testing.