Cocos Creator label赋值变化的int值

第一次接触Cocsos Creator ,用Unity习惯了,有点不习惯,记录学习的成果而已。

cc.Class({
    extends: cc.Component,

    properties: {       
        score_lab: cc.Node,          
        time_lab:cc.Label,
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {
       
        this.scoreLab = this.score_lab.getComponent(cc.Label);
        this.score = 0;
    },
   

     update (dt) {},

     test_Btn(){
      
                this.score += 1;
                this.scoreLab.string = this.score.toString();
                this.time_lab.string=this.score;              
     },

});

猜你喜欢

转载自blog.csdn.net/hemiaoyuan1989/article/details/104801183
今日推荐