JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.createjs.com/easeljs-0.6.1.min.js"></script>
<canvas id="canvas" width="300" height="300"></canvas>
JavaScript
var canvas = document.getElementById('canvas'),
stage = new createjs.Stage(canvas),
chopperImg = document.createElement('img'),
spriteSheet,
animation;
chopperImg.addEventListener('load', function ( e ) {
spriteSheet = new createjs.SpriteSheet({
images: [ chopperImg ],
frames: { width: 64, height: 73, count: 10 },
animations: {
idle: [ 0, 9, 'idle', 4 ]
}
});
animation = new createjs.BitmapAnimation(spriteSheet);
animation.gotoAndPlay('idle');
stage.addChild(animation);
createjs.Ticker.setFPS(30);
createjs.Ticker.addListener(stage);
});
chopperImg.src = 'http://dutchnoobz.nl/chopper.gif';