本文整理匯總了Java中com.badlogic.gdx.Input.Buttons.MIDDLE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Buttons.MIDDLE屬性的具體用法?Java Buttons.MIDDLE怎麽用?Java Buttons.MIDDLE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.badlogic.gdx.Input.Buttons
的用法示例。
在下文中一共展示了Buttons.MIDDLE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: touchDown
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button)
{
boolean processed = false;
if (_cityView != null)
{
processed = true;
}
if (button == Buttons.MIDDLE) // for drag-mode
{
_dragMode = true;
processed = true;
}
return processed;
}
示例2: touchUp
@Override
public boolean touchUp(int screenX, int screenY, int pointer, int button)
{
boolean processed = false;
if (_cityView != null)
{
processed = true;
}
if (button == Buttons.MIDDLE) // for drag-mode
{
_dragMode = false;
processed = true;
}
return processed;
}
示例3: touchDown
public boolean touchDown(int x, int y, int pointer, int button) {
touching = true;
camera.unproject(testPoint.set(x, y, 0));
testPoint2D.x = testPoint.x;
testPoint2D.y = testPoint.y;
if (button == Buttons.LEFT) {
if (!IS_DESKTOP) {
isRepulsing = true;
isAttracting = false;
} else {
isAttracting = false;
isRepulsing = false;
}
}
if (button == Buttons.RIGHT) {
isAttracting = true;
}
if (button == Buttons.MIDDLE) {
isRepulsing = true;
}
return false;
}
示例4: mouseDown
@Override
public ActionableRenderNode mouseDown(int screenX, int screenY, int pointer, int button) {
if (!isIncludedInRender()) {
return null;
}
if (button != Buttons.LEFT && button != Buttons.RIGHT && button != Buttons.MIDDLE) {
return null;
}
if (!element.isEnabled()) {
return null;
}
if (outerArea.contains(screenX, screenY)) {
setState(NodeState.ACTION);
return this;
}
return null;
}
示例5: getButtonPressed
/**
* Returns the last input that was pressed.
*
* @return an integer representing either Buttons.LEFT, Buttons.MIDDLE, or Buttons.RIGHT. -1 if not one of the buttons.
*/
private int getButtonPressed() {
if (Gdx.input.isButtonPressed(Buttons.LEFT))
return Buttons.LEFT;
else if (Gdx.input.isButtonPressed(Buttons.MIDDLE))
return Buttons.MIDDLE;
else if (Gdx.input.isButtonPressed(Buttons.RIGHT))
return Buttons.RIGHT;
return -1;
}
示例6: convertMouse
@VisibleForTesting
static KeyCode convertMouse(int button) {
switch (button) {
case Buttons.LEFT: return KeyCode.MOUSE_LEFT;
case Buttons.MIDDLE: return KeyCode.MOUSE_MIDDLE;
case Buttons.RIGHT: return KeyCode.MOUSE_RIGHT;
case Buttons.BACK: return KeyCode.MOUSE_BACK;
case Buttons.FORWARD: return KeyCode.MOUSE_FORWARD;
default:
LOG.warn("Unmapped mouse button: {}", button);
return KeyCode.UNKNOWN;
}
}
示例7: toGdxButton
private int toGdxButton (int button) {
if (button == 0) return Buttons.LEFT;
if (button == 1) return Buttons.RIGHT;
if (button == 2) return Buttons.MIDDLE;
if (button == 3) return Buttons.BACK;
if (button == 4) return Buttons.FORWARD;
return -1;
}
示例8: toLwjglButton
private int toLwjglButton (int button) {
switch (button) {
case Buttons.LEFT:
return 0;
case Buttons.RIGHT:
return 1;
case Buttons.MIDDLE:
return 2;
case Buttons.BACK:
return 3;
case Buttons.FORWARD:
return 4;
}
return 0;
}
示例9: toGdxButton
private int toGdxButton (int button) {
if (button == 0 || button == 1) return Buttons.LEFT;
if (button == 2) return Buttons.RIGHT;
if (button == 4) return Buttons.MIDDLE;
if (button == 8) return Buttons.BACK;
if (button == 16) return Buttons.FORWARD;
return -1;
}
示例10: getButtonString
private String getButtonString (int button) {
if (button == Buttons.LEFT) return "left";
if (button == Buttons.RIGHT) return "right";
if (button == Buttons.MIDDLE) return "middle";
if (button == Buttons.BACK) return "back";
if (button == Buttons.FORWARD) return "forward";
return "unknown";
}
示例11: touchUp
public boolean touchUp(int x, int y, int pointer, int button) {
touching = false;
if (!IS_DESKTOP) {
isRepulsing = false;
isAttracting = false;
}
if (button == Buttons.RIGHT) {
isAttracting = false;
}
if (button == Buttons.MIDDLE) {
isRepulsing = false;
}
return false;
}
示例12: touchUp
@Override
public boolean touchUp(int x, int y, int pointer, int button) {
touching = false;
// MPM Fluid interaction
mpmSolver.pressed = false;
if (!IS_DESKTOP) {
isRepulsing = false;
isAttracting = false;
}
if (button == Buttons.RIGHT) {
isAttracting = false;
}
if (button == Buttons.MIDDLE) {
isRepulsing = false;
}
// if a mouse joint exists we simply destroy it
if (mouseJoint != null) {
if (dragVelocity.len() > 1)
mouseJoint.getBodyB().setLinearVelocity(dragVelocity.scl(50000));
world.destroyJoint(mouseJoint);
mouseJoint = null;
}
hitBody = null;
dragVelocity.set(0, 0);
if (pointer == 2) {
emitType ++;
if (emitType > 3)
emitType = 1;
}
return false;
}
示例13: touchDown
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
mouseDown.set(screenX, screenY);
if (button == Buttons.MIDDLE) {
controllerTarget.set(controller.target);
cameraPos.set(camera.position);
middleDown = true;
Gdx.input.setCursorCatched(true);
}
return false;
}
示例14: touchUp
@Override
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
if (button == Buttons.MIDDLE) {
middleDown = false;
Gdx.input.setCursorCatched(false);
}
return false;
}
示例15: touchUp
@Override
public void touchUp (InputEvent event, float x, float y, int pointer, int button) {
if (button == Buttons.MIDDLE) {
resetZoom();
camera.position.x = getInputX();
camera.position.y = getInputY();
}
}