Bandidos
Public Member Functions | List of all members
com.mygdx.game.touchinput.TouchInputHandler Class Reference
Inheritance diagram for com.mygdx.game.touchinput.TouchInputHandler:
com.mygdx.game.engine.events.EventDispatcher

Public Member Functions

 TouchInputHandler (int screenWidth, int screenHeight)
 
void setTouchScreenWidthHeight (int screenWidth, int screenHeight)
 
boolean keyDown (int keycode)
 
boolean keyUp (int keycode)
 
boolean keyTyped (char character)
 
boolean touchDown (int screenX, int screenY, int pointer, int button)
 
boolean touchUp (int screenX, int screenY, int pointer, int button)
 
boolean touchDragged (int screenX, int screenY, int pointer)
 
void setCurrentTouchLayer (int layer)
 
int getCurrentTouchLayer ()
 
float getX (int pointer)
 
float getY (int pointer)
 
float getX ()
 
float getY ()
 
boolean isTouched ()
 
boolean isTouched (int pointer)
 
boolean mouseMoved (int screenX, int screenY)
 
boolean scrolled (int amount)
 
void create ()
 
void resize (int width, int height)
 
void render ()
 
void pause ()
 
void resume ()
 
void dispose ()
 
- Public Member Functions inherited from com.mygdx.game.engine.events.EventDispatcher
void addEventListener (String type, IEventReceiver listeningClass)
 
void dispatchEvent (Event event)
 
void removeEventListener (String type, IEventReceiver listener)
 
boolean hasEventListener (String type)
 
ArrayList< ListenerItemgetAllListeners ()
 
void destroyAllListeners ()
 
void clean ()
 

Constructor & Destructor Documentation

◆ TouchInputHandler()

com.mygdx.game.touchinput.TouchInputHandler.TouchInputHandler ( int  screenWidth,
int  screenHeight 
)

The info for the touchInputHandler requires the screen size to calculate the position and bounds. WARNING: By resize the 'setTouchScreenWidthHeight' method should be called!

Parameters
screenWidthof the application
screenHeightof the application

Member Function Documentation

◆ create()

void com.mygdx.game.touchinput.TouchInputHandler.create ( )

◆ dispose()

void com.mygdx.game.touchinput.TouchInputHandler.dispose ( )

◆ getCurrentTouchLayer()

int com.mygdx.game.touchinput.TouchInputHandler.getCurrentTouchLayer ( )

Returns the touch layer in which all the touches occur. This can be used to make certain parts of the game 'Not intractable'

Returns
Touch layer as integer.

◆ getX() [1/2]

float com.mygdx.game.touchinput.TouchInputHandler.getX ( int  pointer)

◆ getX() [2/2]

float com.mygdx.game.touchinput.TouchInputHandler.getX ( )

◆ getY() [1/2]

float com.mygdx.game.touchinput.TouchInputHandler.getY ( int  pointer)

◆ getY() [2/2]

float com.mygdx.game.touchinput.TouchInputHandler.getY ( )

◆ isTouched() [1/2]

boolean com.mygdx.game.touchinput.TouchInputHandler.isTouched ( )

◆ isTouched() [2/2]

boolean com.mygdx.game.touchinput.TouchInputHandler.isTouched ( int  pointer)

◆ keyDown()

boolean com.mygdx.game.touchinput.TouchInputHandler.keyDown ( int  keycode)

◆ keyTyped()

boolean com.mygdx.game.touchinput.TouchInputHandler.keyTyped ( char  character)

◆ keyUp()

boolean com.mygdx.game.touchinput.TouchInputHandler.keyUp ( int  keycode)

◆ mouseMoved()

boolean com.mygdx.game.touchinput.TouchInputHandler.mouseMoved ( int  screenX,
int  screenY 
)

◆ pause()

void com.mygdx.game.touchinput.TouchInputHandler.pause ( )

◆ render()

void com.mygdx.game.touchinput.TouchInputHandler.render ( )

◆ resize()

void com.mygdx.game.touchinput.TouchInputHandler.resize ( int  width,
int  height 
)

◆ resume()

void com.mygdx.game.touchinput.TouchInputHandler.resume ( )

◆ scrolled()

boolean com.mygdx.game.touchinput.TouchInputHandler.scrolled ( int  amount)

◆ setCurrentTouchLayer()

void com.mygdx.game.touchinput.TouchInputHandler.setCurrentTouchLayer ( int  layer)

Sets the touch layer in which all the following touches will occur. This can be used to make certain parts of the game 'Not intractable'

Parameters
layerto set the following touches to.

◆ setTouchScreenWidthHeight()

void com.mygdx.game.touchinput.TouchInputHandler.setTouchScreenWidthHeight ( int  screenWidth,
int  screenHeight 
)

Sets the new screen size to calculate the position and bounds for the touches

Parameters
screenWidthof the application
screenHeightof the application

◆ touchDown()

boolean com.mygdx.game.touchinput.TouchInputHandler.touchDown ( int  screenX,
int  screenY,
int  pointer,
int  button 
)

◆ touchDragged()

boolean com.mygdx.game.touchinput.TouchInputHandler.touchDragged ( int  screenX,
int  screenY,
int  pointer 
)

◆ touchUp()

boolean com.mygdx.game.touchinput.TouchInputHandler.touchUp ( int  screenX,
int  screenY,
int  pointer,
int  button 
)

The documentation for this class was generated from the following file: