cocos2d-js:调用scheduleUpdate()不执行update()方法的解决办法
来源:互联网 发布:福建知鱼科技有限公司 编辑:程序博客网 时间:2024/05/01 00:08
cc.director.getScheduler().scheduleUpdate(target, 0, false);
参考来源:http://cocos2d.9tech.cn/news/2013/0911/28709.html
替换scheduleUpdate():
CCDirector::sharedDirector()->getScheduler()->scheduleUpdateForTarget(this,0,false);
或者:
CCDirector::sharedDirector()->getScheduler()->scheduleSelector(schedule_selector(NewGame::update),this,0.1,false);
当然了,使用系统提供的update总是不那么方便,还不如自己定义自己的更新方法,在指定时间内调用,如:
schedule(schedule_selector(Potentiometer::valueChange),1);
unschedule(schedule_selector(Potentiometer::valueChange));
以及
CCDirector::sharedDirector()->getScheduler()->scheduleSelector(SEL_SCHEDULE(&Potentiometer::valueChange), this, 1, false);
CCDirector::sharedDirector()->getScheduler()->unscheduleSelector(SEL_SCHEDULE(&Potentiometer::valueChange), this);
都能达到很好的效果,在间隔1s时间后,调用valueChange方法,尤其是当类的继承不为CCNode而为CCLayer时,以上两种方法还是很有效果的。
- cocos2d-js:调用scheduleUpdate()不执行update()方法的解决办法
- cocos2d-x调用scheduleUpdate()不执行update()方法的解决办法
- cocos2d-x调用scheduleUpdate()不执行update()方法的解决办法
- cocos2d-x调用scheduleUpdate()不执行update()方法的解决办法
- cocos2d-x调用scheduleUpdate()不执行update()方法的解决办法
- cocos2d-x调用scheduleUpdate()不执行update()方法的解决办法
- Cocos2d-x 每一帧执行事件之 scheduleUpdate()与Update()以及schedule()定时刷新的使用
- Cocos2d-x 每一帧执行事件之 scheduleUpdate()与Update()以及
- Cocos2d-x 每一帧执行事件之 scheduleUpdate()与Update()以及
- 【爱上cocos2d-x之十四】每一帧都调用,scheduleUpdate和update
- c#操作access,update语句不执行的解决办法
- c#操作access,update语句不执行的解决办法
- c#操作access,update语句不执行的解决办法
- 对于调用DataAdapter.Update 方法时发生的错误解决办法
- Cocos2D-x schedule & scheduleUpdate 的使用
- Cocos2D-x schedule & scheduleUpdate 的使用
- JS调用form的方法submit直接提交form的时候,submit事件不响应解决办法
- Cocos2d-x 网络线程与UI线程的同步 继承Node但是不执行Update
- arm-linux内存管理学习笔记(2)-内核临时页表的建立
- git 代码合并
- [Ant][StartWithAnt] 第七章 Ant扩展包ant-contrib的使用
- 第五周项目3-时间类
- 【poj 1699】Best Sequence 题意&题解&代码(C++)
- cocos2d-js:调用scheduleUpdate()不执行update()方法的解决办法
- 使用OpenCV实现分水岭算法
- 有趣的有趣的家庭菜园
- Extjs6问题——grid不显示数据
- ReactNative学习十二-React-Native-Viewpager
- IOS设计模式-单例模式
- Android IntentService完全解析 当Service遇到Handler
- How to delete PACKAGE from HANA studio
- 经过static修饰过变量与不被static修饰的变量在运算中初始值的变化关系