The credits screen we'll be creating will be based on a touch event that transitions to the previous screen from which it was introduced.
Create a new file call
creditsScreen.lua
and import Storyboard, thestoryboard.newScene()
function, and thebackgroundImage
variable.local storyboard = require( "storyboard" ) local scene = storyboard.newScene() local backgroundImage
Create the
createScene()
event. Add in the line,storyboard.removeScene( "options" )
, which will remove the"options"
scene. This will occur after the player has transitioned from the options screen and is sent to the credits screen.-- Called when the scene's view does not exist: function scene:createScene( event ) local screenGroup = self.view -- completely remove options storyboard.removeScene( "options" ) print( "\ncreditsScreen: createScene event" ) end
Add in the
enterScene()
event andbackgroundImage
display object.-- Called immediately after scene has moved onscreen...