I noticed this code in the touch dispatcher:
[code] private void touchesBegan(MotionEvent event) {
if( dispatchEvents ) {
for( int ind = 0; ind < touchHandlers.size(); ind++ ) {
CCTouchHandler handler = touchHandlers.get(ind);
handler.ccTouchesBegan(event);
// if( handler.ccTouchesBegan(event) == kEventHandled )
// break;
}
}
}
[/code]
From what I understand, there are two things here that seem wrong: First, touch
delegates should be called in order of their priority (from low to high). The
priority is ignored here, and delegates are called in the order they were added
instead. Second, if a touch delegate returns kEventHandled then the touch
should not be forwarded to elements below (see code commented out).
In my game, I have a layer that's sitting on top of a button, and I want that
layer to receive all motion events, not the button below it. With the current
behavior (latest source version from git), I cannot do that because I have no
control over the flow of touch events.
Original issue reported on code.google.com by enno.reh...@gmail.com on 15 Apr 2011 at 5:32
Original issue reported on code.google.com by
enno.reh...@gmail.com
on 15 Apr 2011 at 5:32