Class PopupMenuInputComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.input.InputComponent
com.csse3200.game.components.popupmenu.PopupMenuInputComponent
All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener, com.badlogic.gdx.InputProcessor

public class PopupMenuInputComponent extends InputComponent
Input handler for the player for keyboard and touch (mouse) input. This input handler only uses keyboard input.
  • Constructor Details

    • PopupMenuInputComponent

      public PopupMenuInputComponent()
      TO DO: This component's end goal is to send a deactivation trigger when the user clicks on anything other than the menu entity, and reactivate it if the user clicks on a tower, with the new tower's stats as per its config file. Current implementation step: trigger a generic event whenever the mouse is clicked, with no checks for the entity clicked on.
  • Method Details

    • touchDown

      public boolean touchDown(int screenX, int screenY, int pointer, int button)
      Triggers "popupEvent" when the mouse is clicked.
      Specified by:
      touchDown in interface com.badlogic.gdx.InputProcessor
      Overrides:
      touchDown in class InputComponent
      Returns:
      whether the input was processed
      See Also:
      • InputProcessor.touchDown(int, int, int, int)
    • touchDown

      public boolean touchDown(float screenX, float screenY, int pointer, int button)
      Triggers "popupEvent" when the mouse is clicked.
      Specified by:
      touchDown in interface com.badlogic.gdx.input.GestureDetector.GestureListener
      Overrides:
      touchDown in class InputComponent
      Returns:
      whether the input was processed
      See Also:
      • GestureDetector.GestureListener.touchDown(float, float, int, int)