Here is the scene:
local composer = require( “composer” )
local scene = composer.newScene()
– Local Vars
local initDisplayGroup
function scene:create( event )
local group = self.view
end
function scene:show( event )
local group = self.view
local phase = event.phase
if ( phase == “will” ) then
– Called when the scene is still off screen (but is about to come on screen).
initDisplayGroup = display.newGroup()
local initTitleText = display.newText( { text=“Hello World”, x=40, y=40, align=left, width=200, font=native.systemFont, fontSize=28} )
initTitleText:setFillColor( 1, 1, 0 )
initTitleText.anchorX = 0
initTitleText.anchorY = 0
initDisplayGroup:insert(initTitleText)
elseif ( phase == “did” ) then
end
end
function scene:hide( event )
local group = self.view
local phase = event.phase
if ( phase == “will” ) then
elseif ( phase == “did” ) then
– Called immediately after scene goes off screen.
end
end
function scene:destroy( event )
local group = self.view
end
scene:addEventListener( “create”, scene )
scene:addEventListener( “show”, scene )
scene:addEventListener( “hide”, scene )
scene:addEventListener( “destroy”, scene )
return scene