Package com.csse3200.game.input
Class InputDecorator
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.input.InputComponent
com.csse3200.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.csse3200.game.input.InputComponent
priority
-
Constructor Summary
ConstructorDescriptionInputDecorator
(com.badlogic.gdx.InputProcessor inputProcessor, int priority) -
Method Summary
Modifier and TypeMethodDescriptionboolean
keyDown
(int keycode) boolean
keyTyped
(char character) boolean
keyUp
(int keycode) boolean
mouseMoved
(int screenX, int screenY) boolean
scrolled
(float amountX, float amountY) boolean
touchDown
(int screenX, int screenY, int pointer, int button) boolean
touchDragged
(int screenX, int screenY, int pointer) boolean
touchUp
(int screenX, int screenY, int pointer, int button) Methods inherited from class com.csse3200.game.input.InputComponent
create, dispose, fling, getPriority, longPress, pan, panStop, pinch, pinchStop, pinchStopHandled, setPriority, tap, touchDown, zoom
Methods inherited from class com.csse3200.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:
keyDown
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
keyDown
in classInputComponent
- See Also:
-
InputProcessor.keyDown(int)
-
keyTyped
public boolean keyTyped(char character) - Specified by:
keyTyped
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
keyTyped
in classInputComponent
- See Also:
-
InputProcessor.keyTyped(char)
-
keyUp
public boolean keyUp(int keycode) - Specified by:
keyUp
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
keyUp
in classInputComponent
- See Also:
-
InputProcessor.keyUp(int)
-
mouseMoved
public boolean mouseMoved(int screenX, int screenY) - Specified by:
mouseMoved
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
mouseMoved
in classInputComponent
- See Also:
-
InputProcessor.mouseMoved(int, int)
-
scrolled
public boolean scrolled(float amountX, float amountY) - Specified by:
scrolled
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
scrolled
in classInputComponent
- See Also:
-
InputProcessor.scrolled(float, float)
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, int button) - Specified by:
touchDown
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
touchDown
in classInputComponent
- See Also:
-
InputProcessor.touchDown(int, int, int, int)
-
touchDragged
public boolean touchDragged(int screenX, int screenY, int pointer) - Specified by:
touchDragged
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
touchDragged
in classInputComponent
- See Also:
-
InputProcessor.touchDragged(int, int, int)
-
touchUp
public boolean touchUp(int screenX, int screenY, int pointer, int button) - Specified by:
touchUp
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
touchUp
in classInputComponent
- See Also:
-
InputProcessor.touchUp(int, int, int, int)
-