本文整理汇总了C++中CCBReader::autorelease方法的典型用法代码示例。如果您正苦于以下问题:C++ CCBReader::autorelease方法的具体用法?C++ CCBReader::autorelease怎么用?C++ CCBReader::autorelease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCBReader
的用法示例。
在下文中一共展示了CCBReader::autorelease方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createCCBReader
CCBReader* CCBProxy::createCCBReader()
{
CCNodeLoaderLibrary *ccNodeLoaderLibrary = CCNodeLoaderLibrary::sharedCCNodeLoaderLibrary();
CCBReader * pCCBReader = new CCBReader(ccNodeLoaderLibrary);
pCCBReader->autorelease();
return pCCBReader;
}
示例2: createCCBreader
CCBReader* CCBProxy::createCCBreader()
{
CCNodeLoaderLibrary *ccNodeLoaderLibrary = CCNodeLoaderLibrary::sharedCCNodeLoaderLibrary();
ccNodeLoaderLibrary->registerCCNodeLoader("", CCBLayerLoader::loader());
CCBReader * pCCBReader = new CCBReader(ccNodeLoaderLibrary);
pCCBReader->autorelease();
return pCCBReader;
}
示例3: createCCBReader
CCBReader* CCBProxy::createCCBReader()
{
NodeLoaderLibrary *ccNodeLoaderLibrary = NodeLoaderLibrary::getInstance();
ccNodeLoaderLibrary->registerNodeLoader("", CCBLayerLoader::loader());
CCBReader * pCCBReader = new CCBReader(ccNodeLoaderLibrary);
pCCBReader->autorelease();
return pCCBReader;
}
示例4: CCBReader
//void MapMenu1Layer::tableCB( CCObject* pObject )
//{
// CCMenuItemImage *mi = (CCMenuItemImage*)pObject;
// int tag = mi->getTag();
// switch (tag) {
// case 1:
// m_table1->setVisible(true);
// m_table2->setVisible(false);
// break;
// case 2:
// m_table1->setVisible(false);
// m_table2->setVisible(true);
// break;
// default:
// break;
// }
//}
void MapMenu1Layer::loadCCBFile(int i)
{
CCNodeLoaderLibrary::sharedCCNodeLoaderLibrary()->registerCCNodeLoader( "ReviewLayer", ReviewLayerLoader::loader());
CCBReader* reader = new CCBReader( CCNodeLoaderLibrary::sharedCCNodeLoaderLibrary() );
reader->autorelease();
char str[255];
sprintf(str,"wkszReview/ReviewLayer%d.ccbi",i);
CCNode* node = reader->readNodeGraphFromFile(str);
this->getParent()->addChild(node);
this->closeCB(NULL);
}
示例5: CCBReader
MenuScene *MenuSceneLoader::load()
{
CCNodeLoaderLibrary *lib = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();
lib->registerCCNodeLoader("MenuScene", MenuSceneLoader::loader());
CCBReader *reader = new CCBReader(lib);
reader->autorelease();
CCNode *node = reader->readNodeGraphFromFile("MenuScene.ccbi");
return (MenuScene*)node;
}
示例6: init
bool CPKDlg::init()
{
CCLayer::init();
m_pLeftPhoto = m_pRightPhoto = NULL ;
m_pDelegate = NULL ;
CCNodeLoaderLibrary* plib = CCNodeLoaderLibrary::sharedCCNodeLoaderLibrary();
CCBReader* pReader = new CCBReader(plib);
CCNode* pnode = pReader->readNodeGraphFromFile("PkDlg.ccbi",this);
pnode->setPosition(ccpMult(ccpFromSize(getContentSize()), 0.5)) ;
addChild(pnode) ;
m_pAnimate = pReader->getAnimationManager() ;
m_pAnimate->setDelegate(this);
pReader->autorelease() ;
return true ;
}
示例7: CCBReader
CCNode *CCBManage::loadCCB(const char * pCCBFileName, CCLayer * pCCLayer, const char * pCCNodeName, CCNodeLoader * pCCNodeLoader)
{
/* Create an autorelease CCNodeLoaderLibrary. */
CCNodeLoaderLibrary * ccNodeLoaderLibrary = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();
if(pCCNodeName != NULL && pCCNodeLoader != NULL) {
ccNodeLoaderLibrary->registerCCNodeLoader(pCCNodeName, pCCNodeLoader);
}
/* Create an autorelease CCBReader. */
CCBReader *ccbReader = new CCBReader(ccNodeLoaderLibrary);
ccbReader->autorelease();
/* Read a ccbi file. */
// Load the scene from the ccbi-file, setting this class as
// the owner will cause lblTestTitle to be set by the CCBReader.
// lblTestTitle is in the TestHeader.ccbi, which is referenced
// from each of the test scenes.
return ccbReader->readNodeGraphFromFile(pCCBFileName, pCCLayer);
}
示例8: 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);
}
示例9: setSpriteFromCcbi
bool CSpriteObject::setSpriteFromCcbi(const char* name)
{
// Create auto-release node loader
CCNodeLoaderLibrary* ccNodeLoaderLibrary = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();
// Create a CCBReader, auto release.
CCBReader * ccbReader = new CCBReader(ccNodeLoaderLibrary);
ccbReader->autorelease();
// Read a ccbi file, return a CCNode instance.
setInnerSprite(dynamic_cast<CCSprite*>(ccbReader->readNodeGraphFromFile(name, this)));
if (NULL == getInnerSprite())
{
return false;
}
ccbReader->getAnimationManager()->setDelegate(this);
setCCBReader(ccbReader);
return true;
}
示例10: js_CocosBuilder_create
bool js_CocosBuilder_create(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
NodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::getInstance();
ccNodeLoaderLibrary->registerNodeLoader("", JSLayerLoader::loader());
CCBReader * ret = new (std::nothrow) CCBReader(ccNodeLoaderLibrary);
ret->autorelease();
jsval jsret;
if (ret) {
// create a new js obj of that class
JS::RootedObject jsobj(cx, js_get_or_create_jsobject<cocosbuilder::CCBReader>(cx, ret));
jsret = OBJECT_TO_JSVAL(jsobj);
} else {
jsret = JSVAL_NULL;
}
args.rval().set(jsret);
return true;
}