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
Input handler for the player for keyboard and touch (mouse) input.
This input handler only uses keyboard input.
-
Field Summary
Fields inherited from class com.csse3200.game.input.InputComponent
priority
-
Constructor Summary
ConstructorDescriptionTO 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. -
Method Summary
Methods inherited from class com.csse3200.game.input.InputComponent
create, dispose, fling, getPriority, keyDown, keyTyped, keyUp, longPress, mouseMoved, pan, panStop, pinch, pinchStop, pinchStopHandled, scrolled, setPriority, tap, touchDragged, touchUp, zoom
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
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 interfacecom.badlogic.gdx.InputProcessor
- Overrides:
touchDown
in classInputComponent
- 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 interfacecom.badlogic.gdx.input.GestureDetector.GestureListener
- Overrides:
touchDown
in classInputComponent
- Returns:
- whether the input was processed
- See Also:
-
GestureDetector.GestureListener.touchDown(float, float, int, int)
-