title: how do I check if a circle shape is touched to apply actions to the shape e.g. change color of the shape or to update the score?
body: <p>So I am new to android games development and I have 4 CircleMapObjects which are yellow coloured I am using an InputProcessor to manage touch/click events. Now in the touchDown() method what I want is when a Circle is touched/clicked in the game (anywhere inside the circle ) then it should change to say the colour green. I am using the libgdx framework and am new to the framework, I have come across Actor however I've found that it draws rectangular shapes from looking at the API.</p>
  
  <p>The InputHandler class:</p>
  
  <pre><code>public class InputHandler implements InputProcessor {
  
  private Spot spot;
  
  
  public InputHandler(Spot spot){
  
      this.spot = spot;
  }
  
  @Override
  public boolean keyDown(int keycode) {
      // TODO Auto-generated method stub
      return false;
  }
  
  @Override
  public boolean keyUp(int keycode) {
      // TODO Auto-generated method stub
      return false;
  }
  
  @Override
  public boolean keyTyped(char character) {
      // TODO Auto-generated method stub
      return false;
  }
  
  @Override
  public boolean touchDown(int screenX, int screenY, int pointer, int button) {
  
      float distanceX = (float) Math.sqrt(Math.pow((spot.getSpots()[0].getCircle().x - (screenX)), 2));
      float distanceY = (float) Math.sqrt(Math.pow((spot.getSpots()[0].getCircle().y - (screenY)), 2));
  
      //Below is for testing purposes not to do with touching a circle but touching a particular 
      //region on the screen
      //float distance = distanceX + distanceY;
  //  System.out.println(distanceX);
  //  System.out.println(distanceY);
  //  System.out.println(spot.getSpots()[0].isVisible() + "" + "Color: " + spot.getSpots()[0].getColor());
      System.out.println("CLICKED: " + " x: " + screenX + " y: " + screenY);
  
              if (screenX &gt; 45 &amp;&amp; screenY &lt; 431)
              {
                  spot.getSpots()[0].setColor(Color.RED);
                  System.out.println("This works!");
              }
  
  
      return true;
  }
  
  @Override
  public boolean touchUp(int screenX, int screenY, int pointer, int button) {
      // TODO Auto-generated method stub
      return false;
  }
  
  @Override
  public boolean touchDragged(int screenX, int screenY, int pointer) {
      // TODO Auto-generated method stub
      return false;
  }
  
  @Override
  public boolean mouseMoved(int screenX, int screenY) {
      // TODO Auto-generated method stub
      return false;
  }
  
  @Override
  public boolean scrolled(int amount) {
      // TODO Auto-generated method stub
      return false;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The Spot class:</p>
  
  <pre><code>public class Spot {
  
  private float x;
  private float y;
  private float radius;
  
  //Use CircleMapObject instead?
  private CircleMapObject spot_1, spot_2, spot_3, spot_4;
  private CircleMapObject spotList[];
  
  private float elapsedTime;
  private int index;
  
  
  
  public Spot(float x, float y, float radius){
      this.x = x;
      this.y = y;
      this.radius = radius;
  
      //each spot initialised
      spot_1 = new CircleMapObject(x,y,radius);
      spot_2 = new CircleMapObject(x, y-228,radius);
      spot_3 = new CircleMapObject(x+440,y,radius);
      spot_4 = new CircleMapObject(x+440,y-228,radius);
  
      //spot list initialised
      spotList = new CircleMapObject[4];
  
      //adding the spots to the spotlist
      spotList[0] = spot_1;
      spotList[1] = spot_2;
      spotList[2] = spot_3;
      spotList[3] = spot_4;
  
      elapsedTime = 0.0f;
      index = 0;
  
  
  }
  
  public void update(float delta){
  
  
  } 
  </code></pre>
  
  <p>}</p>
  
  <p>The Gamescreen where the inputHandler is set:</p>
  
  <pre><code>public class GameScreen implements Screen {
  
  
  private GameWorld world;
  private GameRenderer render;
  
  private Spot spot;
  
  
  public GameScreen(){
  
      float screenWidth = Gdx.graphics.getWidth();
      float screenHeight = Gdx.graphics.getHeight();
      System.out.println("Screen width: " + screenWidth + ", " + "Screen height: " + screenHeight);
      float gameWidth = 136;
      float gameHeight = screenHeight / (screenWidth / gameWidth);
  
      world = new GameWorld();
      render = new GameRenderer(world);
  
      Gdx.input.setInputProcessor(new InputHandler(world.getSpot()));
  
  }
  </code></pre>
  
  <p>... (there's more code in the GameScreen class but this is the only reference of the InputHandler used in this class. This also applies to the rest of the code.)</p>