當前位置: 首頁>>代碼示例>>Java>>正文


Java Buttons.MIDDLE屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:hauke96,項目名稱:METRO,代碼行數:18,代碼來源:PlayingField.java

示例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;
}
 
開發者ID:hauke96,項目名稱:METRO,代碼行數:18,代碼來源:PlayingField.java

示例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;
}
 
開發者ID:omgware,項目名稱:fluid-simulator-v2,代碼行數:22,代碼來源:FluidSimulatorSPH.java

示例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;
}
 
開發者ID:mini2Dx,項目名稱:mini2Dx,代碼行數:17,代碼來源:ButtonRenderNode.java

示例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;
}
 
開發者ID:jmrapp1,項目名稱:TerraLegion,代碼行數:14,代碼來源:InputController.java

示例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;
    }
}
 
開發者ID:anonl,項目名稱:nvlist,代碼行數:13,代碼來源:GdxInputAdapter.java

示例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;
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:8,代碼來源:JglfwInput.java

示例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;
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:15,代碼來源:LwjglInput.java

示例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;
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:8,代碼來源:AndroidMultiTouchHandler.java

示例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";
}
 
開發者ID:basherone,項目名稱:libgdxcn,代碼行數:8,代碼來源:InputTest.java

示例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;
}
 
開發者ID:omgware,項目名稱:fluid-simulator-v2,代碼行數:14,代碼來源:FluidSimulatorSPH.java

示例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;
}
 
開發者ID:omgware,項目名稱:fluid-simulator-v2,代碼行數:36,代碼來源:FluidSimulatorMPM.java

示例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;
}
 
開發者ID:Dakror,項目名稱:Vloxlands,代碼行數:12,代碼來源:Game.java

示例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;
}
 
開發者ID:Dakror,項目名稱:Vloxlands,代碼行數:8,代碼來源:Game.java

示例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();
	}
}
 
開發者ID:kotcrab,項目名稱:vis-editor,代碼行數:8,代碼來源:CameraModule.java


注:本文中的com.badlogic.gdx.Input.Buttons.MIDDLE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。