本文整理汇总了C++中CCLayer::init方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLayer::init方法的具体用法?C++ CCLayer::init怎么用?C++ CCLayer::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLayer
的用法示例。
在下文中一共展示了CCLayer::init方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nextAction
static CCLayer* nextAction()
{
sceneIdx++;
sceneIdx = sceneIdx % MAX_LAYER;
CCLayer* pLayer = (createFunctions[sceneIdx])();
pLayer->init();
pLayer->autorelease();
return pLayer;
}
示例2: backAction
static CCLayer* backAction()
{
sceneIdx--;
int total = MAX_LAYER;
if( sceneIdx < 0 )
sceneIdx += total;
CCLayer* pLayer = (createFunctions[sceneIdx])();
pLayer->init();
pLayer->autorelease();
return pLayer;
}
示例3: CCLayer
CCLayer *CCLayer::node()
{
CCLayer *pRet = new CCLayer();
if (pRet && pRet->init())
{
pRet->autorelease();
return pRet;
}
else
{
CC_SAFE_DELETE(pRet)
return NULL;
}
}
示例4: CCLayer
CCLayer *CCLayer::create()
{
CCLayer *pRet = new CCLayer();
if (pRet && pRet->init())
{
CC_SAFE_AUTORELEASE(pRet);
return pRet;
}
else
{
CC_SAFE_DELETE(pRet);
return NULL;
}
}
示例5: switch
CCLayer *createTests(int index)
{
CCLayer *pLayer = NULL;
switch(index)
{
case TEST_LOADSCENEEDITORFILE:
pLayer = new LoadSceneEdtiorFileTest();
break;
case TEST_SPIRTECOMPONENT:
pLayer = new SpriteComponentTest();
break;
case TEST_ARMATURECOMPONENT:
pLayer = new ArmatureComponentTest();
break;
case TEST_UICOMPONENT:
pLayer = new UIComponentTest();
break;
case TEST_TMXMAPCOMPONENT:
pLayer = new TmxMapComponentTest();
break;
case TEST_PARTICLECOMPONENT:
pLayer = new ParticleComponentTest();
break;
case TEST_EFEECTCOMPONENT:
pLayer = new EffectComponentTest();
break;
case TEST_BACKGROUNDCOMPONENT:
pLayer = new BackgroundComponentTest();
break;
case TEST_ATTRIBUTECOMPONENT:
pLayer = new AttributeComponentTest();
break;
case TEST_TRIGGER:
pLayer = new TriggerTest();
pLayer->init();
break;
default:
break;
}
return pLayer;
}