mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-04-23 05:47:33 +08:00
update framework
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
class ScaleButton extends Laya.Button {
|
||||
constructor() {
|
||||
super();
|
||||
this.on(Laya.Event.MOUSE_DOWN, this, this.onMouse, [Laya.Event.MOUSE_DOWN]);
|
||||
this.on(Laya.Event.MOUSE_OUT, this, this.onMouse, [Laya.Event.MOUSE_OUT]);
|
||||
this.on(Laya.Event.MOUSE_UP, this, this.onMouse, [Laya.Event.MOUSE_UP]);
|
||||
}
|
||||
|
||||
onMouse(type) {
|
||||
switch (type) {
|
||||
case Laya.Event.MOUSE_DOWN:
|
||||
Laya.Tween.to(this, { scaleX: 0.9, scaleY: 0.9 }, 100);
|
||||
break;
|
||||
case Laya.Event.MOUSE_OUT:
|
||||
case Laya.Event.MOUSE_UP:
|
||||
Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 100);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user