MCPcopy Create free account
hub / github.com/melonjs/melonJS / dragStart

Method dragStart

packages/melonjs/src/renderable/draggable.js:79–86  ·  view source on GitHub ↗

* Gets called when the user starts dragging the entity * @param {object} e - the pointer event * @returns {boolean} false if the object is being dragged

(e)

Source from the content-addressed store, hash-verified

77 * @returns {boolean} false if the object is being dragged
78 */
79 dragStart(e) {
80 if (this.dragging === false) {
81 this.dragging = true;
82 this.grabOffset.set(e.gameX, e.gameY);
83 this.grabOffset.sub(this.pos);
84 return false;
85 }
86 }
87
88 /**
89 * Gets called when the user drags this entity around

Callers 1

initEventsMethod · 0.95

Calls 2

setMethod · 0.45
subMethod · 0.45

Tested by

no test coverage detected