Phaser 3补间图形宽度

时间:2018-11-30 00:10:36

标签: phaser-framework tween

目前,我正尝试取一个创建的矩形并对其宽度进行补间。似乎没有用,我缺少什么吗?

// health bar is a rectangle made using game.add.graphics().fillRect()
var healthBar = state.healthBar;

var newHealthWidth = Math.random() * 100;

this.add.tween(healthBar)
.to({ width: newHealthWidth }, 500);

0 个答案:

没有答案