当前位置: 首页>>代码示例>>C++>>正文


C++ CCActionInterval::setTag方法代码示例

本文整理汇总了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);
}
开发者ID:Whislly,项目名称:DreamBookToolbox,代码行数:10,代码来源:DesignLayer.cpp

示例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 );
	}
}
开发者ID:ClAndHHL,项目名称:cocos3d-x,代码行数:17,代码来源:CCNodeAdornments.cpp

示例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);
    }
}
开发者ID:76299500,项目名称:cocos2d-x,代码行数:14,代码来源:ArmatureScene.cpp

示例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);
}
开发者ID:9miao,项目名称:cocos2dx-win8,代码行数:26,代码来源:ActionManagerTest.cpp


注:本文中的CCActionInterval::setTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。