Package com.prineside.tdi2.utils
Class InputMultiplexerExtended
java.lang.Object
com.prineside.tdi2.utils.InputMultiplexerExtended
- All Implemented Interfaces:
com.badlogic.gdx.InputProcessor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProcessor(int index, com.badlogic.gdx.InputProcessor processor) voidaddProcessor(com.badlogic.gdx.InputProcessor processor) voidclear()com.badlogic.gdx.utils.SnapshotArray<com.badlogic.gdx.InputProcessor>booleanbooleankeyDown(int keycode) Called when a key was pressedbooleankeyTyped(char character) Called when a key was typedbooleankeyUp(int keycode) Called when a key was releasedbooleanmouseMoved(int screenX, int screenY) Called when the mouse was moved without any buttons being pressed.voidremoveProcessor(int index) voidremoveProcessor(com.badlogic.gdx.InputProcessor processor) booleanscrolled(float amountX, float amountY) Called when the mouse wheel was scrolled.voidsetLogging(boolean logging) voidsetProcessors(com.badlogic.gdx.InputProcessor... processors) voidsetProcessors(com.badlogic.gdx.utils.Array<com.badlogic.gdx.InputProcessor> processors) intsize()booleantouchCancelled(int screenX, int screenY, int pointer, int button) Called when the touch gesture is cancelled.booleantouchDown(int screenX, int screenY, int pointer, int button) Called when the screen was touched or a mouse button was pressed.booleantouchDragged(int screenX, int screenY, int pointer) Called when a finger or the mouse was dragged.booleantouchUp(int screenX, int screenY, int pointer, int button) Called when a finger was lifted or a mouse button was released.
-
Constructor Details
-
InputMultiplexerExtended
public InputMultiplexerExtended() -
InputMultiplexerExtended
public InputMultiplexerExtended(com.badlogic.gdx.InputProcessor... processors)
-
-
Method Details
-
setLogging
public void setLogging(boolean logging) -
isLogging
public boolean isLogging() -
addProcessor
public void addProcessor(int index, com.badlogic.gdx.InputProcessor processor) -
removeProcessor
public void removeProcessor(int index) -
addProcessor
public void addProcessor(com.badlogic.gdx.InputProcessor processor) -
removeProcessor
public void removeProcessor(com.badlogic.gdx.InputProcessor processor) -
size
public int size()- Returns:
- the number of processors in this multiplexer
-
clear
public void clear() -
setProcessors
public void setProcessors(com.badlogic.gdx.InputProcessor... processors) -
setProcessors
public void setProcessors(com.badlogic.gdx.utils.Array<com.badlogic.gdx.InputProcessor> processors) -
getProcessors
public com.badlogic.gdx.utils.SnapshotArray<com.badlogic.gdx.InputProcessor> getProcessors() -
keyDown
public boolean keyDown(int keycode) Description copied from interface:com.badlogic.gdx.InputProcessorCalled when a key was pressed- Specified by:
keyDownin interfacecom.badlogic.gdx.InputProcessor- Parameters:
keycode- one of the constants inInput.Keys- Returns:
- whether the input was processed
-
keyUp
public boolean keyUp(int keycode) Description copied from interface:com.badlogic.gdx.InputProcessorCalled when a key was released- Specified by:
keyUpin interfacecom.badlogic.gdx.InputProcessor- Parameters:
keycode- one of the constants inInput.Keys- Returns:
- whether the input was processed
-
keyTyped
public boolean keyTyped(char character) Description copied from interface:com.badlogic.gdx.InputProcessorCalled when a key was typed- Specified by:
keyTypedin interfacecom.badlogic.gdx.InputProcessor- Parameters:
character- The character- Returns:
- whether the input was processed
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, int button) Description copied from interface:com.badlogic.gdx.InputProcessorCalled when the screen was touched or a mouse button was pressed. The button parameter will beInput.Buttons.LEFTon iOS.- Specified by:
touchDownin interfacecom.badlogic.gdx.InputProcessor- 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:
- whether the input was processed
-
touchUp
public boolean touchUp(int screenX, int screenY, int pointer, int button) Description copied from interface:com.badlogic.gdx.InputProcessorCalled when a finger was lifted or a mouse button was released. The button parameter will beInput.Buttons.LEFTon iOS.- Specified by:
touchUpin interfacecom.badlogic.gdx.InputProcessorpointer- the pointer for the event.button- the button- Returns:
- whether the input was processed
-
touchCancelled
public boolean touchCancelled(int screenX, int screenY, int pointer, int button) Description copied from interface:com.badlogic.gdx.InputProcessorCalled when the touch gesture is cancelled. Reason may be from OS interruption to touch becoming a large surface such as the user cheek). Relevant on Android and iOS only. The button parameter will beInput.Buttons.LEFTon iOS.- Specified by:
touchCancelledin interfacecom.badlogic.gdx.InputProcessorpointer- the pointer for the event.button- the button- Returns:
- whether the input was processed
-
touchDragged
public boolean touchDragged(int screenX, int screenY, int pointer) Description copied from interface:com.badlogic.gdx.InputProcessorCalled when a finger or the mouse was dragged.- Specified by:
touchDraggedin interfacecom.badlogic.gdx.InputProcessorpointer- the pointer for the event.- Returns:
- whether the input was processed
-
mouseMoved
public boolean mouseMoved(int screenX, int screenY) Description copied from interface:com.badlogic.gdx.InputProcessorCalled when the mouse was moved without any buttons being pressed. Will not be called on iOS.- Specified by:
mouseMovedin interfacecom.badlogic.gdx.InputProcessor- Returns:
- whether the input was processed
-
scrolled
public boolean scrolled(float amountX, float amountY) Description copied from interface:com.badlogic.gdx.InputProcessorCalled when the mouse wheel was scrolled. Will not be called on iOS.- Specified by:
scrolledin interfacecom.badlogic.gdx.InputProcessor- Parameters:
amountX- the horizontal scroll amount, negative or positive depending on the direction the wheel was scrolled.amountY- the vertical scroll amount, negative or positive depending on the direction the wheel was scrolled.- Returns:
- whether the input was processed.
-