Hello Everybody!,
I’ll try to use storyboard.showoverlay() when a certain event is dispatched. In this case when a counter variable reaches zero. This is the code:
function retraso()
local options =
{
effect = “fade”,
time = 400
}
physics.pause()
storyboard.showOverlay(“overlay_scene”, options)
end
function contadorPala()
if palaNumber > 0 then
palaNumber = palaNumber - 1
palaText.text = string.format("%d", palaNumber)
else retraso()
end
end
I put this code between enterScene and exitScene. Also, I wrote the functions overlayBegan and overLayEnded with print that show the state correctly in console, but “graphically” don’t load.
the overlay_scene is right this:
local storyboard = require “storyboard”
local scene = storyboard.newScene()
local widget = require( “widget” )
function scene:createScene( event )
local group = self.view
local imageBackOverlay = display.newImage(“images/fondosimple.png”)
function resumeBtnEvent( event )
local phase = event.phase
if “ended” == phase then
storyboard.hideOverlay( true, “fade”, 500 )
end
end
local resumeBtn = widget.newButton {
defaultFile = “images/resumebtn.png”,
overFile = “images/resumebtnover.png”,
id = “buttonover”,
onEvent = resumeBtnEvent
}
resumeBtn:setReferencePoint(display.CenterReferencePoint)
resumeBtn.x = _W; resumeBtn.y = _H + 120
group:insert( imageBackOverlay )
group:insert( resumeBtn )
end
function scene:enterScene( event )
local group = self.view
end
function scene:exitScene( event )
local group = self.view
end
function scene:destroyScene( event )
local group = self.view
end
scene:addEventListener(“createScene” , scene)
scene:addEventListener(“enterScene”, scene)
scene:addEventListener(“exitScene”, scene)
scene:addEventListener(“destroyScene”, scene)
return scene
Sorry for my english I try to explain this better i can.
Thanks