顯示具有 flashpunk 標籤的文章。 顯示所有文章
顯示具有 flashpunk 標籤的文章。 顯示所有文章

2012年1月12日 星期四

flashpunk LinearMotion usage

幾個地方要注意
// 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().
完整範例如下:

flashpunk tips

// debug 超好用呀~~
// press ~ : toggle the debug Console on/off.
FP.console.enable();

// global objects
FP.stage
FP.width
FP.height
FP.halfWidth
FP.halfHeight