Hi;
I am in the process of updating one of my projects to use the Composer API. However, I followed the tutorial, made the changes and now the App simply loads the main.lua file but hang on a black screen. I can’t figure out what is wrong with it. Please see below for more info:
Terminal out put = 2014-04-17 16:40:51.452 Corona Simulator[1022:507] Initial Main.lua loaded
code:
display.setStatusBar( display.HiddenStatusBar )
require(“globals”)
require(“globalFunctions”)
local composer = require( “composer” )
local scene = composer.newScene()
local myAnimation
local sheetData1
local sheet1
local sequenceData
print (“Initial Main.lua loaded”)
---- Functions
local function continueTrans(event)
local options = {
effect = “fade”,
time = 500,
params = {
someKey = “someValue”,
someOtherKey = 10
}
}
composer.gotoScene( “mainMenu”, options )
end
– “scene:create()”
function scene:create( event )
local sceneGroup = self.view
– Initialize the scene here.
– Example: add display objects to “sceneGroup”, add touch listeners, etc.
print (“scene:create before animation is loaded Main.lua loaded”)
sheetData1 = { width=300, height=300, numFrames=3, sheetContentWidth=900, sheetContentHeight=300 }
sheet1 = graphics.newImageSheet( “loadinganimation.png”, sheetData1 )
sequenceData = {
{ name=“seq1”, sheet=sheet1, start=1, count=3, time=3000, loopCount=1 },
--{ name=“seq2”, sheet=sheet2, start=1, count=6, time=220, loopCount=0 }
}
myAnimation = display.newSprite( sheet1, sequenceData )
myAnimation.x = centerX ; myAnimation.y = centerY
sceneGroup:insert(myAnimation)
print (“scene:create Main.lua loaded”)
end
– “scene:show()”
function scene:show( event )
local sceneGroup = 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).
print (“scene:show-will Main.lua loaded”)
composer.removeHidden()
elseif ( phase == “did” ) then
– Called when the scene is now on screen.
– Insert code here to make the scene come alive.
– Example: start timers, begin animation, play audio, etc.
myAnimation:play()
timer.performWithDelay(3400, continueTrans, 1)
print (“scene:show-did Main.lua loaded”)
end
end
– “scene:hide()”
function scene:hide( event )
local sceneGroup = self.view
local phase = event.phase
if ( phase == “will” ) then
– Called when the scene is on screen (but is about to go off screen).
– Insert code here to “pause” the scene.
– Example: stop timers, stop animation, stop audio, etc.
elseif ( phase == “did” ) then
– Called immediately after scene goes off screen.
end
end
– “scene:destroy()”
function scene:destroy( event )
local sceneGroup = self.view
– Called prior to the removal of scene’s view (“sceneGroup”).
– Insert code here to clean up the scene.
– Example: remove display objects, save state, etc.
end
Runtime:addEventListener( “memoryWarning”, handleLowMemory )
Runtime:addEventListener( “system”, onSystemEvent )
– Listener setup
scene:addEventListener( “create”, scene )
scene:addEventListener( “show”, scene )
scene:addEventListener( “hide”, scene )
scene:addEventListener( “destroy”, scene )
return scene
------------------------------------ end code
I’m using daily build 2264.
I’m stumped. Any help would be greatly appreciated.
Cheers!