資源簡介
關于cocos2d-x的小游戲 分享一下
代碼片段和文件信息
#include?“AboutScene.h“
#include?“HelloWorldScene.h“
using?namespace?cocos2d;
cocos2d::CCScene*?AboutScene::scene()
{
CCScene?*?scene?=?NULL;
do?
{
//?‘scene‘?is?an?autorelease?object
scene?=?CCScene::create();
CC_BREAK_IF(!?scene);
//?‘layer‘?is?an?autorelease?object
AboutScene*?layer?=?AboutScene::create();
CC_BREAK_IF(!?layer);
//?add?layer?as?a?child?to?scene
scene->addChild(layer);
}?while?(0);
//?return?the?scene
return?scene;
}
bool?AboutScene::init()
{
bool?bRet?=?false;
do?
{
std::string?titleStr?=?“Go!Fish!Go!\n?For?Cocos2d-x\n?All?the?resources?come?\nfrom?the?network\n\n?Author:northroom\n?Email:northroom1@gmail.com?“;
CCLabelTTF*?pLable?=?CCLabelTTF::create(titleStr.c_str()?“Thonburi“?30);
CC_BREAK_IF(!pLable);
pLable->setColor(ccBLUE);
CCSize?winSize?=?CCDirector::sharedDirector()->getWinSize();
//pLable->setAnchorPoint(ccp(01));
pLable->setPosition(ccp(winSize.width/2winSize.height/2));
this->addChild(pLable1);
std::string?str;
str=“Back“;
CCMenuItemFont*?backMenu?=?CCMenuItemFont::create(str.c_str()thismenu_selector(AboutScene::backCallback));
CCMenu*?mn?=?CCMenu::create(backMenuNULL);
mn->setPosition(ccp(00));
backMenu->setAnchorPoint(ccp(10));
backMenu->setPosition(ccp(winSize.width0));
this->addChild(mn1);
bRet?=?true;
}?while?(0);
return(bRet);
}
void?AboutScene::backCallback(cocos2d::CCobject*?pSender)
{
CCScene?*?scene=HelloWorld::scene();
CCDirector::sharedDirector()->replaceScene(CCTransitionFlipX::create(1.2fscene));
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-08-13?16:04??EatFish\
?????文件????????6148??2013-08-13?16:04??EatFish\.DS_Store
?????目錄???????????0??2013-08-13?16:05??__MACOSX\
?????目錄???????????0??2013-08-13?16:05??__MACOSX\EatFish\
?????文件?????????176??2013-08-13?16:04??__MACOSX\EatFish\._.DS_Store
?????目錄???????????0??2013-08-13?16:05??EatFish\.git\
?????目錄???????????0??2013-08-13?13:51??EatFish\.git\branches\
?????文件?????????138??2013-08-13?13:51??EatFish\.git\config
?????文件??????????73??2013-08-13?13:51??EatFish\.git\desc
?????文件??????????23??2013-08-13?13:51??EatFish\.git\HEAD
?????目錄???????????0??2013-08-13?13:51??EatFish\.git\hooks\
?????文件?????????452??2013-08-13?13:51??EatFish\.git\hooks\applypatch-msg.sample
?????文件?????????896??2013-08-13?13:51??EatFish\.git\hooks\commit-msg.sample
?????文件?????????189??2013-08-13?13:51??EatFish\.git\hooks\post-update.sample
?????文件?????????398??2013-08-13?13:51??EatFish\.git\hooks\pre-applypatch.sample
?????文件????????1704??2013-08-13?13:51??EatFish\.git\hooks\pre-commit.sample
?????文件????????4951??2013-08-13?13:51??EatFish\.git\hooks\pre-reba
?????文件????????1239??2013-08-13?13:51??EatFish\.git\hooks\prepare-commit-msg.sample
?????文件????????3611??2013-08-13?13:51??EatFish\.git\hooks\update.sample
?????文件???????70304??2013-08-13?14:56??EatFish\.git\index
?????目錄???????????0??2013-08-13?13:51??EatFish\.git\info\
?????文件??????????35??2013-08-13?13:51??EatFish\.git\info\exclude
?????目錄???????????0??2013-08-13?16:05??__MACOSX\EatFish\.git\
?????目錄???????????0??2013-08-13?16:05??__MACOSX\EatFish\.git\info\
?????文件?????????171??2013-08-13?13:51??__MACOSX\EatFish\.git\info\._exclude
?????目錄???????????0??2013-08-13?14:55??EatFish\.git\ob
?????目錄???????????0??2013-08-13?14:56??EatFish\.git\ob
?????文件????????1473??2013-08-13?13:51??EatFish\.git\ob
?????文件???????14646??2013-08-13?14:56??EatFish\.git\ob
?????目錄???????????0??2013-08-13?13:51??EatFish\.git\ob
?????文件????????8317??2013-08-13?13:51??EatFish\.git\ob
............此處省略2194個文件信息
- 上一篇:BILOG-MG (Version 3.0)
- 下一篇:ICEM 中文教程
評論
共有 條評論