We have the following lists:
touches: A list of information for every finger currently touching the screentargetTouches: Like touches, but is filtered to only the information for finger touches that started out within the same nodechangedTouches: A list of information for every finger involved in the event
To better understand what might be in these lists, let’s go over some examples quickly. They vary according to the following rules:
- When I put a finger down, all three lists will have the same information. It will be in
changedTouchesbecause putting the finger down is what caused the event - When I put a second finger down,
toucheswill have two items, one for each finger.targetToucheswill have two items only if the finger was placed in the same node as the first finger.changedToucheswill have the information related to the second finger, because it’s what caused the event - If I put two fingers down at exactly the same time, it’s possible to have two items in
changedTouches, one for each finger - If I move my fingers, the only list that will change is
changedTouchesand will contain information related to as many fingers as have moved (at least one). - When I lift a finger, it will be removed from
touches,targetTouchesand will appear inchangedTouchessince it’s what caused the event - Removing my last finger will leave
touchesandtargetTouchesempty, andchangedToucheswill contain information for the last finger