diff --git a/src/input/CreateInteractiveObject.js b/src/input/CreateInteractiveObject.js index 10dcfde48..877eee8a6 100644 --- a/src/input/CreateInteractiveObject.js +++ b/src/input/CreateInteractiveObject.js @@ -38,6 +38,9 @@ var CreateInteractiveObject = function (gameObject, hitArea, hitAreaCallback) hitArea: hitArea, hitAreaCallback: hitAreaCallback, + // Has the dev specified their own shape, or is this bound to the texture size? + customHitArea: false, + localX: 0, localY: 0, diff --git a/src/input/InputPlugin.js b/src/input/InputPlugin.js index 5634ad24f..02ffda6e6 100644 --- a/src/input/InputPlugin.js +++ b/src/input/InputPlugin.js @@ -1764,6 +1764,7 @@ var InputPlugin = new Class({ var io = (!gameObject.input) ? CreateInteractiveObject(gameObject, shape, callback) : gameObject.input; + io.customHitArea = true; io.dropZone = dropZone; io.cursor = (useHandCursor) ? 'pointer' : cursor; diff --git a/src/input/typedefs/InteractiveObject.js b/src/input/typedefs/InteractiveObject.js index 1dfedd038..68ffda03c 100644 --- a/src/input/typedefs/InteractiveObject.js +++ b/src/input/typedefs/InteractiveObject.js @@ -11,6 +11,7 @@ * @property {Phaser.Cameras.Scene2D.Camera} camera - The most recent Camera to be tested against this Interactive Object. * @property {any} hitArea - The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle. * @property {Phaser.Input.Types.HitAreaCallback} hitAreaCallback - The 'contains' check callback that the hit area shape will use for all hit tests. + * @property {boolean} customHitArea - Was the hitArea for this Interactive Object created based on texture size (false), or a custom shape? (true) * @property {number} localX - The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @property {number} localY - The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position. * @property {(0|1|2)} dragState - The current drag state of this Interactive Object. 0 = Not being dragged, 1 = being checked for drag, or 2 = being actively dragged.