1          this.numm = 100; //设置倒计时总数为100    
 2         
 3       var act = cc.sequence(cc.callFunc(function() {
 4 
 5                 //在这里面可自定义事件(在此我以倒计时为例)
 6 
 7                 this.numm --;
 8                 this.table_time.setString(this.numm);//赋值到标签对象
 9                 if(this.numm <= -1){//加个判断避免出错
10                    
11                       this.table_time.setString("0");
12            
13                 }
14             }, this), cc.delayTime(1));  //延时一秒  
15             this.runAction(cc.repeat(act, 100));  //重复动作,这里100为执行100次          

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
  • 2021-06-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
相关资源
相似解决方案