Package com.csse3200.game.input
Class DropInputComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.input.InputComponent
com.csse3200.game.input.DropInputComponent
- All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener
,com.badlogic.gdx.InputProcessor
-
Field Summary
Fields inherited from class com.csse3200.game.input.InputComponent
priority
-
Constructor Summary
ConstructorDescriptionDropInputComponent
(com.badlogic.gdx.graphics.Camera camera) Constructor for the DropInputComponent -
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, touchDown, touchDragged, touchUp, zoom
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
DropInputComponent
public DropInputComponent(com.badlogic.gdx.graphics.Camera camera) Constructor for the DropInputComponent- Parameters:
camera
- the camera to be used, this is the camera that the game is rendered with
-
-
Method Details
-
getCamera
public com.badlogic.gdx.graphics.Camera getCamera()Getter for the camera- Returns:
- the camera
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, int button) When the mouse is clicked, this method is called. It checks if the mouse is clicked on a drop entity and if it is, it adds the value of the drop to the scrap- Specified by:
touchDown
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
touchDown
in classInputComponent
- Parameters:
screenX
- The x coordinate, origin is in the upper left cornerscreenY
- The y coordinate, origin is in the upper left cornerpointer
- the pointer for the event.button
- the button- Returns:
- See Also:
-
InputProcessor.touchDown(int, int, int, int)
-