title: clickListener not initializing correctly
body: <p>Sorry I am very new to Java and LibGDX however I'm having a problem.</p>
  
  <p>I have two buttons in my Pong game. If score1 or score2 equals 5, the game ends. This is done by making the ball and paddles move off screen then a method called drawButtonRematch and drawButtonMenu are initialized which draw the two buttons "REMATCH" and "MAIN MENU".</p>
  
  <p>I'm not sure why, but the clickListener for the rematch button only works WHILE you play the game (not when score1 or score2 = 5).</p>
  
  <p>In simpler terms, while you're playing the game (not when the score = 5) the rematch button is non existent but the clickListener is. If you click where the button should be, it makes the game rematch. So if the user were to accidentally click that area they would reset the game.</p>
  
  <p>Here is an image visualization:</p>
  
  <p><a href="http://imgur.com/a/n8F4l" rel="nofollow">http://imgur.com/a/n8F4l</a></p>
  
  <p>Here is my code. This is the button causing problems.</p>
  
  <pre><code>private void drawButtonRematch(float dt){
      final Texture texture = new Texture(Gdx.files.internal("Assets/buttonRematch.png"));
      texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
      Stage stage = new Stage();
      stage.clear();
      Image buttonRematch = new Image(texture);
      buttonRematch.setX(640-(buttonRematch.getWidth()/2));
      buttonRematch.setY(120);
      buttonRematch.setWidth(300);
      buttonRematch.setHeight(100);
  
  
      Gdx.input.setInputProcessor(stage);
  
      buttonRematch.addListener(new ClickListener() {
          public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
          {
              currentState = GameState.RESET;
              return true;
          }
      });
  </code></pre>
  
  <p>Here is the Main Menu button which does work. Literally the same as drawButtonRematch</p>
  
  <pre><code> private void drawButtonMenu(float dt) {
      final Texture texture = new Texture(Gdx.files.internal("Assets/buttonMenu.png"));
      texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
      Stage stage = new Stage();
      stage.clear();
  
      // Menu
      Image mainMenu = new Image(texture);
      mainMenu.setX(640-(mainMenu.getWidth()/2));
      mainMenu.setY(10);
      mainMenu.setWidth(300);
      mainMenu.setHeight(100);
  
      Gdx.input.setInputProcessor(stage);
  
      mainMenu.addListener(new ClickListener() {
          public boolean touchDown(InputEvent event, float x, float y, int pointer, int button)
          {
              currentState = GameState.MENU;
             return true;
          }
      });
  
  
  stage.addActor(mainMenu);
  stage.draw();
  }
  </code></pre>
  
  <p>Then finally in my game logic I have </p>
  
  <pre><code>    if(score1 == 5){
          drawWin(dt);
          paddle1.move(-1000, -1000);
          paddle2.move(-1000, -1000);
          ball.setVelocity(0, 0);
          ball.move(640, 50);
          drawButtonRematch(dt);
          drawButtonMenu(dt);
  
      }
      else if (score2 == 5){
          drawWin2(dt);
          paddle1.move(-1000, -1000);
          paddle2.move(-1000, -1000);
          ball.setVelocity(0, 0);
          ball.move(640, 50);
          drawButtonRematch(dt);
          drawButtonMenu(dt);
  
  
      }
  </code></pre>
  
  <p>I'm sorry if this is the worst code you have seen in your life, I only started with Java on 1st August! Thanks for any help.</p>