本文整理汇总了C++中CCLayer::autorelease方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLayer::autorelease方法的具体用法?C++ CCLayer::autorelease怎么用?C++ CCLayer::autorelease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLayer
的用法示例。
在下文中一共展示了CCLayer::autorelease方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runThisTest
void DifficultyScene::runThisTest()
{
CCLayer *pLayer = new DifficultyLayer();
pLayer->autorelease();
addChild(pLayer);
CCDirector::sharedDirector()->replaceScene(CCTransitionSlideInT::create(0.5f, this));
}
示例2: restartZwoptexTest
CCLayer* restartZwoptexTest()
{
CCLayer* pLayer = createZwoptexLayer(sceneIdx);
pLayer->autorelease();
return pLayer;
}
示例3: restartAction
CCLayer* restartAction()
{
CCLayer* pLayer = createLayer(sceneIdx);
pLayer->autorelease();
return pLayer;
}
示例4: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize();
CCSize designSize = CCSizeMake(480, 320);
if (screenSize.height > 320)
{
CCSize resourceSize = CCSizeMake(960, 640);
CCFileUtils::sharedFileUtils()->setResourceDirectory("hd");
pDirector->setContentScaleFactor(resourceSize.height/designSize.height);
}
CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder);
// turn on display FPS
pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
CCScene * pScene = CCScene::create();
CCLayer * pLayer = new TestController();
pLayer->autorelease();
pScene->addChild(pLayer);
pDirector->runWithScene(pScene);
return true;
}
示例5: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView());
// turn on display FPS
//pDirector->setDisplayFPS(false);
pDirector->setDeviceOrientation(CCDeviceOrientationLandscapeLeft);
// set FPS. the default value is 1.0/60 if you don't call this
//pDirector->setAnimationInterval(1.0 / 60);
// CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder);
// turn on display FPS
// pDirector->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
//pDirector->setAnimationInterval(1.0 / 60);
// create a scene. it's an autorelease object
CCScene * pScene = CCScene::create();
CCLayer * pLayer = new TestController();
pLayer->autorelease();
pScene->addChild(pLayer);
pDirector->runWithScene(pScene);
//pDirector->runWithScene(HelloWorld::scene());
return true;
}
示例6: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView());
// turn on display FPS
//pDirector->setDisplayFPS(false);
pDirector->setDeviceOrientation(CCDeviceOrientationLandscapeLeft);
// set FPS. the default value is 1.0/60 if you don't call this
//pDirector->setAnimationInterval(1.0 / 60);
CCScene * pScene = CCScene::node();
CCLayer * pLayer = new TestController();
pLayer->autorelease();
pScene->addChild(pLayer);
// run
pDirector->runWithScene(pScene);
return true;
}
示例7: restartAction
static CCLayer* restartAction()
{
CCLayer* pLayer = (createFunctions[sceneIdx])();
pLayer->autorelease();
return pLayer;
}
示例8: RestartTest
CCLayer* RestartTest()
{
CCLayer* pLayer = CreateLayer(s_nActionIdx);
pLayer->autorelease();
return pLayer;
}
示例9: restartTestCase
CCLayer* restartTestCase()
{
CCLayer* pLayer = createTestCase(sceneIdx);
pLayer->autorelease();
return pLayer;
}
示例10: restartParallaxAction
CCLayer* restartParallaxAction()
{
CCLayer* pLayer = createParallaxTestLayer(sceneIdx);
pLayer->autorelease();
return pLayer;
}
示例11: createSchedulerTest
CCLayer* createSchedulerTest(int nIndex)
{
CCLayer* pLayer = NULL;
switch (nIndex)
{
case 0:
pLayer = new SchedulerAutoremove(); break;
case 1:
pLayer = new SchedulerPauseResume(); break;
case 2:
pLayer = new SchedulerUnscheduleAll(); break;
case 3:
pLayer = new SchedulerUnscheduleAllHard(); break;
case 4:
pLayer = new SchedulerSchedulesAndRemove(); break;
case 5:
pLayer = new SchedulerUpdate(); break;
case 6:
pLayer = new SchedulerUpdateAndCustom(); break;
case 7:
pLayer = new SchedulerUpdateFromCustom(); break;
default:
break;
}
pLayer->autorelease();
return pLayer;
}
示例12: restartEffectAdvanceAction
CCLayer* restartEffectAdvanceAction()
{
CCLayer* pLayer = createEffectAdvanceLayer(sceneIdx);
pLayer->autorelease();
return pLayer;
}
示例13: createTests
CCLayer *Restart()
{
CCLayer *pLayer = createTests(s_nIdx);
pLayer->autorelease();
return pLayer;
}
示例14: applicationDidFinishLaunching
bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView());
// enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices.
// pDirector->enableRetinaDisplay(true);
// sets opengl landscape mode
// tests set device orientation in RootViewController.mm
// pDirector->setDeviceOrientation(kCCDeviceOrientationLandscapeLeft);
// turn on display FPS
pDirector->setDisplayFPS(true);
// set FPS. the default value is 1.0/60 if you don't call this
pDirector->setAnimationInterval(1.0 / 60);
CCScene * pScene = CCScene::node();
CCLayer * pLayer = new TestController();
pLayer->autorelease();
pScene->addChild(pLayer);
//pDirector->runWithScene(HelloWorld::scene());
pDirector->runWithScene(pScene);
return true;
}
示例15: restartAction
static CCLayer* restartAction(void)
{
CCLayer* pLayer = createShaderLayer(sceneIdx);
pLayer->autorelease();
return pLayer;
}