Thanks for trying Saer, I compared my code to yours and couldn’t see why mine still isn’t working
here is the code:
a) in game.lua - this is the listener for an onscreen button.
local function onQuest_Button(event)
local phase = event.phase
if (“began”== phase) then
local options = {effect = “fromLeft”, time = 4000, isModal = true}
storyboard.showOverlay( “quests”,options )
end
end
in quests.lua - this is the whole overlay file.
local storyboard = require(“storyboard”)
local widget=require (“widget”)
local scene = storyboard.newScene()
function onBack(event)
print (event.phase)
print (“inside onBack”)
if (“ended”== event.phase) then
storyboard.hideOverlay( false,500 )
end
end
function scene:createScene(event)
overlayGroup = display.newGroup() – was local but had scope problems??
questimage = display.newImageRect( “images/questbackground.png”, 900,900 )
questimage.x = display.contentWidth/2-300
questimage.y = display.contentHeight/2+50
overlayGroup:insert( questimage )
back_button = widget.newButton {
left = 500,
top = 700,
height=40,
width=120,
label = “Back”,
fontsize=12,
onEvent = onBack
}
overlayGroup:insert(back_button)
--image.touch = onSceneTouch
end
scene:addEventListener(“createScene”)
function scene:enterScene(event)
– local options = {
–
– effect = “fromLeft”,
– time = 500
–}
end
scene:addEventListener(“enterScene”)
function scene:overlayBegan(event)
end
scene:addEventListener(“overlayBegan”)
function scene:overlayEnded(event)
--overlayGroup=nil
end
scene:addEventListener( “overlayEnded” )
return scene