title: Using input processor touchdown event to detect an object touch
body: <p>I want to collect coin on a touching the coin object.So i did like this.</p>
  
  <pre><code>if (Gdx.input.justTouched()) {
          touchPos.set(Gdx.input.getX(), Gdx.input.getY(), 0);
           game.camera.unproject(touchPos);
          for (int i = 0; i &lt; coins.length; i++) {
              Rectangle textureBounds = new Rectangle(coins[i].getX(), coins[i].getY(), coins[i].getWidth(),coins[i].getHeight());
  
  if (textureBounds.contains(touchPos.x, touchPos.y) &amp;&amp; !coins[i].isBreakBool() &amp;&amp; coins[i].isCoinVisible()) {
          //after touch something happens
              }
          }
  }
      }
  </code></pre>
  
  <p>I increments the score and everything is proper except the touch.I want to make the coin invisible/moving immediately after touching down.This is not happening with justTouched().</p>
  
  <p>So I want to use input processor touch down event for this.
  I have my input processor class with touch down event like this.</p>
  
  <pre><code>public class MyInputProcessor implements InputProcessor,GestureListener {
  
  
  public static boolean isTouchDown=false;
  public static boolean isTouchUp=false;
  public static boolean isTap=false;
  public static boolean isLongPress=false;
  public static boolean isFling=false;
  public static boolean isSwipeDown=false;
  public static boolean isSwipeUp=false;
  public static boolean isSwipeLeft=false;
  public static boolean isSwipeRight=false;
  
  public static boolean isZoomed=false;
  public static float zoomInitDist=0;
  public static float zoomDist=0;
  
  
  public MyInputProcessor() {
      // TODO Auto-generated constructor stub
       System.out.println("My Input Processor Created..");
  
  }
  
  public InputMultiplexer returnInput() {
      // TODO Auto-generated method stub
        InputMultiplexer im = new InputMultiplexer();
        GestureDetector gd = new GestureDetector(this);
        im.addProcessor(gd);
        im.addProcessor(this);
  
      return im;
  }
  
  @Override
  public boolean touchDown(float x, float y, int pointer, int button) {
      // TODO Auto-generated method stub
      this.isTouchDown=true;
      return true;
  }
  
  @Override
  public boolean tap(float x, float y, int count, int button) {
      // TODO Auto-generated method stub
      this.isTap=true;
      return true;
  }
  
  @Override
  public boolean longPress(float x, float y) {
      // TODO Auto-generated method stub
      this.isLongPress=true;
      return true;
  }
  
  @Override
  public boolean fling(float velocityX, float velocityY, int button) {
      // TODO Auto-generated method stub
      if(Math.abs(velocityX)&gt;Math.abs(velocityY)){
          if(velocityX&gt;0){
                  this.isSwipeRight=true;
          }else{
              this.isSwipeLeft=true;
          }
      }else{
          if(velocityY&gt;0){
               this.isSwipeDown=true;
          }else{                                  
                this.isSwipeUp=true;
          }
      }
      return true;
  }
  
  @Override
  public boolean pan(float x, float y, float deltaX, float deltaY) {
      // TODO Auto-generated method stub
      return true;
  }
  
  @Override
  public boolean panStop(float x, float y, int pointer, int button) {
      // TODO Auto-generated method stub
      return true;
  }
  
  @Override
  public boolean zoom(float initialDistance, float distance) {
      // TODO Auto-generated method stub
      this.isZoomed=true;
      this.zoomInitDist=initialDistance;
      this.zoomDist=distance;
      return true;
  }
  
  @Override
  public boolean pinch(Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2) {
      // TODO Auto-generated method stub
      return true;
  }
  
  @Override
  public void pinchStop() {
      // TODO Auto-generated method stub
  
  }
  
  @Override
  public boolean keyDown(int keycode) {
      // TODO Auto-generated method stub
      return true;
  }
  
  @Override
  public boolean keyUp(int keycode) {
      // TODO Auto-generated method stub
      return true;
  }
  
  @Override
  public boolean keyTyped(char character) {
      // TODO Auto-generated method stub
      return true;
  }
  
  @Override
  public boolean touchDown(int screenX, int screenY, int pointer, int button) {
      // TODO Auto-generated method stub
      return true;
  }
  
  @Override
  public boolean touchUp(int screenX, int screenY, int pointer, int button) {
      // TODO Auto-generated method stub
      return true;
  }
  
  @Override
  public boolean touchDragged(int screenX, int screenY, int pointer) {
      // TODO Auto-generated method stub
  
      return true;
  }
  
  @Override
  public boolean mouseMoved(int screenX, int screenY) {
      // TODO Auto-generated method stub
      return true;
  }
  
  @Override
  public boolean scrolled(int amount) {
      // TODO Auto-generated method stub
      return true;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Inside gameScreen class,</p>
  
  <pre><code>MyInputProcessor myInputProcessor = new MyInputProcessor();
      InputMultiplexer im = myInputProcessor.returnInput(stage);
      Gdx.input.setInputProcessor(im);
  </code></pre>
  
  <p>But I am confused of how to get this touch position on touchdown event of input processor.</p>