quick cocos 的scheduler 定时器

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)

原文链接: https://www.cnblogs.com/damowang/p/5218522.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

    quick cocos 的scheduler 定时器

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/229148

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月13日 下午2:13
下一篇 2023年2月13日 下午2:13

相关推荐