本文整理汇总了C++中CCLayer::release方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLayer::release方法的具体用法?C++ CCLayer::release怎么用?C++ CCLayer::release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLayer
的用法示例。
在下文中一共展示了CCLayer::release方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TransitionsTestScene
void TestLayer1::restartCallback(CCObject* pSender)
{
CCScene* s = new TransitionsTestScene();
CCLayer* pLayer = new TestLayer2();
s->addChild(pLayer);
CCScene* pScene = createTransition(s_nSceneIdx, TRANSITION_DURATION, s);
s->release();
pLayer->release();
if (pScene)
{
CCDirector::sharedDirector()->replaceScene(pScene);
}
}
示例2: itm_startCallback
void GroupCustomization::itm_startCallback(CCObject* pSender)
{
int check = CheckGroupNames(m_GameMode);
//if exists fails move to fail page
if(check) pScrollLayer->moveToPage(check); else
{
CCScene* pScene = CCScene::node();
CCLayer* pLayer = new ActionLayer(m_GameMode,m_groups[0],m_groups[1],m_groups[2],m_groups[3]);
pScene->addChild(pLayer);
CCScene* s = CCTransitionFade::transitionWithDuration((1.2f), pScene);
pLayer->release();
CCDirector::sharedDirector()->replaceScene(s);
}
}
示例3: scene
CCScene* Loading::scene()
{
// 'scene' is an autorelease object
CCScene *scene = CCScene::create();
CCLayer* layer = NULL;
if(LevelSelect::getCurrentLevel() <= 6)
layer = new TutorialLoading(LevelSelect::getCurrentLevel()+1);
else
layer = new Loading();
// add layer as a child to scene
scene->addChild(layer);
layer->release();
return scene;
}
示例4: onEnter
void CocosGUITestScene::onEnter()
{
CCScene::onEnter();
CCMenuItemImage* image = CCMenuItemImage::create("CloseNormal.png", "CloseSelected.png", this, menu_selector(CocosGUITestScene::BackCallback));
CCMenu* pMenu =CCMenu::create(image, NULL);
pMenu->setPosition( CCPointZero );
image->setPosition( ccp( VisibleRect::right().x - 50, VisibleRect::top().y - 25) );
addChild(pMenu, 1);
CCLayer* pLayer = new CocosGUITestMainLayer();
addChild(pLayer);
pLayer->release();
}
示例5: TransitionsTestScene
void TestLayer2::nextCallback(NSObject* pSender)
{
s_nSceneIdx++;
s_nSceneIdx = s_nSceneIdx % MAX_LAYER;
CCScene* s = new TransitionsTestScene();
CCLayer* pLayer = new TestLayer1();
s->addChild(pLayer);
CCScene* pScene = createTransition(s_nSceneIdx, TRANSITION_DURATION, s);
s->release();
pLayer->release();
if (pScene)
{
CCDirector::sharedDirector()->replaceScene(pScene);
}
}
示例6: onEnter
void CustomParticleWidgetScene::onEnter()
{
CCScene::onEnter();
CCLayer* pLayer = new CustomParticleWidgetLayer();
addChild(pLayer);
pLayer->release();
CCLabelTTF* label = CCLabelTTF::create("Exit", "Arial", 20);
//#endif
CCMenuItemLabel* pMenuItem = CCMenuItemLabel::create(label, this, menu_selector(CustomParticleWidgetScene::BackCallback));
CCMenu* pMenu =CCMenu::create(pMenuItem, NULL);
pMenu->setPosition( CCPointZero );
pMenuItem->setPosition( ccp( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) );
addChild(pMenu, 1);
}
示例7: TransitionsTestScene
void TestLayer2::backCallback(CCObject* pSender)
{
s_nSceneIdx--;
int total = MAX_LAYER;
if( s_nSceneIdx < 0 )
s_nSceneIdx += total;
CCScene* s = new TransitionsTestScene();
CCLayer* pLayer = new TestLayer1();
s->addChild(pLayer);
CCScene* pScene = createTransition(s_nSceneIdx, TRANSITION_DURATION, s);
s->release();
pLayer->release();
if (pScene)
{
CCDirector::sharedDirector()->replaceScene(pScene);
}
}
示例8: scene
CCScene* HelloWorld::scene()
{
// 'scene' is an autorelease object
CCScene *scene = CCScene::create();
//const char *levelPath = CCFileUtils::sharedFileUtils()->fullPathForFilename("level0.xml").c_str();
std::string levelPath = CCFileUtils::sharedFileUtils()->getWritablePath() + kLevelName;
LevelFileHelper *lh ;
if (CCFileUtils::sharedFileUtils()->isFileExist(levelPath)) {
lh = new LevelFileHelper(levelPath.c_str());
}else{
lh = new LevelFileHelper( CCFileUtils::sharedFileUtils()->fullPathForFilename(kLevelName).c_str());
}
// add layer as a child to scene
CCLayer* layer = new HelloWorld(lh);
scene->addChild(layer);
layer->release();
return scene;
}
示例9: showCurrentTest
////////////////////////////////////////////////////////
//
// TouchesMainScene
//
////////////////////////////////////////////////////////
void TouchesMainScene::showCurrentTest()
{
CCLayer* pLayer = NULL;
switch (m_nCurCase)
{
case 0:
pLayer = new TouchesPerformTest1(true, TEST_COUNT, m_nCurCase);
break;
case 1:
pLayer = new TouchesPerformTest2(true, TEST_COUNT, m_nCurCase);
break;
}
s_nTouchCurCase = m_nCurCase;
if (pLayer)
{
CCScene* pScene = CCScene::node();
pScene->addChild(pLayer);
pLayer->release();
CCDirector::sharedDirector()->replaceScene(pScene);
}
}