dist/melonjs.js
function distanceToPoint(v) {
         var a = this.getBounds(); // the me.Vector2d object also implements the same function, but
         // we have to use here the center of both entities

         var dx = a.pos.x + a.width / 2 - v.x;
         var dy = a.pos.y + a.height / 2 - v.y;
         return Math.sqrt(dx * dx + dy * dy);
       }
function distanceToPoint(v) {
         var a = this.getBounds(); // the me.Vector2d object also implements the same function, but
         // we have to use here the center of both entities

         var dx = a.pos.x + a.width / 2 - v.x;
         var dy = a.pos.y + a.height / 2 - v.y;
         return Math.sqrt(dx * dx + dy * dy);
       }
function distanceToPoint ( v ) { var a = this . getBounds ( ) ; // the me.Vector2d object also implements the same function, but // we have to use here the center of both entities var dx = a . pos . x + a . width / 2 - v . x ; var dy = a . pos . y + a . height / 2 - v . y ; return Math . sqrt ( dx * dx + dy * dy ) ; }
return the distance to the specified point
@name distanceToPoint
@memberOf me.Entity
@function
@param {me.Vector2d} vector vector
@return {Number} distance
return the distance to the specified point