npm run install
npm run start
npm run build
The bundled js file will be saved in lib/gl.js
import WebGLAnimation from 'lib/gl';
const webglAnim = new WebGLAnimation('assets/');
document.body.appendChild(webglAnim.canvas);
webglAnim = new WebGLAnimation('assets/', {});
webglAnim.on('onProgress', onProgress);
webglAnim.on('onLoaded', onLoaded);
function onProgress(e) {
console.log('loading : ', e.percent);
}
function onLoaded(e) {
// all assets loaded
}
webglAnim.pause()
webglAnim.play()