本文整理汇总了C++中CCBReader::setCCBRootPath方法的典型用法代码示例。如果您正苦于以下问题:C++ CCBReader::setCCBRootPath方法的具体用法?C++ CCBReader::setCCBRootPath怎么用?C++ CCBReader::setCCBRootPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCBReader
的用法示例。
在下文中一共展示了CCBReader::setCCBRootPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool BalloonRankDialog::init()
{
bool bRet = false;
do
{
CC_BREAK_IF(!DialogLayer::init());
CCNodeLoaderLibrary* pLoaderLib = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();
CCBReader* pCCBReader = new CCBReader(pLoaderLib);
std::string strCCBFileName = "BalloonRankDialog.ccbi";
const std::vector<std::string> vSearchOrder = CCFileUtils::sharedFileUtils()->getSearchResolutionsOrder();
std::string strCCBRootPath = vSearchOrder[0];
pCCBReader->setCCBRootPath(strCCBRootPath.c_str());
CCNode* pNode = pCCBReader->readNodeGraphFromFile(strCCBFileName.c_str(), this);
if (pNode != NULL)
{
this->addChild(pNode);
}
pCCBReader->release();
setKeypadEnabled(true);
initLabelTTF();
initTableView();
initMenu();
// start fire
CCArray* pArrayFire = CCArray::createWithCapacity(6);
for (int idx = 1; idx <= 6; ++idx)
{
pArrayFire->addObject(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(CCString::createWithFormat("energy_fire%d.png", idx)->getCString()));
}
CCAnimation* pAnimation = CCAnimation::createWithSpriteFrames(pArrayFire, 0.1f);
CCAnimate* pAnimateFire = CCAnimate::create(pAnimation);
m_pSpriteScoreFire->runAction(CCRepeatForever::create(pAnimateFire));
// set animation onEnter and onExit
m_pMainBoard = m_pSpriteBoard;
m_pSpriteBoard->setScale(0.01f);
setOnEnterAction(CCEaseBounceOut::create(CCScaleTo::create(0.5f, 1.0f)));
setOnExitAction(CCEaseExponentialIn::create(CCScaleTo::create(0.5f, 0.01f)));
bRet = true;
} while(0);
return bRet;
}
示例2: init
bool BalloonOptionsDialog::init()
{
// TODO:
bool bRet = false;
do
{
CC_BREAK_IF(!DialogLayer::init());
// 加载ccbi
CCNodeLoaderLibrary* pLoaderLib = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();
CCBReader* pCCBReader = new CCBReader(pLoaderLib);
// 对应ccbi文件
std::string strCCBFileName = "BalloonOptionsDialog.ccbi";
// 得到第一个搜索路径
const std::vector<std::string> vSearchOrder = CCFileUtils::sharedFileUtils()->getSearchResolutionsOrder();
// 本程序中是对应的第一个元素即为对应的资源路径
std::string strCCBRootPath = vSearchOrder[0];
// 设置CCB的资源路径
pCCBReader->setCCBRootPath(strCCBRootPath.c_str());
CCNode* pNode = pCCBReader->readNodeGraphFromFile(strCCBFileName.c_str(), this);
if (pNode != NULL)
{
this->addChild(pNode);
}
pCCBReader->release();
initMenuItem();
SetVisibleBoard(m_pSpriteBoard);
bRet = true;
} while(0);
return bRet;
}
示例3: readCCB
void NBGCCBReader::readCCB(const char * ccbiName)
{
releaseMembers();
/* Create an autorelease NodeLoaderLibrary. */
NodeLoaderLibrary* ccNodeLoaderLibrary = NodeLoaderLibrary::newDefaultNodeLoaderLibrary();
/* Create an autorelease CCBReader. */
CCBReader* ccbReader = new CCBReader(ccNodeLoaderLibrary);
ccbReader->setCCBRootPath(CCBRESOURCES_BASE_PATH);
ccbReader->autorelease();
/* Read a ccbi file. */
m_pCCBNode = ccbReader->readNodeGraphFromFile(ccbiName, this);
if (m_pCCBNode != nullptr)
{
m_pAnimationManager = ccbReader->getAnimationManager();
m_pAnimationManager->setDelegate(this);
}
CC_SAFE_RETAIN(m_pCCBNode);
CC_SAFE_RETAIN(m_pAnimationManager);
}
示例4: init
bool BalloonResultDialog::init()
{
bool bRet = false;
do
{
CC_BREAK_IF(!DialogLayer::init());
// 加载ccbi
CCNodeLoaderLibrary* pLoaderLib = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();
CCBReader* pCCBReader = new CCBReader(pLoaderLib);
// 对应ccbi文件
std::string strCCBFileName = "BalloonResultDialog.ccbi";
// 得到第一个搜索路径
const std::vector<std::string> vSearchOrder = CCFileUtils::sharedFileUtils()->getSearchResolutionsOrder();
// 本程序中是对应的第一个元素即为对应的资源路径
std::string strCCBRootPath = vSearchOrder[0];
// 设置CCB的资源路径
pCCBReader->setCCBRootPath(strCCBRootPath.c_str());
CCNode* pNode = pCCBReader->readNodeGraphFromFile(strCCBFileName.c_str(), this);
if (pNode != NULL)
{
this->addChild(pNode);
}
pCCBReader->release();
initMenuTop();
pushMenu(m_pMenuShare);
// 设置按钮按下后变大的效果
ControlUtil::sharedControlUtil()->SetMenuItemSelectedImageWithNormalImage(m_pMenuShare);
/*
// 初始化位置
m_posOri = m_pSpriteResultBoard->getPosition();
CCPoint posUp = ccp(m_pSpriteResultBoard->getPositionX(), getContentSize().height*2);
// 进场动画
m_pSpriteResultBoard->setPosition(posUp);
addBoardChildWithAction(m_pSpriteResultBoard,
CCEaseBounceOut::create(CCMoveTo::create(0.5f, m_posOri)),
CCEaseExponentialIn::create(CCMoveTo::create(0.2f, posUp)));
SetVisibleBoard(NULL);
*/
m_pSpriteResultBoard->setScale(0.1f);
setOnEnterAction(CCEaseBounceOut::create(CCScaleTo::create(0.5f, 1.0f)));
setOnExitAction(CCEaseExponentialOut::create(CCScaleTo::create(0.3f, 0.1f)));
m_pMainBoard = m_pSpriteResultBoard;
// 更新分享按钮数据
m_posShareItemOri = m_pMenuItemShare->getPosition();
m_fShareItemAngleOri = m_pMenuItemShare->getRotation();
// 默认隐藏新记录标志
setNewFlagVisible(false);
initLabelTTF();
bRet = true;
} while(0);
return bRet;
}