1.cocos_helloworld
在class HelloWorld : public cocos2d::Layer中添加函数
void menuclose(cocos2d::Ref *psender);
实现:
void HelloWorld::menuclose(cocos2d::Ref *psender)
{
Director::getInstance()->end();
}
在bool HelloWorld::init()中与按钮关联起来
auto close = static_cast<ui::Button *> (rootNode->getChildByName("Button_1"));
close->addTouchEventListener(CC_CALLBACK_1(HelloWorld::menuclose,this));
截图:

1.cocos_helloworld的更多相关文章
随机推荐
- redis做成windows服务
打开cmd切换到redis根目录 执行安装命令 redis-server.exe --service-install redis.windows.conf --loglevel verbose 卸载 ...
- execlp(3) - Linux手册
名称: execl, execlp, execle, execv, execvp, execvpe:执行文件 总览: #include <unistd.h> extern char **e ...
- CentOS的基本设置界面
系统的基本设置,如语言.键盘鼠标.时间.网络.壁纸.通知等功能的设置 高级设置:如磁盘分区.系统日志.各种系统分析工具
- Java基础学习总结(45)——JAVA单元测试工具比较
1.简介 jtest是parasoft公司推出的一款针对java语言的自动化白盒测试工具,它通过自动实现java的单元测试和代码标准校验,来提高代码的可靠性.Jtest先分析每个java类,然后自动生 ...
- C语言中static的使用
在开发过程中.我们常常会须要定义一些static类型的变量或者函数.我们接下来来详细聊一下static: 1.修饰变量 当static来修饰一个变量时,就注定了这个变量的可见范围和生命周期: (1)当 ...
- Android 经常使用工作命令mmm,mm,m,croot,cgrep,jgrep,resgrep,godir
官方定义: Invoke ". build/envsetup.sh" from your shell to add the following functions to your ...
- 6. MongoDB——Java操作(增删改查)
转自:https://blog.csdn.net/kai402458953/article/details/79626148 import java.net.UnknownHostException; ...
- java9新特性-17-智能Java编译工具
1.官方Feature 139: Enhance javac to Improve Build Speed. 199: Smart Java Compilation, Phase Two 2.使用说明 ...
- 1570. [POJ3461]乌力波
★☆ 输入文件:oulipo.in 输出文件:oulipo.out 简单对比时间限制:1 s 内存限制:256 MB [题目描述] 法国作家乔治·佩雷克(Georges Perec,1 ...
- UI Framework-1: Ash Color Chooser
Ash Color Chooser Overview This document describes how to achieve <input type=”color”> UI in C ...