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)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2021-08-06
  • 2022-01-12
猜你喜欢
  • 2021-09-26
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-12-30
  • 2021-09-17
相关资源
相似解决方案