which would be the best place to load a json
table
with information that will be used in the scene create and scene show?
Above the scene create?
-- ----------------------------------------------------------------------------------- -- Code outside of the scene event functions below will only be executed ONCE unless -- the scene is removed entirely (not recycled) via "composer.removeScene()" -- ----------------------------------------------------------------------------------- --save/load game settings local gameSettings = gameSettings = (progress.loadTable("gameSettings.json") or {})
in the scene create?
local gameSettings -- create() function scene:create( event ) local sceneGroup = self.view -- Code here runs when the scene is first created but has not yet appeared on screen --load JSON table to access data gameSettings = (progress.loadTable("gameSettings.json") or {})
I was initially making the call in the scene show that was where I needed it. Once I was requesting to use the table in different parts of the scene, I moved the call to the scene create, I find myself in doubt, I do not get the console errors but I am trying to access a data in the scene show will phase, and it seems not read the table. I do not have much experience with json and I do not know if it has any negative impact call it above the scene create. I understand that it is a silly question for expert users, but for the first time I feel that I have the RAW of what I can call a game and I want to have a good scope.
Thanks in advance
DoDi