createjs spriteSheet 帧率framerate问题

曹志强
  • 2
新手上路,请多包涵

用createjs 做雪碧图的时候 修改帧率无效 ;

      var data = {  images: [
            "images/gw1_1.png",
            "images/gw1_2.png",
            "images/gw1_3.png",
            "images/gw1_4.png",
            "images/gw1_5.png",
            "images/gw1_6.png",
            "images/gw1_7.png",
            "images/gw1_8.png",
        ],
        framerate : 5,
        frames: {width:751, height:1207},
        animations:{
            walk: {
                frames: [0,7]
            }
        }
    };

    var spriteSheet = new createjs.SpriteSheet(data);
    animation = new createjs.Sprite(spriteSheet,'walk');
    animation.paused = false;
    container.addChild(animation);
    container.setChildIndex(animation,2);
回复
阅读 2.1k
3 个回答

我也遇到了,是不是插件的bug哦,ticker中设置了帧率吧,spritesheet设置了就没用了

已解决,在SpriteSheet修改就可以了

是stage更新的方式有问题:

createjs.Ticker.addEventListener('tick', () => {
      stage.update();
    });

要这样:

createjs.Ticker.addEventListener('tick', stage);
宣传栏