Provides loading and resolving of JSON files with external references. Upon completion of the resolution of all references the loader calls a specified callback passing it the resolved data.
Required scripts
The ResourceLoader object requires:
/*{{ javascript("jslib/resourceloader.js") }}*/
/*{{ javascript("jslib/vmath.js") }}*/
Summary
Requests loading and resolving of a set of JSON data from the specified assetPath. Upon completion the onload callback supplied in the loadParams will be executed.
Syntax
var loadParams = {
append : true,
nodesNamePrefix : "level1",
shapesNamePrefix : "level1",
requestHandler : requestHandler,
onload : levelLoadedFn
};
resourceLoader.load(assetPath, loadParams);
Summary
Requests loading of animation data from an asset with a given path. Any animations stored in the animations property of the asset loaded will be stored in the animation manager by their dictionary name. The assets will be loaded asynchronously and may not be immediately available via the get method.
Syntax
var params = {
data : jsonData,
append : true,
nodesNamePrefix : "level1",
shapesNamePrefix : "level1",
requestHandler : requestHandler,
onload : levelLoadedFn
};
resourceLoader.resolve(params);
Summary
Clears the contents of the resource loader allowing a new set of resources to be loaded.
Syntax
resourceLoader.clear();