Files
sudoku/src/views/ScoreAdd.ts

44 lines
1012 B
TypeScript
Raw Normal View History

2025-05-27 14:59:33 +08:00
import { config } from "../constants/config";
import { AutoDestroy } from "./common/AutoDestroy";
2025-05-15 21:36:03 +08:00
const { regClass, property } = Laya;
@regClass()
export class ScoreAdd extends Laya.Script {
declare owner : Laya.Box;
2025-05-27 14:59:33 +08:00
@property(Laya.Label)
public label: Laya.Label
2025-05-15 21:36:03 +08:00
onAwake(): void {
2025-05-27 14:59:33 +08:00
this.label.scaleX = 0
this.label.skewY = 0
var d = this.owner.getComponent(AutoDestroy)
d.lifeTime = 2
2025-05-15 21:36:03 +08:00
}
2025-05-27 14:59:33 +08:00
onStart(): void {
var wait = 0
var duration = 300
Laya.Tween.to(this.label, {scaleX: 1, scaleY: 1}, duration, Laya.Ease.strongIn, null, wait)
wait += duration
duration = 300
Laya.Tween.to(this.label, {y:-102}, duration, Laya.Ease.strongIn, null, wait)
wait += duration
duration = 300
Laya.Tween.to(this.label, {alpha:0}, duration, Laya.Ease.strongIn, null, wait)
wait += duration
}
public onSetText(text: string): void {
this.label.text = text
}
2025-05-15 21:36:03 +08:00
}