title: How do I detect when the pointer is over a sprite while I'm dragging another sprite?
body: <p>In my update() function, I use pointerOver() to detect when the pointer is over a sprite.  This normally works fine.  However, if I happen to be dragging another sprite at the time, the pointerOver() function always returns false.</p>
  
  <p>I thought I'd work around it by getting the location of the pointer and comparing it with the location and bounds of my sprite, but the pointer location is always (-1, -1).</p>
  
  <p>Here's some example code to demonstrate the problem:</p>
  
  <pre><code>    var game = new Phaser.Game( 800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
      var triangle;
      var square;
      var isOver;
      var pointerX;
      var pointerY;
  
      function preload()
      {
          game.load.image( 'triangle', 'assets/triangle.png' );
          game.load.image( 'square', 'assets/square.png' );
      }
  
      function create()
      {
          triangle = game.add.sprite( 100, 100, "triangle" );
          triangle.inputEnabled = true;
          triangle.input.enableDrag( false, true );
  
          square = game.add.sprite( 100, 200, "square" );
          square.inputEnabled = true;
      }
  
      function update()
      {
          isOver = square.input.pointerOver() ? "Yes" : "No";
      }
  
      function render()
      {
          game.debug.text( "Mouse over square: " + isOver, 200, 100 );
          game.debug.text( "Pointer: (" + game.input.pointer1.x + ", " + game.input.pointer1.y + ")", 200, 116 );
      }
  </code></pre>
  
  <p>I found this post about using a sprite's input.priorityID: <a href="https://stackoverflow.com/questions/27650964/phaser-js-how-to-stop-event-propagationfiring-from-textbutton-events-oninputdo/27677913#27677913">Phaser JS how to stop event Propagation(firing) from textButton.events.onInputDown event to game.input.onDown event?</a></p>
  
  <p>Using the priorityID fixed it for when the triangle is on top the square and the triangle is not being dragged, but the problem remains when it's being dragged.</p>
  
  <p>How do I detect when the pointer is over a sprite, even when I'm dragging another sprite?</p>
  
  <p>Thanks.</p>