UNPKG

cocos2d-html5

Version:
25 lines (21 loc) 615 B
var SchedulerUpdateAndCustomTest = cc.Layer.extend({ ctor : function(){ this._super(); this.scheduleUpdate(); this.schedule(this.onTick); this.schedule(this.onStopCallbacks, 4); }, update:function (dt) { logTest("update called:" + dt); }, onTick:function (dt) { logTest("custom callback called:" + dt); }, onStopCallbacks:function (dt) { this.unscheduleAllCallbacks(); } }); SchedulerUpdateAndCustomTest.create = function(args){ var layer = new SchedulerUpdateAndCustomTest(); return layer.init() ? layer : null; };