I use cocos2d-x 3.0 RC1 and I need the following: the topmost layer should get all the events, and should not propagate the events to the layers that are below the topmost layer. I don't know how I can do that. I have tried to figure out something with setTouchEnabled
and setSwallowTouches
but null result.
Please help. this is very important.
The only way I have found is to implement this:
the code above I wrote in init method of the layer. Also this:
When you return true in
onBoardTouchBegan
you “consume” touch, otherwise if layer don’t consume touches those touches are passed to next Layer by priority.