Package com.deco2800.game.input
Class InputDecorator
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.input.InputComponent
com.deco2800.game.input.InputDecorator
- All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener,com.badlogic.gdx.InputProcessor
Generic class to wrap an InputProcessor so that it acts like an InputComponent. This was
initially created to wrap the stage in, but can be used for any class that implements
InputProcessor.
-
Field Summary
Fields inherited from class com.deco2800.game.input.InputComponent
priority -
Constructor Summary
ConstructorsConstructorDescriptionInputDecorator(com.badlogic.gdx.InputProcessor inputProcessor, int priority) -
Method Summary
Modifier and TypeMethodDescriptionbooleankeyDown(int keycode) booleankeyTyped(char character) booleankeyUp(int keycode) booleanmouseMoved(int screenX, int screenY) booleanscrolled(float amountX, float amountY) booleantouchDown(int screenX, int screenY, int pointer, int button) booleantouchDragged(int screenX, int screenY, int pointer) booleantouchUp(int screenX, int screenY, int pointer, int button) Methods inherited from class com.deco2800.game.input.InputComponent
create, dispose, fling, getPriority, longPress, pan, panStop, pinch, pinchStop, pinchStopHandled, setPriority, tap, touchDown, zoomMethods inherited from class com.deco2800.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
InputDecorator
public InputDecorator(com.badlogic.gdx.InputProcessor inputProcessor, int priority)
-
-
Method Details
-
keyDown
public boolean keyDown(int keycode) - Specified by:
keyDownin interfacecom.badlogic.gdx.InputProcessor- Overrides:
keyDownin classInputComponent- See Also:
-
InputProcessor.keyDown(int)
-
keyTyped
public boolean keyTyped(char character) - Specified by:
keyTypedin interfacecom.badlogic.gdx.InputProcessor- Overrides:
keyTypedin classInputComponent- See Also:
-
InputProcessor.keyTyped(char)
-
keyUp
public boolean keyUp(int keycode) - Specified by:
keyUpin interfacecom.badlogic.gdx.InputProcessor- Overrides:
keyUpin classInputComponent- See Also:
-
InputProcessor.keyUp(int)
-
mouseMoved
public boolean mouseMoved(int screenX, int screenY) - Specified by:
mouseMovedin interfacecom.badlogic.gdx.InputProcessor- Overrides:
mouseMovedin classInputComponent- See Also:
-
InputProcessor.mouseMoved(int, int)
-
scrolled
public boolean scrolled(float amountX, float amountY) - Specified by:
scrolledin interfacecom.badlogic.gdx.InputProcessor- Overrides:
scrolledin classInputComponent- See Also:
-
InputProcessor.scrolled(float, float)
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, int button) - Specified by:
touchDownin interfacecom.badlogic.gdx.InputProcessor- Overrides:
touchDownin classInputComponent- See Also:
-
InputProcessor.touchDown(int, int, int, int)
-
touchDragged
public boolean touchDragged(int screenX, int screenY, int pointer) - Specified by:
touchDraggedin interfacecom.badlogic.gdx.InputProcessor- Overrides:
touchDraggedin classInputComponent- See Also:
-
InputProcessor.touchDragged(int, int, int)
-
touchUp
public boolean touchUp(int screenX, int screenY, int pointer, int button) - Specified by:
touchUpin interfacecom.badlogic.gdx.InputProcessor- Overrides:
touchUpin classInputComponent- See Also:
-
InputProcessor.touchUp(int, int, int, int)
-