Exemplo n.º 1
0
void Pause::toggle(cocos2d::CCObject*){
	paused = !paused;
	SimpleAudioEngine::sharedEngine()->playEffect("buttonClick.wav");
	Game *g = Utils::getGame();
	if(paused==false){
		anim->unscheduleAllSelectors();
		anim->stopAllActions();
		anim->startAnimOut();
		g->setTouchEnabled(true);
		g->resumeSchedulerAndActions();
		SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
	}
	else{
		anim->unscheduleAllSelectors();
		anim->stopAllActions();
		anim->startAnimIn();
		g->setTouchEnabled(false);
		g->pauseSchedulerAndActions();
		SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
	}
	if(g->getChildren())
	for(int i=0;i<g->getChildren()->count();i++){
		CCNode *n = (CCNode *) g->getChildren()->objectAtIndex(i);
		if(!paused) n->resumeSchedulerAndActions();
		else n->pauseSchedulerAndActions();
	}
}
Exemplo n.º 2
0
void CCScrollView::pause(CCObject* sender)
{
    m_pContainer->pauseSchedulerAndActions();

    CCObject* pObj = NULL;
    CCArray* pChildren = m_pContainer->getChildren();

    CCARRAY_FOREACH(pChildren, pObj)
    {
        CCNode* pChild = (CCNode*)pObj;
        pChild->pauseSchedulerAndActions();
    }
Exemplo n.º 3
0
void XCCBReader::pause()
{
	CCBAnimationManager* mActionManager = getAnimationManager();
	mActionManager->getRootNode()->pauseSchedulerAndActions();

	CCDictionary* pDic = mActionManager->getNodeSequences();
	CCDictElement* pElement = NULL;
	CCDICT_FOREACH(pDic, pElement)
	{
		CCNode *node = (CCNode*)pElement->getIntKey();
		node->pauseSchedulerAndActions();
	}