本文整理汇总了C++中Director::getActionManager方法的典型用法代码示例。如果您正苦于以下问题:C++ Director::getActionManager方法的具体用法?C++ Director::getActionManager怎么用?C++ Director::getActionManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Director
的用法示例。
在下文中一共展示了Director::getActionManager方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unpause
void PauseTest::unpause(float dt)
{
unschedule( schedule_selector(PauseTest::unpause) );
Node* node = getChildByTag( kTagGrossini );
Director* pDirector = Director::sharedDirector();
pDirector->getActionManager()->resumeTarget(node);
}
示例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();
LabelTTF* l = LabelTTF::create("After 5 seconds grossini should move", "Thonburi", 16);
addChild(l);
l->setPosition( ccp(VisibleRect::center().x, VisibleRect::top().y-75) );
//
// Also, this test MUST be done, after [super onEnter]
//
Sprite* grossini = Sprite::create(s_pPathGrossini);
addChild(grossini, 0, kTagGrossini);
grossini->setPosition(VisibleRect::center() );
Action* action = MoveBy::create(1, ccp(150,0));
Director* pDirector = Director::sharedDirector();
pDirector->getActionManager()->addAction(action, grossini, true);
schedule( schedule_selector(PauseTest::unpause), 3);
}
示例3:
Node::Node(void)
: _rotationX(0.0f)
, _rotationY(0.0f)
, _scaleX(1.0f)
, _scaleY(1.0f)
, _vertexZ(0.0f)
, _position(Point::ZERO)
, _skewX(0.0f)
, _skewY(0.0f)
, _anchorPointInPoints(Point::ZERO)
, _anchorPoint(Point::ZERO)
, _contentSize(Size::ZERO)
, _additionalTransformDirty(false)
, _transformDirty(true)
, _inverseDirty(true)
// children (lazy allocs)
// lazy alloc
, _ZOrder(0)
, _parent(nullptr)
// "whole screen" objects. like Scenes and Layers, should set _ignoreAnchorPointForPosition to true
, _tag(Node::INVALID_TAG)
// userData is always inited as nil
, _userData(nullptr)
, _userObject(nullptr)
, _shaderProgram(nullptr)
, _orderOfArrival(0)
, _running(false)
, _visible(true)
, _ignoreAnchorPointForPosition(false)
, _reorderChildDirty(false)
, _isTransitionFinished(false)
, _updateScriptHandler(0)
, _componentContainer(nullptr)
#if CC_USE_PHYSICS
, _physicsBody(nullptr)
#endif
, _displayedOpacity(255)
, _realOpacity(255)
, _displayedColor(Color3B::WHITE)
, _realColor(Color3B::WHITE)
, _cascadeColorEnabled(false)
, _cascadeOpacityEnabled(false)
{
// set default scheduler and actionManager
Director *director = Director::getInstance();
_actionManager = director->getActionManager();
_actionManager->retain();
_scheduler = director->getScheduler();
_scheduler->retain();
_eventDispatcher = director->getEventDispatcher();
_eventDispatcher->retain();
ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine();
_scriptType = engine != nullptr ? engine->getScriptType() : kScriptTypeNone;
kmMat4Identity(&_transform);
kmMat4Identity(&_inverse);
kmMat4Identity(&_additionalTransform);
}
示例4: resumeGrossini
void ResumeTest::resumeGrossini(float time)
{
this->unschedule(schedule_selector(ResumeTest::resumeGrossini));
Node* pGrossini = getChildByTag(kTagGrossini);
Director* pDirector = Director::sharedDirector();
pDirector->getActionManager()->resumeTarget(pGrossini);
}
示例5: ComponentContainer
Node::Node(void)
: _rotationX(0.0f)
, _rotationY(0.0f)
, _scaleX(1.0f)
, _scaleY(1.0f)
, _vertexZ(0.0f)
, _position(Point::ZERO)
, _skewX(0.0f)
, _skewY(0.0f)
, _anchorPointInPoints(Point::ZERO)
, _anchorPoint(Point::ZERO)
, _contentSize(Size::ZERO)
, _additionalTransform(AffineTransformMakeIdentity())
, _camera(NULL)
// children (lazy allocs)
// lazy alloc
, _grid(NULL)
, _ZOrder(0)
, _children(NULL)
, _parent(NULL)
// "whole screen" objects. like Scenes and Layers, should set _ignoreAnchorPointForPosition to true
, _tag(kNodeTagInvalid)
// userData is always inited as nil
, _userData(NULL)
, _userObject(NULL)
, _shaderProgram(NULL)
, _GLServerState(ccGLServerState(0))
, _orderOfArrival(0)
, _running(false)
, _transformDirty(true)
, _inverseDirty(true)
, _additionalTransformDirty(false)
, _visible(true)
, _ignoreAnchorPointForPosition(false)
, _reorderChildDirty(false)
, _isTransitionFinished(false)
, _updateScriptHandler(0)
, _componentContainer(NULL)
{
// set default scheduler and actionManager
Director *director = Director::getInstance();
_actionManager = director->getActionManager();
_actionManager->retain();
_scheduler = director->getScheduler();
_scheduler->retain();
ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine();
_scriptType = pEngine != NULL ? pEngine->getScriptType() : kScriptTypeNone;
_componentContainer = new ComponentContainer(this);
}