本文整理汇总了C++中CCParticleSystem::setAnchorPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ CCParticleSystem::setAnchorPoint方法的具体用法?C++ CCParticleSystem::setAnchorPoint怎么用?C++ CCParticleSystem::setAnchorPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCParticleSystem
的用法示例。
在下文中一共展示了CCParticleSystem::setAnchorPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onNodeLoaded
void ccbLoginEDLayer::onNodeLoaded(cocos2d::CCNode * pNode, cocos2d::extension::CCNodeLoader * pNodeLoader)
{
s_pccbLoginEDLayer = this;
m_pPrizeBoard = pNode->getChildByTag(102);
m_pBoard = pNode->getChildByTag(101);
m_pBoard->setZOrder(5);
CCSprite* pBG = CCSprite::create("tu16/zhuanpan/limian.png");
pBG->setPosition( CCPoint(d_iBgLocation) );
m_pBoard->addChild(pBG, -5);
m_pLayer = CSizeLayer::createWithSize(CCSize(424, 138/*800, 480*/));
m_pLayer->setPosition(ccp(106,160));
m_pBoard->addChild(m_pLayer, -1);
for (int i = 0; i < 2; i++ )
{
m_pBar[i] = CCSprite::create("tu16/zhuanpan/pao.png");
m_pBar[i]->setPosition( ccp(d_iBarX-i*d_iBar, d_iLocationY) );
m_pBar[i]->setAnchorPoint( ccp(0,0) );
m_pLayer->addChild(m_pBar[i], -2);
}
CCParticleSystem* pParticle = CCParticleSystemQuad::create("tu16/zhuanpan/beihou.plist");
pParticle->setAnchorPoint(ccp(0.5f, 0.5f));
pParticle->setPosition( CCPoint(d_iLocationX(1), 75) );
m_pLayer->addChild(pParticle, -2);
CCSprite* pSprite = CCSprite::create("tu16/zhuanpan/xuanzhong1.png");
CCArray* animFrames = CCArray::createWithCapacity(2);
{
CCSpriteFrame* frame = CCSpriteFrame::create("tu16/zhuanpan/xuanzhong1.png",CCRect(0, 0, d_iGridWH));
animFrames->addObject(frame);
}
{
CCSpriteFrame* frame = CCSpriteFrame::create("tu16/zhuanpan/xuanzhong2.png",CCRect(0, 0, d_iGridWH));
animFrames->addObject(frame);
}
CCAnimation* pAnimation = CCAnimation::createWithSpriteFrames(animFrames, 0.1f);
pSprite->runAction( CCRepeatForever::create(CCAnimate::create(pAnimation)) );
pSprite->setAnchorPoint(ccp(0.5f, 0.5f));
pSprite->setPosition( ccp(d_iLocationX(1), 75) );
m_pLayer->addChild(pSprite, -2);
//m_pStarAnimation->retain();
CCNode* pLoginDayBoard = pNode->getChildByTag(103);
for ( int i = 0; i < 3 - AppDelegate::s_PrizeDayNum; i++ )
{
CCSprite* pSprite = CCSprite::create("tu16/an.png");
pSprite->setPosition(ccp(_DayX[i], _DayY[i]));
pLoginDayBoard->addChild(pSprite);
}
if ( AppDelegate::s_WeaponOwn[7] )
{//以后
CCSprite* pSprite2 = CCSprite::create("tu16/qian.png");
pSprite2->setPosition(ccp(141, 70));
pLoginDayBoard->addChild(pSprite2);
CCSprite* pSprite1 = CCSprite::create("tu16/jiangli500.png");
pSprite1->setPosition(ccp(141, 180));
pLoginDayBoard->addChild(pSprite1);
}
else
{//第一次
CCSprite* pSprite3 = CCSprite::create("tu16/qiang1.png");
//CCScaleTo* pAction1 = CCScaleTo::create(0.5f, 0.8f);
//CCScaleTo* pAction2 = CCScaleTo::create(0.2f, 1.0f);
//pSprite3->runAction( CCRepeatForever::create(CCSequence::create(pAction1, pAction2, NULL)) );
pSprite3->setPosition(ccp(141, 70));
pLoginDayBoard->addChild(pSprite3);
CCSprite* pSprite2 = CCSprite::create("tu16/qiang2.png");
pSprite2->setAnchorPoint(ccp(0.8f, 0.2f));
CCScaleTo* pAction1 = CCScaleTo::create(0.5f, 1.3f);
CCScaleTo* pAction2 = CCScaleTo::create(0.2f, 1.0f);
CCDelayTime* pAction3 = CCDelayTime::create(1.5f);
pSprite2->runAction( CCRepeatForever::create(CCSequence::create(pAction1, pAction2, pAction3, NULL)) );
pSprite2->setPosition(ccp(168, 33));
pLoginDayBoard->addChild(pSprite2);
CCSprite* pSprite1 = CCSprite::create("tu16/santian.png");
pSprite1->setPosition(ccp(145, 180));
pLoginDayBoard->addChild(pSprite1);
}
{
CCNodeLoaderLibrary* ccNodeLoaderLibrary = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();
ccNodeLoaderLibrary->registerCCNodeLoader("ccbGetPrizeLayer", ccbGetPrizeLayerLoader::loader());
cocos2d::extension::CCBReader* ccbReader = new cocos2d::extension::CCBReader(ccNodeLoaderLibrary);
m_pGetPrize = (ccbGetPrizeLayer*)ccbReader->readNodeGraphFromFile("23.ccbi"/*, this*/);
m_pGetPrize->setAnimationManager(ccbReader->getAnimationManager());
m_pGetPrize->setPosition(ccp(0,0));
addChild(m_pGetPrize, 5);
ccbReader->release();
}
setVisible(false);
}