zoukankan      html  css  js  c++  java
  • cocos2d-x JS 利用重复动作实现动画播放(实现倒计时)

    cocos2d-js: cc.delayTime() and cc.repeatForever() don't work together in cc.sequence()  

     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次          
  • 相关阅读:
    youtube-VisualSfM and MeshLab workflow video-meshlab part integration
    testing_lab1
    homework2-st
    homework1-spm
    homework1-st
    just one last blog
    week 10
    week 9
    week 8
    课后题7
  • 原文地址:https://www.cnblogs.com/luorende/p/6815546.html
Copyright © 2011-2022 走看看