AnimationAdaptorに戻る

AnimationAdaptor.swing - アニメーションを繰り返し実行します。指定したパターンの間を往復するアニメーションを実行します。

書式

swing(from,to,spd) 
    
from
アニメーションの最初のキャラクタパターン
to
アニメーションの最後のキャラクタパターン
spd
アニメーション速度( spdフレームにつき1パターン進む 。 1が最速 )

例1

 
extends SpriteChar;
anim=newAnimation();
anim.swing($Pat_Sample+4,$Pat_Sample+6,3);
wait();
このオブジェクトは、次の順番でパターンを切り替えます、この動作を繰り返します。
$Pat_Sample+4 → $Pat_Sample+5 → $Pat_Sample+6 → $Pat_Sample+5 → 再び$Pat_Sample+4...
&ref(bpats2.png);