cc.Class({ extends: cc.Component, properties: { }, start () { }, // update : function (dt) { // var RivalDistance = Math.abs(Math.floor(cc.find('Rivel').x - cc.find('Hero').x)).toString(); // this.node.getComponent(cc.Label).string=RivalDistance.toString(); // }, setRivalDistanceNum:function (RivalDistanceNum) { this.node.getComponent(cc.Label).string = RivalDistanceNum; } });