How to use the async-preloader.default.loadImage function in async-preloader

To help you get started, we’ve selected a few async-preloader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dmnsgn / primitive-geometry / demo / index.js View on Github external
async function loadTexture(src) {
  const image = await AsyncPreloader.loadImage({ src });

  const texture = regl.texture({ data: image, flipY: false });
  texture.resize(image.width, image.height);

  return texture;
}

async-preloader

Assets preloader using async/await and fetch for usage both in the browser and Node.js.

MIT
Latest version published 6 months ago

Package Health Score

59 / 100
Full package analysis