GameQuery を使用して 1 つのイメージ アニメーションを開始しました。ここで、アニメーションを停止します。そのために、次のコードを使用しました。
imgAnimation["myimage"] = new $.gameQuery.Animation({imageURL: imgPath + "test.png", numberOfFrame: 3, delta: 130, rate: 236,
type: $.gameQuery.ANIMATION_HORIZONTAL | $.gameQuery.ANIMATION_CALLBACK});
$("#playground").playground({height: PLAYGROUND_HEIGHT, width: PLAYGROUND_WIDTH})
.addGroup("actors", {width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT})
.addSprite("myimage",{animation: imgAnimation["myimage"],
posx: imgXPos, posy: 0, width: 128, height: 384, callback: callbackAnimation})
function callbackAnimation(){
$("#myimage").stop();
$("#myimage").clearQueue();
}
$.playground().startGame();
しかし、これは機能していないようです。しかし同時にhide()
、同じアニメーション要素( $("#myimage")
)でメソッドを使用すると、機能します。
どちらのメソッドも jQuery API のみの一部です。
しかし、停止メソッドが機能しないのはなぜですか?
前もって感謝します。