dist/melonjs.js
function normalizeEvent(event) {
       var pointer; // PointerEvent or standard Mouse event

       if (me.device.TouchEvent && event.changedTouches) {
         // iOS/Android Touch event
         for (var i = 0, l = event.changedTouches.length; i < l; i++) {
           var touchEvent = event.changedTouches[i];
           pointer = T_POINTERS.pop();
           pointer.setEvent(event, touchEvent.pageX, touchEvent.pageY, touchEvent.clientX, touchEvent.clientY, touchEvent.identifier);
           normalizedEvents.push(pointer);
         }
       } else {
         // Mouse or PointerEvent
         pointer = T_POINTERS.pop();
         pointer.setEvent(event, event.pageX, event.pageY, event.clientX, event.clientY, event.pointerId);
         normalizedEvents.push(pointer);
       } // if event.isPrimary is defined and false, return


       if (event.isPrimary === false) {
         return normalizedEvents;
       } // else use the first entry to simulate mouse event


       normalizedEvents[0].isPrimary = true;
       Object.assign(api.pointer, normalizedEvents[0]);
       return normalizedEvents;
     }
function normalizeEvent(event) {
       var pointer; // PointerEvent or standard Mouse event

       if (me.device.TouchEvent && event.changedTouches) {
         // iOS/Android Touch event
         for (var i = 0, l = event.changedTouches.length; i < l; i++) {
           var touchEvent = event.changedTouches[i];
           pointer = T_POINTERS.pop();
           pointer.setEvent(event, touchEvent.pageX, touchEvent.pageY, touchEvent.clientX, touchEvent.clientY, touchEvent.identifier);
           normalizedEvents.push(pointer);
         }
       } else {
         // Mouse or PointerEvent
         pointer = T_POINTERS.pop();
         pointer.setEvent(event, event.pageX, event.pageY, event.clientX, event.clientY, event.pointerId);
         normalizedEvents.push(pointer);
       } // if event.isPrimary is defined and false, return


       if (event.isPrimary === false) {
         return normalizedEvents;
       } // else use the first entry to simulate mouse event


       normalizedEvents[0].isPrimary = true;
       Object.assign(api.pointer, normalizedEvents[0]);
       return normalizedEvents;
     }
function normalizeEvent ( event ) { var pointer ; // PointerEvent or standard Mouse event if ( me . device . TouchEvent && event . changedTouches ) { // iOS/Android Touch event for ( var i = 0 , l = event . changedTouches . length ; i < l ; i ++ ) { var touchEvent = event . changedTouches [ i ] ; pointer = T_POINTERS . pop ( ) ; pointer . setEvent ( event , touchEvent . pageX , touchEvent . pageY , touchEvent . clientX , touchEvent . clientY , touchEvent . identifier ) ; normalizedEvents . push ( pointer ) ; } } else { // Mouse or PointerEvent pointer = T_POINTERS . pop ( ) ; pointer . setEvent ( event , event . pageX , event . pageY , event . clientX , event . clientY , event . pointerId ) ; normalizedEvents . push ( pointer ) ; } // if event.isPrimary is defined and false, return if ( event . isPrimary === false ) { return normalizedEvents ; } // else use the first entry to simulate mouse event normalizedEvents [ 0 ] . isPrimary = true ; Object . assign ( api . pointer , normalizedEvents [ 0 ] ) ; return normalizedEvents ; }
translate event coordinates
@ignore
translate event coordinates