EaselJS:无法在舞台上显示BitmapAnimation

Jon*_*ops 1 javascript canvas easeljs createjs

我正在尝试在舞台上绘制一个动画位图,但我似乎无法让它工作.我可以验证动画是否已添加到控制台中的舞台但它没有显示.

HTML:

<canvas id="canvas" width="300" height="300"></canvas>
Run Code Online (Sandbox Code Playgroud)

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: 75, 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';
Run Code Online (Sandbox Code Playgroud)

我在这里做了一个JSFiddle演示我的问题:http://jsfiddle.net/WWpVX/1/

ols*_*lsn 5

你的GIF高度只有73像素,你的画面尺寸不能超过图像尺寸,我已经更新了你的小提琴,它可以在这里工作:http://jsfiddle.net/WWpVX/2/

frames: { width: 64, height: 73, count: 10 }
Run Code Online (Sandbox Code Playgroud)