dist/melonjs.js
function initEvents() {
         var self = this;
         /**
          * @ignore
          */

         this.mouseDown = function (e) {
           this.translatePointerEvent(e, Event.DRAGSTART);
         };
         /**
          * @ignore
          */


         this.mouseUp = function (e) {
           this.translatePointerEvent(e, Event.DRAGEND);
         };

         this.onPointerEvent("pointerdown", this, this.mouseDown.bind(this));
         this.onPointerEvent("pointerup", this, this.mouseUp.bind(this));
         this.onPointerEvent("pointercancel", this, this.mouseUp.bind(this));
         Event.subscribe(Event.POINTERMOVE, this.dragMove.bind(this));
         Event.subscribe(Event.DRAGSTART, function (e, draggable) {
           if (draggable === self) {
             self.dragStart(e);
           }
         });
         Event.subscribe(Event.DRAGEND, function (e, draggable) {
           if (draggable === self) {
             self.dragEnd(e);
           }
         });
       }
function initEvents() {
         var self = this;
         /**
          * @ignore
          */

         this.mouseDown = function (e) {
           this.translatePointerEvent(e, Event.DRAGSTART);
         };
         /**
          * @ignore
          */


         this.mouseUp = function (e) {
           this.translatePointerEvent(e, Event.DRAGEND);
         };

         this.onPointerEvent("pointerdown", this, this.mouseDown.bind(this));
         this.onPointerEvent("pointerup", this, this.mouseUp.bind(this));
         this.onPointerEvent("pointercancel", this, this.mouseUp.bind(this));
         Event.subscribe(Event.POINTERMOVE, this.dragMove.bind(this));
         Event.subscribe(Event.DRAGSTART, function (e, draggable) {
           if (draggable === self) {
             self.dragStart(e);
           }
         });
         Event.subscribe(Event.DRAGEND, function (e, draggable) {
           if (draggable === self) {
             self.dragEnd(e);
           }
         });
       }
function initEvents ( ) { var self = this ; /**
          * @ignore
          */ this . mouseDown = function ( e ) { this . translatePointerEvent ( e , Event . DRAGSTART ) ; } ; /**
          * @ignore
          */ this . mouseUp = function ( e ) { this . translatePointerEvent ( e , Event . DRAGEND ) ; } ; this . onPointerEvent ( "pointerdown" , this , this . mouseDown . bind ( this ) ) ; this . onPointerEvent ( "pointerup" , this , this . mouseUp . bind ( this ) ) ; this . onPointerEvent ( "pointercancel" , this , this . mouseUp . bind ( this ) ) ; Event . subscribe ( Event . POINTERMOVE , this . dragMove . bind ( this ) ) ; Event . subscribe ( Event . DRAGSTART , function ( e , draggable ) { if ( draggable === self ) { self . dragStart ( e ) ; } } ) ; Event . subscribe ( Event . DRAGEND , function ( e , draggable ) { if ( draggable === self ) { self . dragEnd ( e ) ; } } ) ; }
Initializes the events the modules needs to listen to
It translates the pointer events to me.events
in order to make them pass through the system and to make
this module testable. Then we subscribe this module to the
transformed events.
@name initEvents
@memberOf me.DraggableEntity
@function
Initializes the events the modules needs to listen to It translates the pointer events to me . events in order to make them pass through the system and to make this module testable . Then we subscribe this module to the transformed events .