@Override public void onEmit (Event[] events) { // each event has an id which defines the interaction of which it is a part for (Event event : events) { // start a new interaction for this id if START and we don't already have one Interaction iact = activeIacts.get(event.id); if (iact == null && event.kind.isStart) { Layer hitLayer = LayerUtil.getHitLayer(root, scratch.set(event.x, event.y)); if (hitLayer != null) activeIacts.put(event.id, iact = new Interaction(hitLayer, bubble)); } // dispatch the event to the interaction if (iact != null) iact.dispatch(event); // if this is END or CANCEL, clear out the interaction for this id if (event.kind.isEnd) activeIacts.remove(event.id); } } }
public void onStart (Touch.Interaction iact) { iact.capture(); } });