Explorar o código

修改Toast时间

hwt %!s(int64=6) %!d(string=hai) anos
pai
achega
e0e24004c8
Modificáronse 1 ficheiros con 3 adicións e 5 borrados
  1. 3 5
      assets/scripts/notice/ToastCtrl.js

+ 3 - 5
assets/scripts/notice/ToastCtrl.js

@@ -7,9 +7,7 @@ cc.Class({
     },
 
     onLoad() {
-        this.node.on(cc.Node.EventType.TOUCH_END, () => {
-            // this.close();
-        });
+
     },
 
     show(message) {
@@ -17,11 +15,11 @@ cc.Class({
         this.label.string = message;
         this.node.active = true;
         this.node.y = - this.node.height;
-        let anim = cc.spawn(cc.moveBy(0.3, 0, this.node.height), cc.fadeOut(0.3));
+        let anim = cc.spawn(cc.moveBy(0.3, 0, this.node.height), cc.fadeIn(0.3));
         this.node.runAction(anim);
         this.timer = setInterval(() => {
             this.close();
-        }, 2000);
+        }, 1000);
     },
 
     // update (dt) {},