corona scene createScene(创建结构)



local storyboard = require( "storyboard" )
local scene = storyboard.newScene()


function scene:createScene(event )
local screenGroup = self.view
local bg = display.newImage("bg3.jpg")
screenGroup:insert(bg)
print ( "scene 1 create" )

end


function scene:enterScene( event )
print( "1: enterScene event" )

end


function scene:exitScene( event )
print( "1: exitScene event" )

end


function scene:destroyScene( event )
print( "((destroying scene 1's view))" )

end


scene:addEventListener( "createScene", scene )
scene:addEventListener( "enterScene", scene )
scene:addEventListener( "exitScene", scene )
scene:addEventListener( "destroyScene", scene )

return scene

你可能感兴趣的:(Scene)