pause和resume
CCSet *m_pPausedTargets;类的成员变量
void CCNode::schedule(SEL_SCHEDULE selector, float interval, unsigned int repeat, float delay)
void PauseResumeActions::onEnter()
{
ActionsDemo::onEnter(); this->centerSprites(); m_tamara->runAction(CCRepeatForever::create(CCRotateBy::create(, )));
m_grossini->runAction(CCRepeatForever::create(CCRotateBy::create(, -)));
m_kathia->runAction(CCRepeatForever::create(CCRotateBy::create(, )));
//所有动作在第三秒暂停
this->schedule(schedule_selector(PauseResumeActions::pause), , false, );
//所有动作在第五秒重新开始
this->schedule(schedule_selector(PauseResumeActions::resume), , false, );
}
void PauseResumeActions::pause(float dt)
{
CCLog("Pausing");
CCDirector *director = CCDirector::sharedDirector(); CC_SAFE_RELEASE(m_pPausedTargets);
m_pPausedTargets = director->getActionManager()->pauseAllRunningActions();
CC_SAFE_RETAIN(m_pPausedTargets);
} void PauseResumeActions::resume(float dt)
{
CCLog("Resuming");
CCDirector *director = CCDirector::sharedDirector();
director->getActionManager()->resumeTargets(m_pPausedTargets);
}
pause和resume的更多相关文章
- quartz2.3.0(五)制定错过执行任务的misfire策略,用pause,resume模拟job暂停执行和继续执行
感谢兄台: <quartz-misfire 错失.补偿执行> misfire定义 misfire:被错过的执行任务策略 misfire重现——CronTrigger job任务类: pac ...
- [RxJS] Implement pause and resume feature correctly through RxJS
Eventually you will feel the need for pausing the observation of an Observable and resuming it later ...
- O034、 Nova Pause / Resume Instance 操作详解
参考https://www.cnblogs.com/CloudMan6/p/5496825.html 本节通过日志详细分析 Nova Pause / Resume 操作. 有时需要短时间暂停 ...
- Azkaban源码学习笔记
1. ConnectorParams (interface): 定义了各种常量参数,没有声明任何方法. 2. ExecutorServlet.java类 2.1 继承类HttpServlet和接口 ...
- 【原】AFNetworking源码阅读(三)
[原]AFNetworking源码阅读(三) 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 上一篇的话,主要是讲了如何通过构建一个request来生成一个data tas ...
- Node.js:理解stream
Stream在node.js中是一个抽象的接口,基于EventEmitter,也是一种Buffer的高级封装,用来处理流数据.流模块便是提供各种API让我们可以很简单的使用Stream. 流分为四种类 ...
- Win10 UWP开发系列:使用VS2015 Update2+ionic开发第一个Cordova App
安装VS2015 Update2的过程是非常曲折的.还好经过不懈的努力,终于折腾成功了. 如果开发Cordova项目的话,推荐大家用一下ionic这个框架,效果还不错.对于Cordova.PhoneG ...
- node-glob学习
node的glob模块允许你使用 *等符号, 来写一个glob规则,像在shell里一样,获取匹配对应规则的文件. 这个glob工具基于javascript.它使用了 minimatch 库来进行匹配 ...
- (原创)RecyclerView结合xUtils2.6实现滚动时不加载item,xUtils2.6的源码分析与改造
我们知道xUtils中的bitmapUtils与listview相配合可以实现滚动时暂停加载 只需要一句话: listview.addOnScrollListener(new PauseOnScrol ...
随机推荐
- break的使用方法
private static void test() { for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { Syst ...
- 【协议篇】UDP
UDP(User Data Protocol,用户数据报协议)是与TCP相对应的协议.它是面向非连接的协议,它不与对方建立连接,而是直接就把数据包发送过去! UDP适用于一次只传送少量数据.对可靠性要 ...
- 【Linux】在Linux上查看并替换特殊字符
现有windows上新建的一个txt文件file01.txt,内容如下: 我们通过ftp上传到Linux,在Linux下使用命令cat –A file01.txt查看文件内容发现该文件的结尾全是^M$ ...
- python之函数用法isinstance()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法isinstance() #isinstance() #说明:返回一个布尔值,判断数据 ...
- 怎么将txt文件转化为html格式的文件?--极为丑陋的方式
# -*- coding: utf-8 -*- #python 27 #xiaodeng #怎么将txt文件转化为html格式的文件?--极为丑陋的方式 import os #找出所有的txt格式的文 ...
- spring cloud单点登录
概述 基于springcloud的单点登录服务及基于zuul的网关服务(解决了通过zuul转发到认证服务之后session丢失问题) 详细 代码下载:http://www.demodashi.com/ ...
- 【vue.js】绑定click事件
- CentOS安装配置Samba
介绍 Samba可以让我们在windows中访问linux系统中的文件,如果用来调试linux虚拟机中的代码会非常的方便 1.安装 yum -y update yum install samba sa ...
- Mysql 5.7 从节点配置多线程主从复制
Mysql 采用多线程进行复制是从 Mysql 5.6 开始支持的内容,但是 5.6 版本下有缺陷,虽然支持多线程,但是每个数据库只能一个线程,也就是说如果我们只有一个数据库,则主从复制时也只有一个线 ...
- HDUOJ----A Computer Graphics Problem
A Computer Graphics Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (J ...