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.
Create a new file called
loadmainmenu.lua
in your project folder.Import Composer and add in the
composer.newScene()
function:local composer = require( "composer" ) local scene = composer.newScene()
Create two local variables called
myTimer
andloadingImage
. Add in thecreate()
event and asceneGroup
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
Create the
show()
event and add in asceneGroup
display group:-- Called immediately after scene has moved onscreen: function scene:show( event ) local sceneGroup = self.view print( "loadmainmenu: show event" )
Introduce the
loadingImage
display object:loadingImage = display.newImageRect...