Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 522 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 522 Bytes

assets-loader

simple assets loader for images

npm install @robotopia/assets-loader

Usage

Initially load all your images

const assets = require('@robotopia/assets-loader')

assets.load({
  HERO: 'path/to/hero.png',
  WATER_TILE: 'path/to/water-tile.png',
})
.then(() => { 
  // start application 
})
.catch(() => console.log('error loading assets'))

After all images have been loaded they can be accessed by their name

assets.store.HERO // reference to hero.png