标签:io os for sp on 时间 bs c++ ui
cocos2dx原生lua对于定时器的写法:
1.每帧调用:
void scheduleUpdateWithPriority(int priority)
void scheduleUpdateWithPriorityLua (int nHandler,int priority)
2.指定调用间隔时间的:
unsigned int scheduleScriptFunc (unsigned int nHandler, float fInterval, bool bPaused)
3.取消定时器事件
void unscheduleScriptEntry (unsigned int uScheduleScriptEntryID)
quick对于schedule的调用:
首先引入这个模块,
local scheduler=require("framework.scheduler")
1.每帧调用:
scheduler.scheduleUpdateGlobal(onInterval)
2.指定调用间隔时间的:
scheduler.scheduleGlobal(onInterval, time)
scheduler.performWithDelayGlobal(onInterval, time)
3.取消定时器事件
scheduler.unscheduleGlobal(handler)
cocos2dx c++ schedule:
scheduleUpdate() ->update(float dt)
schedule(schedule_selector(handler),time)
标签:io os for sp on 时间 bs c++ ui
原文地址:http://www.cnblogs.com/zhangligopher/p/4037577.html