Play a series of images as sprite animation. It can be render into DOM or canvas.
Install
npm install:
npm i image-sprite --save
included in script
:
Usage
var imageSprite = 'mountNode' width: 300 height: 300 images: // urls of your images mode: 'canvas' interval: 16 onLoaded: null // once all images are loaded, will trigger this callback onUpdate: null // will be invoked per frame while playing onComplete: null // will be invoked once playing completed imageSprite // play, by default is looping play, equals to play({ loop: true })imageSprite // play twiceimageSprite // play to the frame which index is 1imageSprite // play of next 10 frames /* you can specify direction and interval of this play */imageSprite // direction values: 'forward', 'backward', 'alternate' imageSprite // pause imageSpritenext // next frame imageSprite // prev frame imageSprite // jump to a specified frame imageSprite