I have been using director for years and am finally switching over to storyboard, but the way the sample code was written was really impractical to replicate in my app (Defining all of the variables at the top and putting the code on createScene). Of course, there could very well be a good reason for doing that. So, I wanted to know if it was preferable to put the majority of scene creation outside of the createScene event like I am demonstrating below. I need the app to run smoothly, so I did not want to stray from the demo before asking. Any advice would be appreciated.
-------what I want to do
local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
– Most of my code here.
function scene:createScene( event )
--Empty
end
function scene:enterScene( event )
--Call content update functions
end
function scene:destroyScene( event )
--Remove listeners
end
-------how it is shown
local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
– Variable and function names
function scene:createScene( event )
--Most of the code
end
function scene:enterScene( event )
--Create content that may change
end
function scene:destroyScene( event )
--Remove listeners
end