[solved] hideOverlay() does not work after display.captureScreen()

Hi.

I have a overlay screen and I noticed that after I take a screenshot of the screen using display.captureScreen(), the overlay scene get stucks in the scene. The hideOverlay() does not work.

Find below a code that shows that bug. If you comment the display.captureScreen() line the hideOverlay works normally.

I am using Corona 2013.1033.

a.lua
[lua]

local storyboard = require( “storyboard” )
local scene = storyboard.newScene()

function scene:createScene( event )

local group = self.view

– Saving size of the screen for faster reference
local screenHeight = display.contentHeight
local screenWidth = display.contentWidth

– creates the background
local background = display.newRect(0,0,screenWidth, screenHeight)
background:setFillColor(155,200,155)
group:insert(background)

end
– Called immediately after scene has moved onscreen:
function scene:enterScene( event )
local group = self.view

storyboard.showOverlay(“b”)

end
– Called when scene is about to move offscreen:
function scene:exitScene( event )
local group = self.view
end
– Called prior to the removal of scene’s “view” (display group)
function scene:destroyScene( event )
local group = self.view
end
– “createScene” event is dispatched if scene’s view does not exist
scene:addEventListener( “createScene”, scene )

– “enterScene” event is dispatched whenever scene transition has finished
scene:addEventListener( “enterScene”, scene )

– “exitScene” event is dispatched before next scene’s transition begins
scene:addEventListener( “exitScene”, scene )

– “destroyScene” event is dispatched before view is unloaded, which can be
– automatically unloaded in low memory situations, or explicitly via a call to
– storyboard.purgeScene() or storyboard.removeScene().
scene:addEventListener( “destroyScene”, scene )


return scene

[/lua]
b.lua
[lua]

local storyboard = require( “storyboard” )
local scene = storyboard.newScene()

function scene:createScene( event )

local group = self.view

– Saving size of the screen for faster reference
local screenHeight = display.contentHeight
local screenWidth = display.contentWidth

– creates a menu
local menu = display.newRect(screenWidth*0.2,screenHeight*0.2,screenWidth*0.6, screenHeight*0.6)
menu:setFillColor(133,120,135)
group:insert(menu)

end
– Called immediately after scene has moved onscreen:
function scene:enterScene( event )
local group = self.view

function hideOverlay()
storyboard.hideOverlay()
end

– this line below makes the overlay scene to get stuck in the screen
local img = display.captureScreen( false )

timer.performWithDelay(2000, hideOverlay, 1)

end
– Called when scene is about to move offscreen:
function scene:exitScene( event )
local group = self.view

end
– Called prior to the removal of scene’s “view” (display group)
function scene:destroyScene( event )
local group = self.view

end

– END OF YOUR IMPLEMENTATION

– “createScene” event is dispatched if scene’s view does not exist
scene:addEventListener( “createScene”, scene )

– “enterScene” event is dispatched whenever scene transition has finished
scene:addEventListener( “enterScene”, scene )

– “exitScene” event is dispatched before next scene’s transition begins
scene:addEventListener( “exitScene”, scene )

– “destroyScene” event is dispatched before view is unloaded, which can be
– automatically unloaded in low memory situations, or explicitly via a call to
– storyboard.purgeScene() or storyboard.removeScene().
scene:addEventListener( “destroyScene”, scene )


return scene

[/lua] [import]uid: 181011 topic_id: 36481 reply_id: 336481[/import]

Can you zip that up and use the “Report a Bug” at the link at the top of the page? [import]uid: 199310 topic_id: 36481 reply_id: 144739[/import]

Hi Rob.

I was doing exactly that when I decided to try one more thing that ended solving my problem.

I just removed the image ( img:removeSelf() ) before doing the hideOverlay and now everything works fine.

Although removing the image solved the problem, I think it is still a bug, am I correct? Do you want me to report a bug on it?

Renato [import]uid: 181011 topic_id: 36481 reply_id: 144743[/import]

Yes, please submit the bug report. [import]uid: 199310 topic_id: 36481 reply_id: 144756[/import]

Bug submitted.

Thanks Rob.

[import]uid: 181011 topic_id: 36481 reply_id: 144759[/import]

Can you zip that up and use the “Report a Bug” at the link at the top of the page? [import]uid: 199310 topic_id: 36481 reply_id: 144739[/import]

Hi Rob.

I was doing exactly that when I decided to try one more thing that ended solving my problem.

I just removed the image ( img:removeSelf() ) before doing the hideOverlay and now everything works fine.

Although removing the image solved the problem, I think it is still a bug, am I correct? Do you want me to report a bug on it?

Renato [import]uid: 181011 topic_id: 36481 reply_id: 144743[/import]

Yes, please submit the bug report. [import]uid: 199310 topic_id: 36481 reply_id: 144756[/import]

Bug submitted.

Thanks Rob.

[import]uid: 181011 topic_id: 36481 reply_id: 144759[/import]

Can you zip that up and use the “Report a Bug” at the link at the top of the page? [import]uid: 199310 topic_id: 36481 reply_id: 144739[/import]

Hi Rob.

I was doing exactly that when I decided to try one more thing that ended solving my problem.

I just removed the image ( img:removeSelf() ) before doing the hideOverlay and now everything works fine.

Although removing the image solved the problem, I think it is still a bug, am I correct? Do you want me to report a bug on it?

Renato [import]uid: 181011 topic_id: 36481 reply_id: 144743[/import]

Yes, please submit the bug report. [import]uid: 199310 topic_id: 36481 reply_id: 144756[/import]

Bug submitted.

Thanks Rob.

[import]uid: 181011 topic_id: 36481 reply_id: 144759[/import]

Can you zip that up and use the “Report a Bug” at the link at the top of the page? [import]uid: 199310 topic_id: 36481 reply_id: 144739[/import]

Hi Rob.

I was doing exactly that when I decided to try one more thing that ended solving my problem.

I just removed the image ( img:removeSelf() ) before doing the hideOverlay and now everything works fine.

Although removing the image solved the problem, I think it is still a bug, am I correct? Do you want me to report a bug on it?

Renato [import]uid: 181011 topic_id: 36481 reply_id: 144743[/import]

Yes, please submit the bug report. [import]uid: 199310 topic_id: 36481 reply_id: 144756[/import]

Bug submitted.

Thanks Rob.

[import]uid: 181011 topic_id: 36481 reply_id: 144759[/import]