-
Notifications
You must be signed in to change notification settings - Fork 174
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
Bubbling in touch events #89
Comments
This is an issue on more than just iOS. TOUCH_UP is emitted twice (not TOUCH_DOWN). The second (bubbles:false) event is dispatched within "Actor::_onGlobalTouchUpEvent". I can't make heads or tails of the intended logic within Actor involving _overred, _pressedButton, and _pressedOvered. I can't help but think this needs a bit of an overhaul. It seems to be designed around originally only supporting a single pointer perhaps? Each Actor maintaining its own mouse button state seems wrong in general. Why is this being done? |
It is known bug. example: void GameScene::onEvent(Event *ev)
{
if (ev->type == TouchEvent::TOUCH_UP && ev->bubbles == false)
{
someStuff();
}
} |
It is designed for multitouches. Thats why each actor has own state |
Yeah, but why is the state stored in each Actor? Why can't objects deriving from Actor register event handlers and deal with touch events normally on their own? It looks like the whole point of Actor keeping track of which pointer "overred" and "pressed" it is so it can register _onGlobalTouchMoveEvent and _onGlobalTouchUpEvent. Why are those handlers needed? And then _overred is a pointer_index and _pressedButton is an array of pointer_index. So the Actor code can only remember a single "pointer" that "overred" or "pressed" it (per button). That doesn't seem multi-touch compliant. TLDR: Why does Actor register touch event handlers at all? Why can't derived classes handle all the touch events as needed? |
On iOS simulator TOUCH_UP and MOVE events are emitted once, but TOUCH_DOWN is emitted twice (with bubbling: true, then bubbling: false).
Steps to reproduce:
The text was updated successfully, but these errors were encountered: