Right Now I just have 2 Scenes and the main.lua just for entry. Essentially Im trying to load the next scene and when I’m ready call composer.gotoScene() to go to that scene. What is happening in my project from the beginning, is it loads and transfers to scene 1, visually ok. The problem comes when I try and load scene 2. I issue the loadScene() function and it shows the scene2 graphics. I’m not calling gotoScene() and I’m wanting those graphics to not be present till that function is called.
main.lua
local sceneManager = require "composer" local scene1 = require"Scene\_1" local baseContentWidth = 800 local baseContentHeight = 1200 --Loads next Scene print("Begin Loading Scene\_1") while not(scene1:getSceneReadyStatus()==100)do sceneManager.loadScene("Scene\_1",false, {programContentWidth=baseContentWidth,programContentHeight=baseContentHeight}) print("LOADING\*\*\* "..scene1:getSceneReadyStatus().."%") end print("Scene\_1 Loaded Successfully") sceneManager.gotoScene("Scene\_1")
Scene_1.lua
local sceneManager = require "composer" --Creates Scene local scene = sceneManager.newScene() local scene2 = require"Scene\_2" --Animated Logo local loadIcon local baseContentWidth local baseContentHeight local SceneReadyStatus = 0 --initalizes Scene function scene:create( event ) local sceneGroup = self.view SceneReadyStatus = 10--Progress Counter baseContentWidth = event.params.programContentWidth baseContentHeight = event.params.programContentHeight SceneReadyStatus = 30 SceneReadyStatus = 40 --Art in Scene SceneReadyStatus = 70 -- --Load Scene 2 print("Begin Loading Scene\_2 ") while not(scene2:getSceneReadyStatus()==100)do sceneManager.loadScene("Scene\_2",false,{programContentWidth=baseContentWidth,programContentHeight=baseContentHeight}) print("LOADING\*\*\* "..scene2:getSceneReadyStatus().."%") end print("Scene\_2 Loaded Successfully") SceneReadyStatus = 100 return 0 end function scene:show( 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). elseif ( phase == "did" ) then -- Called immediately after scene goes off screen. print("Scene\_1\_LoadScreen Entered Successfully") end end --remove things done in show 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). loadIcon:removeSelf() loadIcon = nil; elseif ( phase == "did" ) then -- Called immediately after scene goes off screen. end print("Scene\_1\_LoadScreen Exit Successfully") end --Clean Up Save State - fires when scene is removed function scene:destroy( event ) local sceneGroup = self.view print("Scene\_1\_LoadScreen Destroyed Successfully")--might not be called end function scene:getSceneReadyStatus() return SceneReadyStatus end scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) return scene