为什么当我调用 shiftHSL 时我的精灵消失了?

Why does my sprite disappear when I call shiftHSL?

如果我取消注释下面的 shiftHSL 行,精灵就不会出现。

<script src='https://rawgit.com/photonstorm/phaser/master/build/phaser.js'></script>

<script>
var game = new Phaser.Game(800, 400, Phaser.AUTO, '', {
  preload: function() { this.game.load.image('dwarf', 'res/dwarf.png') },
  create: function() {
    var bmd = game.make.bitmapData()
    bmd.width = 80
    bmd.height = 80
    bmd.circle(bmd.width / 2, bmd.width / 2, bmd.width / 2, '#ffffff')
    bmd.alphaMask('dwarf', bmd)
    // bmd.shiftHSL(0, -.5, 0)
    var sprite = game.add.sprite(100, 100, bmd)
  }
});
</script>

好的,我成功了。看来您需要在调用 shiftHSL 之前调用 bmd.update()