title: cocos2d disable touches to all other views
body: <p>Below is what I came up with. Wonder if there's easier way to do it.   </p>
  
  <p>Suppose I want only menu layer to be touchable while it's up.<br>
  I put invisible layer that will swallow touches.  </p>
  
  <pre><code>bool tNoTouchLayer::init()
  {
      if(!CCLayer::init()) {
          return false;
      }
  
      setIsTouchEnabled(true);
  
      return true;
  }
  
  void tNoTouchLayer::registerWithTouchDispatcher()
  {
      CCDirector::sharedDirector()-&gt;getTouchDispatcher()-&gt;addTargetedDelegate(this, 0, true);
  
  }
  
  bool tNoTouchLayer::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent)
  {
      return true;
  }
  </code></pre>
  
  <p>Now I can add the noTouchLayer before adding menu layer, and all touches would be stolen by noTouchLayer.  </p>