daily update

This commit is contained in:
Vick Scarlet
2021-11-27 21:48:47 +08:00
parent 52d6a0ca8f
commit 1d07bdfc46
26 changed files with 1449 additions and 4068 deletions
+58
View File
@@ -465,4 +465,62 @@ class ColorfulBox extends Laya.Box {
label.text = value;
}
}
class BlankBox extends Laya.Box {
constructor() {
super();
this.mask = new Laya.Sprite();
this.#blank = new Laya.Sprite();
this.addChild(this.#blank);
}
#blank;
#timeLine;
#pause = true;
#draw() {
this.mask.graphics.clear();
this.#blank.graphics.clear();
this.mask.graphics.drawRect(0, 0, this.width, this.height, '#000000');
this.#blank.graphics.drawRect(0, 0, this.width, this.height, '#000000');
if(this.#timeLine) this.#timeLine.destroy();
this.#timeLine = new Laya.TimeLine()
.to(this.#blank, { x: this.width }, 2000)
.to(this.#blank, { x: -this.width }, 0);
this.#timeLine.play(0, true);
if(this.#pause) this.#timeLine.pause();
}
get pause() {
return this.#pause;
}
set pause(value) {
if(this.#pause == value) return;
this.#pause = value;
this.#blank.visible = !value;
if(value) this.#timeLine.pause();
else this.#timeLine.resume();
}
destroy(destroyChild) {
this.#timeLine.destroy(true);
super.destroy(destroyChild);
}
get width() {
return super.width;
}
set width(value) {
super.width = value;
this.#blank.x = -this.width;
this.#draw();
}
get height() {
return super.height;
}
set height(value) {
super.height = value;
this.#draw();
}
}