我在Corona中使用簡單的代碼行來切換場景 - 發生過渡但效果不好。Corona storyboard.goto場景選項不起作用
storyboard.gotoScene("splash", "fade", 2000)
我已經編譯生成的Xcode的模擬器,看是否淡入淡出效果將在那裏工作,它沒有。
完整代碼 -
local storyboard = require "storyboard"
local scene = storyboard.newScene()
local SplashGroup = display.newGroup()
local function onBackgroundTouch()
storyboard.gotoScene("mainmenu", "fade", 2000)
end
--Called if the scene hasn't been previously seen
function scene:createScene (event)
local logoImage = display.newImage("RoxisLogo.png")
logoImage.x = display.contentWidth/2
logoImage.x = display.contentHeight/2
SplashGroup:insert(logoImage)
logoImage:addEventListener("tap", onBackgroundTouch)
end
function scene:enterScene(event)
SplashGroup.alpha=1
end
function scene:exitScene(event)
SplashGroup.alpha=0
end
--"createScene" is called whenever the scene is FIRST called
scene:addEventListener("createScene", scene)
--"enterScene event is dispatched whenever scene transition has finished
scene:addEventListener("enterScene", scene)
--"exitScene" event is dispatched before the next scene's transition begins
scene:addEventListener("exitScene", scene)
return scene