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


C++ CCDirector::getActionManager方法代码示例

本文整理汇总了C++中CCDirector::getActionManager方法的典型用法代码示例。如果您正苦于以下问题:C++ CCDirector::getActionManager方法的具体用法?C++ CCDirector::getActionManager怎么用?C++ CCDirector::getActionManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCDirector的用法示例。


在下文中一共展示了CCDirector::getActionManager方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: unpause

void PauseTest::unpause(float dt)
{
    unschedule( schedule_selector(PauseTest::unpause) );
    CCNode* node = getChildByTag( kTagGrossini );
    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getActionManager()->resumeTarget(node);
}
开发者ID:grsomani,项目名称:TestCpp,代码行数:7,代码来源:ActionManagerTest.cpp

示例2: onEnter

void PauseTest::onEnter()
{
    //
    // This test MUST be done in 'onEnter' and not on 'init'
    // otherwise the paused action will be resumed at 'onEnter' time
    //
    ActionManagerTest::onEnter();
    
    CCSize s = CCDirector::sharedDirector()->getWinSize();

    CCLabelTTF* l = CCLabelTTF::create("After 5 seconds grossini should move", "Thonburi", 16);
    addChild(l);
    l->setPosition( CCPointMake(s.width/2, 245) );
    
    
    //
    // Also, this test MUST be done, after [super onEnter]
    //
    CCSprite* grossini = CCSprite::create(s_pPathGrossini);
    addChild(grossini, 0, kTagGrossini);
    grossini->setPosition( CCPointMake(200,200) );
    
    CCAction* action = CCMoveBy::create(1, CCPointMake(150,0));

    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getActionManager()->addAction(action, grossini, true);

    schedule( schedule_selector(PauseTest::unpause), 3); 
}
开发者ID:grsomani,项目名称:TestCpp,代码行数:29,代码来源:ActionManagerTest.cpp

示例3: CCComponentContainer

CCNode::CCNode(void)
: m_fRotationX(0.0f)
, m_fRotationY(0.0f)
, m_fScaleX(1.0f)
, m_fScaleY(1.0f)
, m_fVertexZ(0.0f)
, m_obPosition(CCPointZero)
, m_fSkewX(0.0f)
, m_fSkewY(0.0f)
, m_obAnchorPointInPoints(CCPointZero)
, m_obAnchorPoint(CCPointZero)
, m_obContentSize(CCSizeZero)
, m_sAdditionalTransform(CCAffineTransformMakeIdentity())
, m_pCamera(NULL)
// children (lazy allocs)
// lazy alloc
, m_pGrid(NULL)
, m_nZOrder(0)
, m_pChildren(NULL)
, m_pParent(NULL)
// "whole screen" objects. like Scenes and Layers, should set m_bIgnoreAnchorPointForPosition to true
, m_nTag(kCCNodeTagInvalid)
// userData is always inited as nil
, m_pUserData(NULL)
, m_pUserObject(NULL)
, m_pShaderProgram(NULL)
, m_eGLServerState(ccGLServerState(0))
, m_uOrderOfArrival(0)
, m_bRunning(false)
, m_bTransformDirty(true)
, m_bInverseDirty(true)
, m_bAdditionalTransformDirty(false)
, m_bVisible(true)
, m_bIgnoreAnchorPointForPosition(false)
, m_bReorderChildDirty(false)
, m_pComponentContainer(NULL)
// merge CCNodeRGBA
, m_displayedOpacity(255)
, m_realOpacity(255)
, m_isOpacityModifyRGB(false)
, m_displayedColor(ccWHITE)
, m_realColor(ccWHITE)
, m_cascadeColorEnabled(false)
, m_cascadeOpacityEnabled(false)
, m_drawOrder(0)
// touch
, m_bTouchCaptureEnabled(true)
, m_bTouchSwallowEnabled(true)
, m_bTouchEnabled(false)
, m_eTouchMode(kCCTouchesOneByOne)
{
    // set default scheduler and actionManager
    CCDirector *director = CCDirector::sharedDirector();
    m_pActionManager = director->getActionManager();
    m_pActionManager->retain();
    m_pScheduler = director->getScheduler();
    m_pScheduler->retain();
    m_pComponentContainer = new CCComponentContainer(this);
}
开发者ID:1085075003,项目名称:quick-cocos2d-x,代码行数:59,代码来源:CCNode.cpp

示例4: resumeGrossini

void ResumeTest::resumeGrossini(float time)
{
    this->unschedule(schedule_selector(ResumeTest::resumeGrossini));

    CCNode* pGrossini = getChildByTag(kTagGrossini);
    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getActionManager()->resumeTarget(pGrossini);
}
开发者ID:grsomani,项目名称:TestCpp,代码行数:8,代码来源:ActionManagerTest.cpp

示例5: onExit

void SchedulerUnscheduleAllHard::onExit()
{
    if(!m_bActionManagerActive) {
        // Restore the director's action manager.
        CCDirector* director = CCDirector::sharedDirector();
        director->getScheduler()->scheduleUpdateForTarget(director->getActionManager(), kCCPrioritySystem, false);
    }
}
开发者ID:524777134,项目名称:cocos2d-x,代码行数:8,代码来源:SchedulerTest.cpp

示例6: CCComponentContainer

CCNode::CCNode(void)
: m_fRotationX(0.0f)
, m_fRotationY(0.0f)
, m_fScaleX(1.0f)
, m_fScaleY(1.0f)
, m_fVertexZ(0.0f)
, m_obPosition(CCPointZero)
, m_fSkewX(0.0f)
, m_fSkewY(0.0f)
, m_obAnchorPointInPoints(CCPointZero)
, m_obAnchorPoint(CCPointZero)
, m_obContentSize(CCSizeZero)
, m_sAdditionalTransform(CCAffineTransformMakeIdentity())
, m_pCamera(NULL)
// children (lazy allocs)
// lazy alloc
, m_pGrid(NULL)
, m_nZOrder(0)
, m_pChildren(NULL)
, m_pParent(NULL)
// "whole screen" objects. like Scenes and Layers, should set m_bIgnoreAnchorPointForPosition to true
, m_nTag(kCCNodeTagInvalid)
// userData is always inited as nil
, m_pUserData(NULL)
, m_pUserObject(NULL)
, m_pUserObjectNR(NULL)
, m_pShaderProgram(NULL)
, m_eGLServerState(ccGLServerState(0))
, m_uOrderOfArrival(0)
, m_bRunning(false)
, m_bTransformDirty(true)
, m_bInverseDirty(true)
, m_bAdditionalTransformDirty(false)
, m_bVisible(true)
, m_bIgnoreAnchorPointForPosition(false)
, m_bReorderChildDirty(false)
, m_pComponentContainer(NULL)
, m_bInformDetach(false)
{
    // set default scheduler and actionManager
    CCDirector *director = CCDirector::sharedDirector();
    m_pActionManager = director->getActionManager();
    CC_SAFE_RETAIN(m_pActionManager);
    m_pScheduler = director->getScheduler();
    CC_SAFE_RETAIN(m_pScheduler);

    CCScriptEngineProtocol* pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
    m_eScriptType = pEngine != NULL ? pEngine->getScriptType() : kScriptTypeNone;
    m_pComponentContainer = new CCComponentContainer(this);
    memset(&m_nUpdateScriptHandler, 0, sizeof(ccScriptFunction));
    memset(&m_nScriptHandler, 0, sizeof(ccScriptFunction));
}
开发者ID:stubma,项目名称:cocos2dx-classical,代码行数:52,代码来源:CCNode.cpp

示例7:

NS_CC_BEGIN

CCNode::CCNode(void)
: m_fRotation(0.0f)
, m_fScaleX(1.0f)
, m_fScaleY(1.0f)
, m_fPositionZ(0.0f)
, m_obPosition(CCPointZero)
, m_fSkewX(0.0f)
, m_fSkewY(0.0f)
, m_obAnchorPointInPoints(CCPointZero)
, m_obAnchorPoint(CCPointZero)
, m_obContentSize(CCSizeZero)
, m_pCamera(NULL)
// children (lazy allocs)
// lazy alloc
, m_pGrid(NULL)
, m_nZOrder(0)
, m_pChildren(NULL)
, m_pParent(NULL)
// "whole screen" objects. like Scenes and Layers, should set m_bIgnoreAnchorPointForPosition to false
, m_nTag(kCCNodeTagInvalid)
, m_pUserObject(NULL)
, m_pShaderProgram(NULL)
, m_eGLServerState(ccGLServerState(0))
, m_bRunning(false)
, m_bTransformDirty(true)
, m_bInverseDirty(true)
, m_bVisible(true)
, m_bIgnoreAnchorPointForPosition(false)
, m_bReorderChildDirty(false)
, m_nScriptHandler(0)
, m_nUpdateScriptHandler(0)
{
    // set default scheduler and actionManager
    CCDirector *director = CCDirector::sharedDirector();
    m_pActionManager = director->getActionManager();
    m_pActionManager->retain();
    m_pScheduler = director->getScheduler();
    m_pScheduler->retain();

    CCScriptEngineProtocol* pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
    m_eScriptType = pEngine != NULL ? pEngine->getScriptType() : kScriptTypeNone;
}
开发者ID:Roncon93,项目名称:Dorothy,代码行数:44,代码来源:CCNode.cpp

示例8: ccg

void Effect4::onEnter()
{
    EffectAdvanceTextLayer::onEnter();

    CCLens3D* lens = CCLens3D::create(ccp(100,180), 150, ccg(32,24), 10);
    CCActionInterval* move = CCJumpBy::create(5, ccp(380,0), 100, 4);
    CCActionInterval* move_back = move->reverse();
    CCActionInterval* seq = (CCActionInterval *)(CCSequence::create( move, move_back, NULL));

    /* In cocos2d-iphone, the type of action's target is 'id', so it supports using the instance of 'CCLens3D' as its target.
        While in cocos2d-x, the target of action only supports CCNode or its subclass,
        so we make an encapsulation for CCLens3D to achieve that.
    */

    CCDirector* director = CCDirector::sharedDirector();
    CCNode* pTarget = Lens3DTarget::create(lens);
    // Please make sure the target been added to its parent.
    this->addChild(pTarget);

    director->getActionManager()->addAction(seq, pTarget, false);
    this->runAction( lens );
}
开发者ID:ZheNanXu,项目名称:Billiard-2D,代码行数:22,代码来源:EffectsAdvancedTest.cpp

示例9: CCComponentContainer

CCNode::CCNode(void)
: m_fRotationX(0.0f)
, m_fRotationY(0.0f)
, m_fScaleX(1.0f)
, m_fScaleY(1.0f)
, m_fVertexZ(0.0f)
, m_obPosition(CCPointZero)
, m_fSkewX(0.0f)
, m_fSkewY(0.0f)
, m_obAnchorPointInPoints(CCPointZero)
, m_obAnchorPoint(CCPointZero)
, m_obContentSize(CCSizeZero)
, m_sAdditionalTransform(CCAffineTransformMakeIdentity())
, m_pCamera(NULL)
// children (lazy allocs)
// lazy alloc
, m_pGrid(NULL)
, m_nZOrder(0)
, m_pChildren(NULL)
, m_pParent(NULL)
// "whole screen" objects. like Scenes and Layers, should set m_bIgnoreAnchorPointForPosition to true
, m_nTag(kCCNodeTagInvalid)
// userData is always inited as nil
, m_pUserData(NULL)
, m_pUserObject(NULL)
, m_pShaderProgram(NULL)
, m_eGLServerState(ccGLServerState(0))
, m_uOrderOfArrival(0)
, m_bRunning(false)
, m_bTransformDirty(true)
, m_bInverseDirty(true)
, m_bAdditionalTransformDirty(false)
, m_bVisible(true)
, m_bIgnoreAnchorPointForPosition(false)
, m_bReorderChildDirty(false)
, m_nScriptHandler(0)
, m_nUpdateScriptHandler(0)
, m_pComponentContainer(NULL)
, m_bClipEnabled(false)
, m_oClipRect(CCRectZero)
, m_bTouchEnabled(false)
, m_bTouchChildren(true)
, m_drawOrder(0)
, m_pScriptTouchHandlerEntry(NULL)
,_displayedOpacity(255)
, _realOpacity(255)
, _displayedColor(ccWHITE)
, _realColor(ccWHITE)
, _cascadeColorEnabled(true)
, _cascadeOpacityEnabled(true)
{
    // set default scheduler and actionManager
    CCDirector *director = CCDirector::sharedDirector();
    m_pActionManager = director->getActionManager();
    m_pActionManager->retain();
    m_pScheduler = director->getScheduler();
    m_pScheduler->retain();

    CCScriptEngineProtocol* pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
    m_eScriptType = pEngine != NULL ? pEngine->getScriptType() : kScriptTypeNone;
    m_pComponentContainer = new CCComponentContainer(this);
}
开发者ID:imuzi,项目名称:MyApp,代码行数:62,代码来源:CCNode.cpp


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