Class: BasisParser

PIXI.BasisParser

Loader plugin for handling BASIS supercompressed texture files.

To use this loader, you must bind the basis_universal WebAssembly transcoder. There are two ways of doing this:

  1. Adding a <script> tag to your HTML page to the transcoder bundle in this package, and serving the WASM binary from the same location.
// Copy ./node_modules/@pixi/basis/assets/basis_.wasm into your assets directory
// as well, so it is served from the same folder as the JavaScript!
&lt;script src="./node_modules/@pixi/basis/assets/basis_transcoder.js" /&gt;

NOTE: basis_transcoder.js expects the WebAssembly binary to be named basis_transcoder.wasm. NOTE-2: This method supports transcoding on the main-thread. Only use this if you have 1 or 2 *.basis files.

  1. Loading the transcoder source from a URL.
// Use this if you to use the default CDN url for @pixi/basis
BasisParser.loadTranscoder();

// Use this if you want to serve the transcoder on your own
BasisParser.loadTranscoder('./basis_transcoder.js', './basis_transcoder.wasm');

NOTE: This can only be used with web-workers.

new PIXI.BasisParser ()

Loader plugin for handling BASIS supercompressed texture files.

Implements

  • {PIXI.ILoaderPlugin}

Classes

TranscoderWorker