Reader small image

You're reading from  Corona SDK Mobile Game Development: Beginner's Guide

Product typeBook
Published inMar 2015
Publisher
ISBN-139781783559343
Edition1st Edition
Tools
Right arrow
Author (1)
Michelle M Fernandez
Michelle M Fernandez
Right arrow

Time for action – adding the loading screen


We'll place loading screens when the application launches and before the game level starts. This tells the user that more content or information is on its way.

  1. Create a new file called loadmainmenu.lua in your project folder.

  2. Import Composer and add in the composer.newScene() function:

    local composer = require( "composer" )
    local scene = composer.newScene()
  3. Create two local variables called myTimer and loadingImage. Add in the create() event and a sceneGroup display group:

    local myTimer
    local loadingImage
    
    -- Called when the scene's view does not exist:
    function scene:create( event )
      local sceneGroup = self.view
    
      print( "\nloadmainmenu: create event" )
    end
  4. Create the show() event and add in a sceneGroup display group:

      -- Called immediately after scene has moved onscreen:
    function scene:show( event )
      local sceneGroup = self.view
    
      print( "loadmainmenu: show event" )
  5. Introduce the loadingImage display object:

      loadingImage = display.newImageRect...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Corona SDK Mobile Game Development: Beginner's Guide
Published in: Mar 2015Publisher: ISBN-13: 9781783559343

Author (1)