@davidejones88 You have to doit yourself.
I set the Layer to detect touches and swallows true by using the second parameter of
Also I set the touch priority to something higher than the
cc.Menupriority, because if there are some cc.Menu in the other layers behind the "popup layer", they will detect the touches before the Layer.
//in the init
this.setTouchPriority(cc.MENU_HANDLER_PRIORITY - 3);
And in the
onTouchBegan: function (touch, event)
var location = touch.getLocation();
return true; //claims the touch anyways
In this example if the user touch outside the "container" of the popup screen, the popup is closed, but if the touch is inside this "container", do nothing but claims the touch so no one else can receive it.
Also, I set the priority of the cc.Menu in this popup window to the same of the layer or higher.
Hope this clarify my approach, if you have any question don't hesitate to ask.