我正在研究createjs游戏中的图像被容纳在容器内。我想将图像补间到屏幕上的某个位置,并将图像切换到另一张图像。经过几秒钟后,我想从画布/屏幕中删除新图像。CreateJS中的补间函数
目前,我将一个(evt)传入函数,但其他游戏/示例都不会打扰这部分?
它在第一个.call函数中工作,但在.wait和第二个.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);
//});