首页 > 其他 > 详细

quick cocos 的scheduler 定时器

时间:2016-02-25 22:59:33      阅读:301      评论:0      收藏:0      [点我收藏+]

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)

quick cocos 的scheduler 定时器

原文:http://www.cnblogs.com/damowang/p/5218522.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!