Cocos2d-x Layout使用
来源:互联网 发布:海岛奇兵菊花升级数据 编辑:程序博客网 时间:2024/05/11 08:33
Size size = Director::getInstance()->getVisibleSize();
Layout* layout = Layout::create();
layout->setContentSize(Size(300,200));
layout->setBackGroundColorType(LAYOUT_COLOR_SOLID);
//layout->setSize(Size(300,200));
layout->setAnchorPoint(Point(0.5f,0.5f));
layout->setBackGroundColor(Color3B::BLUE);
layout->setPosition(Point(size.width/2,size.height/2));
this->addChild(layout);
Button* button = Button::create("animationbuttonnormal.png", "animationbuttonpressed.png");
button->setPosition(Vec2(0,0));
button->setAnchorPoint(Vec2(0,0));
layout->addChild(button);
Button* titleButton = Button::create("backtotopnormal.png", "backtotoppressed.png");
titleButton->setTitleText("Title Button");
titleButton->setPosition(Vec2(layout->getContentSize().width/2,layout->getContentSize().height/2));
layout->addChild(titleButton);
Button* button_scale9 = Button::create("button.png", "buttonHighlighted.png");
button_scale9->setScale9Enabled(true);
button_scale9->setContentSize(Size(200,button_scale9->getVirtualRendererSize().height));
button_scale9->setPosition(Vec2(layout->getContentSize().width - button_scale9->getContentSize().width /2,layout->getContentSize().height - button_scale9->getContentSize().height /2));
layout->addChild(button_scale9);
Layout* layout = Layout::create();
layout->setContentSize(Size(300,200));
layout->setBackGroundColorType(LAYOUT_COLOR_SOLID);
//layout->setSize(Size(300,200));
layout->setAnchorPoint(Point(0.5f,0.5f));
layout->setBackGroundColor(Color3B::BLUE);
layout->setPosition(Point(size.width/2,size.height/2));
this->addChild(layout);
Button* button = Button::create("animationbuttonnormal.png", "animationbuttonpressed.png");
button->setPosition(Vec2(0,0));
button->setAnchorPoint(Vec2(0,0));
layout->addChild(button);
Button* titleButton = Button::create("backtotopnormal.png", "backtotoppressed.png");
titleButton->setTitleText("Title Button");
titleButton->setPosition(Vec2(layout->getContentSize().width/2,layout->getContentSize().height/2));
layout->addChild(titleButton);
Button* button_scale9 = Button::create("button.png", "buttonHighlighted.png");
button_scale9->setScale9Enabled(true);
button_scale9->setContentSize(Size(200,button_scale9->getVirtualRendererSize().height));
button_scale9->setPosition(Vec2(layout->getContentSize().width - button_scale9->getContentSize().width /2,layout->getContentSize().height - button_scale9->getContentSize().height /2));
layout->addChild(button_scale9);
0 0
- Cocos2d-x Layout使用
- Cocos2d-x Layout简单使用
- Cocos2d-x Layout使用三
- Cocos2d-x Layout的使用二
- Cocos2d-x layout (二)
- cocos2d-X 节点(Layout.h)API
- Cocos2d-x--使用Cocos2d-x v3.0.0
- cocos2d-x CCTextureCache使用
- Cocos2d-x使用SQLite
- cocos2d-x RTTI使用
- cocos2d-x 使用断言
- cocos2d-x 使用plugin
- Cocos2d-X tolua++ 使用
- cocos2d-x jsonCpps使用
- cocos2d-x 使用 CCScale9Sprite
- cocos2d-x CCEditBox使用
- cocos2d-x函数使用
- Cocos2d-x OpenGL 使用
- Missing iOS Distribution signing identity for "XXX" Interactive -- 开发证书和发布证书过期无效
- XCode编译器介绍
- UILabel添加删除线,类似团购效果
- python之列表list
- hdu 1285
- Cocos2d-x Layout使用
- leetCode 202. Happy Number
- Qt4项目迁移到Qt5问题:greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
- Redis教程(十二):服务器管理命令总结
- hdu 2191(多重背包)
- html-frame用法
- Android自学之路
- ARM-LINUX 交叉编译工具链搭建
- github 详解详解