幾個地方要注意
// auto remove when it has finished
var myTween = new LinearMotion(null, Tween.ONESHOT);
// auto stop and run myComplete when is has finished
var myTween = new LinearMotion(myComplete);
myTween.setMotion(to_x, 340, to_x, 300, 0.5, Ease.quadOut);
// don't start immediately
addTween(myTween, false);
you can check myTween.active in update().
完整範例如下:
沒有留言:
張貼留言