7、Cocos2d-X 游戏编程之------CCControlSwitch的实现
来源:互联网 发布:手机淘宝账号交易平台 编辑:程序博客网 时间:2024/06/05 20:32
7、CCControlSwitch的实现方法
boolHelloWorld::init()
{
if (!CCLayer::init() )
{
return false;
}
CCControlSwitch*pSwitch= CCControlSwitch::create(
CCSprite::create("switch-mask.png"),
CCSprite::create("switch-on.png"),
CCSprite::create("switch-off.png"),
CCSprite::create("switch-thumb.png"),
CCLabelTTF::create("开", "Arial-BoldMT", 16),
CCLabelTTF::create("关", "Arial-BoldMT", 16)
);
pSwitch->setPosition(ccp(200,200));
//设置关闭状态
pSwitch->setOn(false);
//设置可操作
pSwitch->setEnabled(true);
//获取是否为打开(on)
CCLOG("是否打开状态:%i",pSwitch->isOn());
//获取当前开关状态是否为手动拖动开关进行的
CCLOG("是否手动拖动的开关:%i",pSwitch->hasMoved());
addChild(pSwitch);
return true;
}
- 7、Cocos2d-X 游戏编程之------CCControlSwitch的实现
- 6、Cocos2d-X 游戏编程之------CCEditBox的实现
- cocos2d-x扩展库CCControlSwitch的使用方法
- Cocos2D-X游戏开发入门学习--CCControlSwitch--基础知识03
- Cocos2d—X游戏开发之CCToggle(菜单标签切换)CCControlSwitch(开关切换)(十二)
- Cocos2d-x中开关按钮类CCControlSwitch的使用
- Cocos2d-x中开关按钮类CCControlSwitch的使用
- Cocos2D-x 用CCControlSwitch设置音乐的开关
- 4、Cocos2d-X 游戏编程之------菜单项的使用
- 5、Cocos2d-X 游戏编程之------精灵创建的方式
- 8、Cocos2d-X 游戏编程之------CCControlSlider的使用
- 9、Cocos2d-X 游戏编程之------CCControlButton的使用
- Cocos2d-x Lua游戏开发之Lua oo 的实现
- cocos2d-x开关按钮类CCControlSwitch
- Cocos2d-x控件使用CCControlSwitch<代码演示>
- Cocos2d-X 游戏编程之------游戏中精灵创建的方式
- cocos2d-x游戏技能CD的实现
- cocos2d-x游戏摇杆的实现方法
- 九月学习感想
- ExtJS中表格控件的使用,属性设置和数据的获取加载
- 6、Cocos2d-X 游戏编程之------CCEditBox的实现
- 《数据结构(C++版)》第二章线性表思维导图
- main原型和参数含义
- 7、Cocos2d-X 游戏编程之------CCControlSwitch的实现
- 谆阻转揍滋祖嘴组字渍赘壮综做祖祝卓宗
- Combination Sum II
- 大学那些事儿
- 学c++后感
- Xcode6 模拟器 软键盘
- 8、Cocos2d-X 游戏编程之------CCControlSlider的使用
- <一>UIScrollView使用 - 01
- 图形绘制