私はcreatejsゲームで画像をコンテナ内に保持しています。私は画面上の場所に画像をトゥイーンし、別の画像に切り替える必要があります。数秒後に、キャンバス/スクリーンから新しい画像を削除したいと思います。CreateJSのトゥイーン機能
現在、私は関数に(evt)を渡していますが、他のゲーム/例はすべてこの部分を気にしません。
これは最初の.call関数で動作しますが、.waitと2番目の.callの後にコメントアウトした部分は機能しません。突然、TheThingBeingTweened
はundefined
ですか?
正しい方向のチップが役立ちます。
createjs.Tween
.get(inkContainer, {onChange: onInkContainerTweenChange})
.to({
y: playerContainer.y + (Math.random() * 200 - 100),
x: playerContainer.x + (Math.random() * 200)
}, 8000)
.call(function (evt) {
var theThingBeingTweened = evt.target;
//self.stage.removeChild(theThingBeingTweened);
var theContainer = theThingBeingTweened.parent;
theContainer.removeChild(theThingBeingTweened);
splatContainer = new createjs.Container();
splat = new
createjs.Bitmap(queue.getResult("splat"));
splatContainer.addChild(splat);
splatContainer.x = theThingBeingTweened.x;
splatContainer.y = theThingBeingTweened.y;
theContainer.addChild(splatContainer);
});
//.wait(3000)
//.call(function (evt) {
// var theThingBeingTweened = evt.target;
// self.stage.removeChild(theThingBeingTweened);
//});