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


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

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


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

示例1: SetTouchable

void CardMgr::SetTouchable(bool b) {
  StageInfo& config = ConfigInfo::Instence().GetStageInfo(stage_id_);
  int size = config.card_count_;
  for(int i = 0; i < size; i++) {
    CCDirector* pDirector = CCDirector::sharedDirector();
    if(b) {
      CCLOG("settouchable true");
      pDirector->getTouchDispatcher()->addTargetedDelegate((TouchableSprite*)card_layer_->getChildByTag(i), 0, true);
    } else {
      CCLOG("settouchable false");
      pDirector->getTouchDispatcher()->removeDelegate((TouchableSprite*)card_layer_->getChildByTag(i));
    }
  }
}
开发者ID:f17qh,项目名称:crazyass,代码行数:14,代码来源:card_manager.cpp

示例2: showPopup

void GameScene::showPopup(cocos2d::ui::Layout* popup,bool isShow) {

    CCDirector* pDirector = CCDirector::sharedDirector();
    gameLayer->setVisible(!isShow);

    if(isShow) {
        pDirector->getTouchDispatcher()->removeDelegate(gameLayer);
        unschedule(schedule_selector(GameScene::onTimer));
    } else {
        pDirector->getTouchDispatcher()->addTargetedDelegate(gameLayer, 0, true);
        schedule(schedule_selector(GameScene::onTimer));
    }

    Utils::showPopup(popup,isShow);
}
开发者ID:meocondilonton,项目名称:game,代码行数:15,代码来源:GameScene.cpp

示例3: onExit

void FC_Intro::onExit()
{
	setKeypadEnabled(false);
	CCDirector* pDirector = CCDirector::sharedDirector();
	pDirector->getTouchDispatcher()->removeDelegate((CCTargetedTouchDelegate*)this);
	CCLayer::onExit();
}
开发者ID:faransae,项目名称:Classes,代码行数:7,代码来源:FC_Intro.cpp

示例4: onExit

void CocoRoomTodayCandy::onExit()
{
    //CCLog("CocoRoomTodayCandy :: onExit");
    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getTouchDispatcher()->removeDelegate(this);
    CCLayer::onExit();
}
开发者ID:playdandi,项目名称:CocoDrawingMagic,代码行数:7,代码来源:CocoRoomTodayCandy.cpp

示例5: onExit

void T_NoImage::onExit()
{
    CCLog("NoImage : onExit");
    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getTouchDispatcher()->removeDelegate(this);
    CCLayer::onExit();
}
开发者ID:playdandi,项目名称:CocoDrawingMagic,代码行数:7,代码来源:T_NoImage.cpp

示例6: onEnter

void T_NoImage::onEnter()
{
    CCLog("NoImage : onEnter");
    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getTouchDispatcher()->addTargetedDelegate(this, Depth::GetCurPriority(), true);
    CCLayer::onEnter();
}
开发者ID:playdandi,项目名称:CocoDrawingMagic,代码行数:7,代码来源:T_NoImage.cpp

示例7: onEnter

void FC_Block::onEnter()
{
	//CCLog( "onEnter Tag=%d", getTag() );
	CCDirector* pDirector = CCDirector::sharedDirector();
	pDirector->getTouchDispatcher()->addTargetedDelegate(this, 0, true);
	CCSprite::onEnter();
}
开发者ID:faransae,项目名称:Classes,代码行数:7,代码来源:FC_Block.cpp

示例8: onExit

void Loader::onExit()
{
    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getTouchDispatcher()->removeDelegate(this);
    
    Screen::onExit();
}
开发者ID:guozanhua,项目名称:project-birds,代码行数:7,代码来源:Loader.cpp

示例9: onEnter

void YJTabTitle::onEnter()
{
	CCNode::onEnter() ;

	CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getTouchDispatcher()->addTargetedDelegate(this, 0, true);
}
开发者ID:fengmm521,项目名称:qipaiproject,代码行数:7,代码来源:YJTabTitle.cpp

示例10: onEnter

void CJSScrollViewLayer::onEnter()
{
	CCLog("CJSScrollViewLayer::onEnter() tag(%d)",getTag());
	CCDirector* pDirector = CCDirector::sharedDirector();
	pDirector->getTouchDispatcher()->addTargetedDelegate((CCTargetedTouchDelegate *)this, 0, true);
	CCLayer::onEnter();
}
开发者ID:faransae,项目名称:Classes,代码行数:7,代码来源:JSScrollViewLayer.cpp

示例11: onExit

void Button::onExit()
{
    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getTouchDispatcher()->removeDelegate(this);
    
    Entity::onExit();
}
开发者ID:guozanhua,项目名称:project-birds,代码行数:7,代码来源:Button.cpp

示例12: init

bool ModalLayer::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }
    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getTouchDispatcher()->addTargetedDelegate(this, kCCMenuHandlerPriority, true);
    CCSize visibleSize = pDirector->getVisibleSize();
    CCSprite* frame = CCSprite::create("HelloWorld.png");
    frame->setPosition(ccp(visibleSize.width/2, visibleSize.height/2));
    this->addChild(frame);
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
                                                          "Send.png",
                                                          "SendHighlighted.png",
                                                          this,
                                                          menu_selector(ModalLayer::menuCloseCallback) );
    pCloseItem->setPosition(ccp(
                                visibleSize.width/2+frame->getContentSize().width/2-pCloseItem->getContentSize().width/2-10,
                                visibleSize.height/2+frame->getContentSize().height/2-pCloseItem->getContentSize().height/2-10));
    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition( CCPointZero );
    this->addChild(pMenu);
    return true;
}
开发者ID:Tetz,项目名称:cocos2dx_demo,代码行数:25,代码来源:ModalLayer.cpp

示例13: registerTargettedDelegate

void JSTouchDelegate::registerTargettedDelegate(int priority, bool swallowsTouches) {
    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getTouchDispatcher()->addTargetedDelegate(this,
                                                         priority,
                                                         swallowsTouches);

}
开发者ID:acc85,项目名称:cocos2d-x,代码行数:7,代码来源:cocos2d_specifics.cpp

示例14: onEnter

void GameObjHero::onEnter()
{
    CCNode::onEnter();
    this->setContentSize(CCSizeMake(85, 90));
    CCDirector *pDirector = CCDirector::sharedDirector();
    pDirector->getTouchDispatcher()->addTargetedDelegate(this, 0, true);
    CCSprite *obj = CCSprite::create("s_hurt.png");
    hurt = obj->getTexture();
    obj = CCSprite::create("s_jump.png");
    jump = obj->getTexture();
    mainsprite = CCSprite::create("s_1.png");
    //动画
    CCAnimation *animation = CCAnimation::create();
    animation->addSpriteFrameWithFileName("s_1.png");
    animation->addSpriteFrameWithFileName("s_2.png");
    animation->addSpriteFrameWithFileName("s_3.png");
    animation->addSpriteFrameWithFileName("s_4.png");
    animation->addSpriteFrameWithFileName("s_5.png");
    animation->addSpriteFrameWithFileName("s_6.png");
    animation->setDelayPerUnit(0.1f);
    animation->setRestoreOriginalFrame(true);
    //运行奔跑动画
    mainsprite->runAction(CCRepeatForever::create(CCAnimate::create(animation)));
    state = 0;
    addChild(mainsprite);
}
开发者ID:pandazheng,项目名称:LuoLiRunGame,代码行数:26,代码来源:GameObjHero.cpp

示例15: onExit

void RequestTopaz::onExit()
{
    //CCLog("RequestTopaz : onExit");
    CCDirector* pDirector = CCDirector::sharedDirector();
    pDirector->getTouchDispatcher()->removeDelegate(this);
    CCLayer::onExit();
}
开发者ID:playdandi,项目名称:CocoDrawingMagic,代码行数:7,代码来源:RequestTopaz.cpp


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