public class SquidMouse extends com.badlogic.gdx.InputAdapter
Modifier and Type | Field and Description |
---|---|
protected float |
cellHeight |
protected float |
cellWidth |
protected float |
gridHeight |
protected float |
gridWidth |
protected int |
offsetX |
protected int |
offsetY |
protected com.badlogic.gdx.InputProcessor |
processor |
Constructor and Description |
---|
SquidMouse(float cellWidth,
float cellHeight,
float gridWidth,
float gridHeight,
int offsetX,
int offsetY,
com.badlogic.gdx.InputProcessor processor)
Sets the size of the cell so that all mouse input can be evaluated as
relative to the grid.
|
SquidMouse(float cellWidth,
float cellHeight,
com.badlogic.gdx.InputProcessor processor)
Sets the size of the cell so that all mouse input can be evaluated as
relative to the grid.
|
Modifier and Type | Method and Description |
---|---|
float |
getCellHeight() |
float |
getCellWidth() |
float |
getGridHeight() |
float |
getGridWidth() |
int |
getOffsetX() |
int |
getOffsetY() |
com.badlogic.gdx.InputProcessor |
getProcessor()
Gets the InputProcessor this object uses to handle mouse input.
|
boolean |
mouseMoved(int screenX,
int screenY) |
boolean |
onGrid(int screenX,
int screenY) |
void |
reinitialize(float cellWidth,
float cellHeight) |
void |
reinitialize(float cellWidth,
float cellHeight,
float gridWidth,
float gridHeight,
int offsetX,
int offsetY) |
boolean |
scrolled(int amount) |
void |
setCellHeight(float cellHeight) |
void |
setCellWidth(float cellWidth) |
void |
setGridHeight(float gridHeight) |
void |
setGridWidth(float gridWidth) |
void |
setOffsetX(int offsetX) |
void |
setOffsetY(int offsetY) |
void |
setProcessor(com.badlogic.gdx.InputProcessor processor)
Sets the InputProcessor this object uses to handle mouse input.
|
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) |
protected int |
translateX(int screenX) |
protected int |
translateY(int screenY) |
protected float cellWidth
protected float cellHeight
protected float gridWidth
protected float gridHeight
protected int offsetX
protected int offsetY
protected com.badlogic.gdx.InputProcessor processor
public SquidMouse(float cellWidth, float cellHeight, com.badlogic.gdx.InputProcessor processor)
cellWidth
- cellHeight
- processor
- an InputProcessor that implements some of touchUp(), touchDown(), touchDragged(), mouseMoved(), or scrolled().public SquidMouse(float cellWidth, float cellHeight, float gridWidth, float gridHeight, int offsetX, int offsetY, com.badlogic.gdx.InputProcessor processor)
cellWidth
- cellHeight
- gridWidth
- gridHeight
- offsetX
- offsetY
- processor
- an InputProcessor that implements some of touchUp(), touchDown(), touchDragged(), mouseMoved(), or scrolled().public float getCellWidth()
public float getCellHeight()
public int getOffsetX()
public int getOffsetY()
public float getGridWidth()
public float getGridHeight()
public void setCellWidth(float cellWidth)
public void setCellHeight(float cellHeight)
public void setOffsetX(int offsetX)
public void setOffsetY(int offsetY)
public void setGridWidth(float gridWidth)
public void setGridHeight(float gridHeight)
public void reinitialize(float cellWidth, float cellHeight)
public void reinitialize(float cellWidth, float cellHeight, float gridWidth, float gridHeight, int offsetX, int offsetY)
public com.badlogic.gdx.InputProcessor getProcessor()
public void setProcessor(com.badlogic.gdx.InputProcessor processor)
processor
- an InputProcessor that implements some of touchUp(), touchDown(), touchDragged(), mouseMoved(), or scrolled().protected int translateX(int screenX)
protected int translateY(int screenY)
public boolean onGrid(int screenX, int screenY)
public boolean touchDown(int screenX, int screenY, int pointer, int button)
touchDown
in interface com.badlogic.gdx.InputProcessor
touchDown
in class com.badlogic.gdx.InputAdapter
public boolean touchUp(int screenX, int screenY, int pointer, int button)
touchUp
in interface com.badlogic.gdx.InputProcessor
touchUp
in class com.badlogic.gdx.InputAdapter
public boolean touchDragged(int screenX, int screenY, int pointer)
touchDragged
in interface com.badlogic.gdx.InputProcessor
touchDragged
in class com.badlogic.gdx.InputAdapter
public boolean mouseMoved(int screenX, int screenY)
mouseMoved
in interface com.badlogic.gdx.InputProcessor
mouseMoved
in class com.badlogic.gdx.InputAdapter
public boolean scrolled(int amount)
scrolled
in interface com.badlogic.gdx.InputProcessor
scrolled
in class com.badlogic.gdx.InputAdapter
Copyright © 2012–2016. All rights reserved.