Resource Manager
fernandojsg opened this issue · 2 comments
I'm thinking about the need of some resource loader/manager to let you do some important things I miss on frame.js/three.js: share resources between different effects, create a loading bar to let the user see how many resources needs to be loaded in order to run the demo and also prevent to run the demo without all the needed resources.
This could be the basic definition for this THREE.ResourceManager
class:
loadResources: function ( resourcesList, onLoadCallback, onLoadingStepCallback );
addResource: function ( resourceId, resourceData, resourceType );
get: function ( resourceId );
Also this resources could be part of the script definition object with something like:
var json={"metadata":{"version":1}, "resources":[....], "timeline":[....] ....
In that way it should be necessary to use the resourceId
parameter on the modules instances instead of using the file definition.
The frame.js loader will look first for the resource list, load all of them and after that it will call init()
for each effect.
Uhm... Let me think about this...