Overlay Scene don't hide

Hi,

    after user lose game (levels.lua) he is move to overlay scene (gameover.lua) with information about score. I dont know why overlay scene is still visible after call to composer.hideOverlay(). Code below

levels.lua

... local options = {   isModal = true,    effect = "fade",    time = 1400,    params = {        score = score,        highscore = data["highscore"]    } } composer.showOverlay( "gameover", options ) ...

gameover.lua

local composer = require( "composer" ) local scene = composer.newScene() local scoreText = nil local highScoreText = nil function backToMenu(event) composer.hideOverlay( "fade", 400 ) --composer.gotoScene( "levels" ) end function scene:create(event)  local sceneGroup = self.view local rect = display.newRect( 0, 0, display.contentWidth, display.contentHeight ) rect:setFillColor( "black" ) rect.alpha = 0.5 rect.anchorX = 0 rect.anchorY = 0 local text = display.newText( "Game Over", display.contentWidth \* 0.5, 50 , "Helvetica", 28 ) local backgroundRect = display.newRect( display.contentWidth \* 0.5, 100, 200, 220 ) backgroundRect:setFillColor( 0.3, 0.5, 0.8 ) backgroundRect.anchorX = 0.5 backgroundRect.anchorY = 0 text:addEventListener( "tap", backToMenu ) scoreText = display.newText( "", display.contentWidth \* 0.5, 150 , "Helvetica", 28 ) highScoreText = display.newText( "", display.contentWidth \* 0.5, 180 , "Helvetica", 28 ) end function scene:show(event)  local sceneGroup = self.view local  phase = event.phase local parent = event.parent local params = event.params if( phase == "will" ) then scoreText.text = "Score: " .. params.score highScoreText.text = "Highscore: " .. params.highscore elseif( phase == "did" ) then end end function scene:hide(event)  local sceneGroup = self.view local  phase = event.phase if( phase == "will" ) then elseif( phase == "did" )  then end end function scene:destroy(event)  local sceneGroup = self.view end scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) return scene

 

You have to insert the the display objects in to the sceneGroup

https://docs.coronalabs.com/api/type/GroupObject/insert.html

I don’t think it will be so easy to solve my problem. Thanks:)

You have to insert the the display objects in to the sceneGroup

https://docs.coronalabs.com/api/type/GroupObject/insert.html

I don’t think it will be so easy to solve my problem. Thanks:)