摘要: auto background = Sprite::create("background.png"); background->setPosition(Vec2(visibleSize.width / 2, visibleSize.height / 2)); Size backgroundSize = background->getContentSize(); ScrollVie... 阅读全文
posted @ 2017-01-09 11:23 feizuzu 阅读(312) 评论(0) 推荐(0) 编辑
摘要: ListView * listview = ListView::create(); //设置listview方向 垂直 listview->setDirection(ScrollView::Direction::VERTICAL); listview->setBackGroundImage("ccc.png"); //背景做9宫格填充 listview->setBac... 阅读全文
posted @ 2017-01-09 11:23 feizuzu 阅读(563) 评论(0) 推荐(0) 编辑
摘要: //获取精灵帧缓存的单例对象auto spriteFrameCache = SpriteFrameCache::getInstance();//从plist文件添加多个精灵帧spriteFrameCache->addSpriteFrameWithFile("XX.plist");//根据图片名称创建一个精灵帧auto sprite1Frame =spriteFrameCache->getSpri... 阅读全文
posted @ 2017-01-09 11:23 feizuzu 阅读(1341) 评论(0) 推荐(0) 编辑
摘要: auto pageview = PageView::create(); pageview->setContentSize(Size(480.0f, 320.0f)); pageview->setPosition(Vec2((visibleSize.width - pageview->getContentSize().width) / 2.0f, (visibleSize.hei... 阅读全文
posted @ 2017-01-09 11:23 feizuzu 阅读(415) 评论(0) 推荐(0) 编辑
摘要: #include"ui/CocosGUI.h"using namespace ui; Text* displayValudLabel = Text::create("轻易动滑块","Marker Felt.ttf", 48); displayValudLabel->setPosition(Vec2()); this->addChild(displayValudLabel); ... 阅读全文
posted @ 2017-01-09 11:22 feizuzu 阅读(160) 评论(0) 推荐(0) 编辑
摘要: #include"ui/CocosGUI.h"using namespace ui;Layout *layout = Layout::create(); //设置布局类型为平面相对布局 layout->setLayoutType(LayoutType::RELATIVE); //设置大小 layout->setContentSize(Size(280, 150)); ... 阅读全文
posted @ 2017-01-09 11:22 feizuzu 阅读(346) 评论(0) 推荐(0) 编辑
摘要: auto start = MenuItemFont::create("ON");auto stop =MenuItemFont::create("OFF");auto toggle = MenuItemToggle::createWithCallback(CC_CALLBACK_1(HellWord::menuONorOFFCallback,this),start,stop,NULL);toggl... 阅读全文
posted @ 2017-01-09 11:20 feizuzu 阅读(931) 评论(0) 推荐(0) 编辑
摘要: //预加载音乐和音效SimpleAudioEngine::getInstance()->preloadBackgroundMusic(MUSIC_FILE);SimpleAudioEngine::getInstance()->preloadEffect(EFFECT);//播放背景音乐SimpleAudioEngine::getInstance()->playBackgroundMusic(MUS... 阅读全文
posted @ 2017-01-09 11:19 feizuzu 阅读(365) 评论(0) 推荐(0) 编辑
摘要: void MPlayer::setMapPointByMplayer(){ Size visableSize = Director::getInstance()->getVisibleSize(); Size mapTileNum = getGameMap()->getMapSize(); Size tiledSize = getGameMap()->getTileSize();... 阅读全文
posted @ 2017-01-09 11:18 feizuzu 阅读(551) 评论(0) 推荐(0) 编辑
摘要: CCDictionary *strings = CCDictionary::createWithContentsOfFile("tips2.xml"); const char *hello = ((CCString*)strings->valueForKey("tp1"))->m_sString.c_str(); CCLabelTTF *labelHello = CCLabelTTF... 阅读全文
posted @ 2017-01-09 11:18 feizuzu 阅读(269) 评论(0) 推荐(0) 编辑