Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

8. Operation Storyboard > Time for action – adding a credits screen

Time for action – adding a credits screen

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.

  1. Create a new file call creditsScreen.lua and import Storyboard, the storyboard.newScene() function, and the backgroundImage variable.
    local storyboard = require( "storyboard" )
    local scene = storyboard.newScene()
    
    local backgroundImage
  2. 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

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint