popScene 动画
2016-04-18 19:28
344 查看
需要修改引擎的Director::popScene()函数,也可以进行重载或者设置默认参数。
void Director::popScene(const std::function<void(Scene* &)>& callback)
{
CCASSERT(_runningScene != nullptr, "running scene should not null");
_scenesStack.popBack();
ssize_t c = _scenesStack.size();
if (c == 0)
{
end();
}
else
{
_sendCleanupToScene = true;
_nextScene = _scenesStack.at(c - 1);
if(callback)
callback(_nextScene);
}
}
使用方式:
auto callback = [](Scene*& scene){scene = TransitionJumpZoom::create(1.0f, scene);};
Director::getInstance()->popScene(callback);
void Director::popScene(const std::function<void(Scene* &)>& callback)
{
CCASSERT(_runningScene != nullptr, "running scene should not null");
_scenesStack.popBack();
ssize_t c = _scenesStack.size();
if (c == 0)
{
end();
}
else
{
_sendCleanupToScene = true;
_nextScene = _scenesStack.at(c - 1);
if(callback)
callback(_nextScene);
}
}
使用方式:
auto callback = [](Scene*& scene){scene = TransitionJumpZoom::create(1.0f, scene);};
Director::getInstance()->popScene(callback);
相关文章推荐
- linux 下hook函数
- poj1157Little Shop of Flowers(动态规划题)
- Linux System Calls Hooking Method Summary LD_PRELOAD
- 在CentOS 7上快速安装配置WebSphere MQ 7.5快速指南
- Linux Expect 脚本学习资源
- shell并发处理脚本
- Linux C++编译运行过程
- shell脚本之sed使用详解
- 向正在运行的Linux应用程序注入代码
- Nginx重新编译添加模块
- 配置ganglia 监控 hadoop 节点
- Linux下Nodejs安装(完整详细)
- shell脚本之grep使用详解
- CentOS 6.3 NFS的安装配置、启动及mount挂载方法
- 一个Go推送服务器集群:gopush-cluster
- 工作邮件loop的用法
- centos7 nginx permission denied while connecting to upstream
- mac上配置tomcat9.0
- Linux iptables
- 在MyEclipse上部署Tomcat服务器