本文整理汇总了C++中CCActionInterval::setTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CCActionInterval::setTag方法的具体用法?C++ CCActionInterval::setTag怎么用?C++ CCActionInterval::setTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCActionInterval
的用法示例。
在下文中一共展示了CCActionInterval::setTag方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: focusChild
void DesignLayer::focusChild( cocos2d::CCSprite* pSprite )
{
float scaleValue = pSprite->getScale();
CCActionInterval* pAction = CCRepeatForever::create(
(CCActionInterval*)CCSequence::create(CCScaleTo::create(0.4f, scaleValue * 1.1f),
CCScaleTo::create(0.4f, scaleValue * 0.9f), NULL)
);
pSprite->runAction(pAction);
pAction->setTag(FocusActionTag);
}
示例2: deactivate
// When deactivated, establish an action sequence to first fade the adornment node
// back to fully transparent, and then explicitly hide the adornment. Although this
// last step is visually redundant, it makes subsequent drawing of the invisible
// adornment node more efficient. The action is tagged so that it can be easily found
// if it needs to be cancelled.
void CCNodeAdornmentOverlayFader::deactivate()
{
if ( _sprite )
{
_sprite->stopActionByTag( kFadeActionTag ); // Cancel any existing fade action
CCActionInterval* fadeAction = CCActionFadeOut::create( getActionDuration() );
CCFiniteTimeAction* hideAction = CCActionHide::create();
CCActionInterval* fadeThenHideAction = CCActionSequence::createWithTwoActions( fadeAction, hideAction );
fadeThenHideAction->setTag( kFadeActionTag );
_sprite->runAction( fadeThenHideAction );
}
}
示例3: onFrameEvent
void TestFrameEvent::onFrameEvent(cocos2d::extension::CCBone *bone, const char *evt, int originFrameIndex, int currentFrameIndex)
{
CCLOG("(%s) emit a frame event (%s) at frame index (%d).", bone->getName().c_str(), evt, currentFrameIndex);
if (!this->getActionByTag(FRAME_EVENT_ACTION_TAG) || this->getActionByTag(FRAME_EVENT_ACTION_TAG)->isDone())
{
this->stopAllActions();
CCActionInterval *action = CCShatteredTiles3D::create(0.2f, CCSizeMake(16,12), 5, false);
action->setTag(FRAME_EVENT_ACTION_TAG);
this->runAction(action);
}
}
示例4: onEnter
//------------------------------------------------------------------
//
// RemoveTest
//
//------------------------------------------------------------------
void RemoveTest::onEnter()
{
ActionManagerTest::onEnter();
CCSize s = CCDirector::sharedDirector()->getWinSize();
CCLabelTTF* l = CCLabelTTF::labelWithString("Should not crash", "Thonburi", 16);
addChild(l);
l->setPosition( CCPointMake(s.width/2, 245) );
CCMoveBy* pMove = CCMoveBy::actionWithDuration(2, CCPointMake(200, 0));
CCCallFunc* pCallback = CCCallFunc::actionWithTarget(this, callfunc_selector(RemoveTest::stopAction));
CCActionInterval* pSequence = (CCActionInterval*) CCSequence::actions(pMove, pCallback, NULL);
pSequence->setTag(kTagSequence);
CCSprite* pChild = CCSprite::spriteWithFile(s_pPathGrossini);
pChild->setPosition(CCPointMake(200, 200));
addChild(pChild, 1, kTagGrossini);
pChild->runAction(pSequence);
}