Commit 18e0ef11 authored by asdf's avatar asdf

.

parent b8c1f707
......@@ -234,7 +234,13 @@ cc.Class({
playLabelGreen() {
this.dragonBone.playAnimation(this.animationName, 1);
this.playAudioOption((duration) => {
this.scheduleDuration = duration / 4 / this.label.node.width;
this.scheduleStep = 2;
this.scheduleDuration = duration / 2 / this.label.node.width * this.scheduleStep;
if(this.scheduleDuration < 0.01){
this.scheduleDuration = 0.01;
this.scheduleStep = this.scheduleDuration / duration * 2 * this.label.node.width;
}
this.unschedule(this.playLabelGreenCb);
this.schedule(this.playLabelGreenCb, this.scheduleDuration)
......@@ -245,7 +251,7 @@ cc.Class({
});
},
playLabelGreenCb() {
this.labelMask.width += 2;
this.labelMask.width += this.scheduleStep;
if (this.labelMask.width >= this.label.node.width) {
this.unschedule(this.playLabelGreenCb)
this.labelMask.anchorX = 1;
......@@ -260,7 +266,7 @@ cc.Class({
this.schedule(this.playLabelWhiteCb, this.scheduleDuration)
},
playLabelWhiteCb() {
this.labelMask.width -= 2;
this.labelMask.width -= this.scheduleStep;
if (this.labelMask.width <= 0) {
this.unschedule(this.playLabelWhiteCb)
this.labelMask.anchorX = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment