-
Notifications
You must be signed in to change notification settings - Fork 3
Adding A New Scene To Coordinator
Logodaedalus edited this page Dec 27, 2018
·
3 revisions
Adding a new scene to StoryAssembler involves a couple steps, due to its setup with require.js. You'll need to be careful, but it should be pretty quick to setup!
-
In js/main.js...
- Add your scene's files to the "paths" object
- There's a block of example scene files ("exampleData", "exampleConfig") in the list...you can comment out the example scenes using a // and put yours in their place!
paths: {
"domReady": "StoryAssembler/lib/domReady",
[...a bunch of other files...]
"yourDataFileLabel" : "your/data/file/location/mine.json",
"yourConfigFileLabel" : "your/config/file/location/myconfig.json",
[...a bunch of other files...]
}
-
In Coordinator.js...
- add your scene's alias to the define object at the top of the file.
- there are essentially two lists of the same files--make sure you add your files in the correct place in both lists so the orders are the same!
- as a safeguard to make sure it loads large text files correctly, put "text!" in front of your filename (ie "text!mySceneContent")
define(["text!yourDataFileLabel", "text!yourConfigFileLabel"], function(yourDataFileLabel, yourConfigFileLabel)
- add your scene's alias to the define object at the top of the file.
-
In Coordinator.js...
- add your scene to the "scenes" object in the "settings" object at the top
"scenes" : {
"yourSceneName" : {
"config" : HanSON.parse(yourConfigFileLabel)
},
-
In Coordinator.js...
- add your scene to the "sceneOrder" array in the "settings" object at the top
"sceneOrder" : ["yourSceneName", "yourSecondSceneName", "etc"]
- add your scene to the "sceneOrder" array in the "settings" object at the top