Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCMenu 设置为setTouchSwallowEnabled(false),还是无法向下传递 #526

Open
YinGuiWang opened this issue Mar 12, 2015 · 1 comment

Comments

@YinGuiWang
Copy link

在代码中
bool CCMenu::ccTouchBegan(CCTouch* touch, CCEvent* event)
{
CC_UNUSED_PARAM(event);
if (m_eState != kCCMenuStateWaiting || ! m_bVisible || !m_bEnabled)
{
setTouchSwallowEnabled(false);
return false;
}

for (CCNode *c = this->m_pParent; c != NULL; c = c->getParent())
{
    if (c->isVisible() == false)
    {
        setTouchSwallowEnabled(false);
        return false;
    }
}

m_pSelectedItem = this->itemForTouch(touch);
if (m_pSelectedItem)
{
    m_eState = kCCMenuStateTrackingTouch;
    m_pSelectedItem->selected();
    setTouchSwallowEnabled(true);   
    return true;
}
setTouchSwallowEnabled(false);
return false;

}

只要有被CCMenuItem获取过 又对CCMenu设置setTouchSwallowEnabled(true); 所以即使设置为 setTouchSwallowEnabled(false); 是不生效的

@hugohuang1111
Copy link
Contributor

@YinGuiWang
是说把CCMenu设置setTouchSwallowEnabled(true),然后再设置setTouchSwallowEnabled(false),CCMenu的表现就不一样了?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants