http://pixijs.imtqy.com/examples/#/demos/dragging.js

Here is an example, take the hare by the edge of the ear and when moving its center will move to the place of the click, and how to drag relative to the position for which it hooked the mouse?

    1 answer 1

    Googled that I didn’t figure it out myself, in general we write when clicking

    this.sx = this.data.getLocalPosition(this).x * this.scale.x; this.sy = this.data.getLocalPosition(this).y * this.scale.y; 

    Then when moving

      this.x = newPosition.x - this.sx; this.y = newPosition.y - this.sy;