0.9.0 • Published 9 years ago

starbound-assets v0.9.0

Weekly downloads
10
License
MIT
Repository
github
Last release
9 years ago

Starbound Assets

Manage Starbound assets.

Example

Here's how you might use this package to extract a sound from the assets file:

var starbound = require('starbound-assets');

// Create an assets manager which will deal with package files etc. It
// will create a worker, which means you need to point it to where the
// worker.js file is stored.
var assets = new starbound.AssetsManager({workerPath: 'worker.js'});

// Assume file is a File object pointing to `assets/packed.pak`.
var file = ...;

// Load up the assets package and play a sound from it.
assets.addFile(file, function () {
  // Welcome to the jungle!
  var sound = '/sfx/environmental/jungle_day.ogg';
  assets.getBlobURL(sound, function (err, url) {
    var audio = new Audio();
    audio.autoplay = true;
    audio.src = url;
    document.body.appendChild(audio);
  });
});
0.9.0

9 years ago

0.8.2

9 years ago

0.8.1

10 years ago

0.8.0

10 years ago

0.7.0

10 years ago

0.6.0

10 years ago

0.5.0

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago