-
Notifications
You must be signed in to change notification settings - Fork 4
Loading from a stand alone project
Ioannis Charalampidis edited this page Jun 7, 2016
·
5 revisions
You need to download and include in your page the following files:
- JBB Run-time (https://github.com/wavesoft/jbb/releases)
- JBB Profile (https://github.com/wavesoft/jbb/wiki/List-of-known-profiles) for every object class you are using
Each one of these files will create/extend the global JBB namespace. The profiles will be available in the JBB.Profile namespace.
// Instantiate binary loader
var loader = new JBB.BinaryLoader("/path/to/bundles");
// Add one or more profiles that used to create your bundles
loader.addProfile( JBB.Profile["three"] );
// Add one or more bundles to load
loader.add("bundle_name.jbb");
loader.add("sparse_bundle_name.jbbp");
// Load all of them and callback when ready
loader.load(function(err, database) {
// Handle errors
if (err) {
alert("Loading error: "+err);
return;
}
// Handle your data here
var my_object = database["bundle_name/resource_name"];
});