gpt4 book ai didi

javascript - 如何使用 createjs 删除补间

转载 作者:行者123 更新时间:2023-11-30 16:31:40 26 4
gpt4 key购买 nike

我有一个作为计时器旋转的时钟指针。如果用户在时间用完之前完成了事件,我需要停止那个补间。

我尝试删除补间但没有成功。我做错了什么?

我进入了升级功能,但删除补间不起作用。

 function Clock() {
// this.board = board;
clockContainer = new createjs.Container();
contain = new createjs.Container();
var clockBack = new createjs.Bitmap(queue.getResult("clockBack"));
clockHand = new createjs.Bitmap(queue.getResult("clockHand"));
clockBack.x = 40;
clockBack.y = 480;
clockHand.x = 95;
clockHand.y = 539;
clockHand.regX = 20
clockHand.regY = 105;
clockHand.scaleX = clockHand.scaleY = 0.50;
clockBack.scaleX = clockBack.scaleY = 0.50;
clockContainer.addChild(clockBack, clockHand);
TimerLength = 30000;
stage.addChild(clockContainer)
mytweentodisable = createjs.Tween.get(clockHand, { loop: false }).to({ rotation: 360 }, TimerLength).call(function () {
//this will trigger the timer is up
GamehasEnded = true;
checkWrongAndRight();
});
}

function levelUp() {

createjs.Tween.removeTweens(mytweentodisable)
console.log("adding Level up button");
levelUpContainer = new createjs.Container();
levelUpIcon = new createjs.Bitmap(queue.getResult("levelUp"));
levelUpContainer.addChild(levelUpIcon);
stage.addChild(levelUpContainer)
levelUpContainer.x = 350
levelUpContainer.y = 500
levelUpContainer.addEventListener("click", function () {
console.log("clicked it");
});
}

最佳答案

这应该可以解决问题:

mytweentodisable.setPaused(true);

关于javascript - 如何使用 createjs 删除补间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33238927/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com