Implements
- {PIXI.ILoaderPlugin}
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:
// 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!
<script src="./node_modules/@pixi/basis/assets/basis_transcoder.js" />
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.
// 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.