storyboard.gotoScene("facebook", "fade", 400)
ボタンをタップしても機能せず、端末にエラーメッセージが表示されません。私は何を間違っていますか?
-- requires
display.setStatusBar( display.HiddenStatusBar )
_W = display.contentWidth; --Returns Screen Width
_H = display.contentHeight; --Returns Screen Height
local storyboard = require ("storyboard")
local scene = storyboard.newScene()
-- background
function scene:createScene(event)
local screenGroup = self.view
background = display.newImage("restart.png")
screenGroup:insert(background)
button = display.newImage("share2.png")
button.x = display.contentWidth / 2
button.y = display.contentHeight -400
end
function listener(event)
if event.phase == "began" then
print(event.name.." occurred")
storyboard.gotoScene("facebook", "fade", 400)
end
end
function scene:enterScene(event)
storyboard.purgeScene("game")
button:addEventListener( "tap", listener )
end
function scene:exitScene(event)
button:removeEventListener( "tap", listener )
end
function scene:destroyScene(event)
end
scene:addEventListener("createScene", scene)
scene:addEventListener("enterScene", scene)
scene:addEventListener("exitScene", scene)
scene:addEventListener("destroyScene", scene)
return scene