就是要显示一个不断跳动的当前时间。
var now;
var UI = {
ready:function(){
this.schedule(UI.update,0.01);
},
update:function(){
now = new Date;
}
}
var GameLayer = cc.Layer.extend({
onEnter: function() {
UI.ready;
var timelb = cc.LabelTTF.create( now , “宋体”, 18, cc.size(180, 180), cc.TEXT_ALIGNMENT_LEFT);
timelb.x = 100;
timelb.y = 80;
timelb.color = cc.color(255, 0, 0);
this.addChild(timelb,10);
}
}
是这么用的么?
