Commit 22510841 authored by wildfirecode's avatar wildfirecode

1

parent b20675f3
......@@ -9,20 +9,25 @@ export default class Toast2 extends ComponentBase {
get skinResKey() { return 'common' }
get skinKey(): string { return 'Toast2' }
toastLabel:eui.Label;
toastLabel: eui.Label;
start() {
this.touchEnabled=false;
// this.touchChildren=false;
this.toastLabel.textFlow = (new HtmlTextParser).parser('<u>继续闯关赢好礼</u>');
this.toastLabel.addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
if(SceneCtrl.instance.currentScene instanceof MainScene){
this.toastLabel.textFlow = (new HtmlTextParser).parser('<u>继续闯关赢好礼</u>');
if (!this.hasEventListener(egret.TouchEvent.TOUCH_TAP)) {
this.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if (SceneCtrl.instance.currentScene instanceof MainScene) {
} else {
gotoNextLevel();
}
egret.Tween.removeTweens(this);
this.alpha = 0;
this.touchEnabled = false;
this.touchChildren = false;
}, this);
}
}else {
gotoNextLevel();
}
egret.Tween.removeTweens(this);
this.alpha=0;
},this);
return this;
}
}
\ No newline at end of file
......@@ -20,8 +20,13 @@ const initToast = () => {
export const showToast2 = () => {
const toast = initToast().start();
egret.Tween.removeTweens(toast);
toast.touchEnabled=true;
toast.touchChildren=true;
const tw = egret.Tween.get(toast);
tw.set({ y: -200, alpha: 1 }).to({ y: 400 }, 500, egret.Ease.quartOut)
.wait(3500)
.to({ alpha: 0 }, 300)
.to({ alpha: 0 }, 300).call(()=>{
toast.touchEnabled=false;
toast.touchChildren=false;
})
}
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