本文整理汇总了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));
}
}
}
示例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);
}
示例3: onExit
void FC_Intro::onExit()
{
setKeypadEnabled(false);
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->removeDelegate((CCTargetedTouchDelegate*)this);
CCLayer::onExit();
}
示例4: onExit
void CocoRoomTodayCandy::onExit()
{
//CCLog("CocoRoomTodayCandy :: onExit");
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->removeDelegate(this);
CCLayer::onExit();
}
示例5: onExit
void T_NoImage::onExit()
{
CCLog("NoImage : onExit");
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->removeDelegate(this);
CCLayer::onExit();
}
示例6: onEnter
void T_NoImage::onEnter()
{
CCLog("NoImage : onEnter");
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->addTargetedDelegate(this, Depth::GetCurPriority(), true);
CCLayer::onEnter();
}
示例7: onEnter
void FC_Block::onEnter()
{
//CCLog( "onEnter Tag=%d", getTag() );
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->addTargetedDelegate(this, 0, true);
CCSprite::onEnter();
}
示例8: onExit
void Loader::onExit()
{
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->removeDelegate(this);
Screen::onExit();
}
示例9: onEnter
void YJTabTitle::onEnter()
{
CCNode::onEnter() ;
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->addTargetedDelegate(this, 0, true);
}
示例10: onEnter
void CJSScrollViewLayer::onEnter()
{
CCLog("CJSScrollViewLayer::onEnter() tag(%d)",getTag());
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->addTargetedDelegate((CCTargetedTouchDelegate *)this, 0, true);
CCLayer::onEnter();
}
示例11: onExit
void Button::onExit()
{
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->removeDelegate(this);
Entity::onExit();
}
示例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;
}
示例13: registerTargettedDelegate
void JSTouchDelegate::registerTargettedDelegate(int priority, bool swallowsTouches) {
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->addTargetedDelegate(this,
priority,
swallowsTouches);
}
示例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);
}
示例15: onExit
void RequestTopaz::onExit()
{
//CCLog("RequestTopaz : onExit");
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->removeDelegate(this);
CCLayer::onExit();
}