本文整理匯總了Java中com.badlogic.gdx.Input.Buttons.RIGHT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Buttons.RIGHT屬性的具體用法?Java Buttons.RIGHT怎麽用?Java Buttons.RIGHT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.badlogic.gdx.Input.Buttons
的用法示例。
在下文中一共展示了Buttons.RIGHT屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: touchDown
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
anyKey = true;
if(button == Buttons.LEFT)
{
leftButton = true;
}
if(button == Buttons.RIGHT)
{
rightButton = true;
}
return false;
}
示例2: touchUp
@Override
public boolean touchUp(int screenX, int screenY, int pointer, int buttonCode) {
anyKey = false;
if(buttonCode == Buttons.LEFT)
{
leftButton = false;
}
if(buttonCode == Buttons.RIGHT)
{
rightButton = false;
}
return false;
}
示例3: handleDataClicked
@Override
public void handleDataClicked( Object data, InputEvent event, float x, float y )
{
Item item = (Item) data;
if ( event.getButton() == Buttons.RIGHT )
{
// show context menu:
// Unequip, use?, destory
Global.CurrentLevel.player.getInventory().removeItem( item );
Global.CurrentLevel.player.tile[ 0 ][ 0 ].items.add( item );
}
else
{
if ( item.getMainSlot() != null )
{
Global.CurrentLevel.player.getInventory().toggleEquip( item );
}
}
}
示例4: touchUp
@Override
public boolean touchUp(int screenX, int screenY, int pointer, int button) {
if (button == Buttons.LEFT) {
leftDown = false;
screenY = Gdx.graphics.getHeight() - screenY;
int mapX = (int) (screenX + RTSGame.getCamera().pos.x - RTSGame.getCamera().canvasWidth / 2);
int mapY = (int) (screenY + RTSGame.getCamera().pos.y - RTSGame.getCamera().canvasHeight / 2);
if (selection.active && selection.start.x != screenX && selection.start.y != screenY) {
selection.select();
selection.active = false;
} else {
selection.selectOrMove(mapX, mapY);
selection.active = false;
}
return true;
} else if (button == Buttons.RIGHT) {
selection.clearSelection();
selection.active = false;
return true;
}
return false;
}
示例5: 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;
}
示例6: touchUp
@Override
public void touchUp (InputEvent event, float x, float y, int pointer, int button) {
if (scene.getActiveLayer().locked) return;
currentTool.touchUp(event, x, y, pointer, button);
if (button == Buttons.RIGHT && mouseDragged == false) {
if (entitiesSelection.size() > 0) {
menuX = camera.getInputX();
menuY = camera.getInputY();
buildSelectedEntitiesPopupMenu();
entityPopupMenu.showMenu(event.getStage(), event.getStageX(), event.getStageY());
} else
generalPopupMenu.showMenu(event.getStage(), event.getStageX(), event.getStageY());
}
mouseDragged = false;
}
示例7: touchDown
@Override
public boolean touchDown(int x, int y, int pointer, int button) {
if (button == Buttons.LEFT) {
if (button == Buttons.LEFT) {
if (snapPoint == null) {
Vector2 newPoint = new Vector2(Engine.screenToWorld(x, y));
snapPoint = newPoint;
model.polygon.add(newPoint);
updateToUI();
}
}
} else if (button == Buttons.RIGHT) {
if (null != snapPoint) {
if (model.polygon.size() > 3) {
model.polygon.remove(snapPoint);
updateToUI();
}
}
}
return super.touchDown(x, y, pointer, button);
}
示例8: 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;
}
示例9: clicked
public boolean clicked (InputEvent inputEvent, Actor actor) {
if (actor instanceof Image) {
actor = ((Image)actor).getParent();
}
if (actor instanceof InventoryItemButton) {
InventoryItemButton clickedSlot = (InventoryItemButton)actor;
InventoryItem slotItem = clickedSlot.getItem();
InventoryItem draggedItem = UIManager.getDraggedItem();
InventoryContainer clickedContainer = clickedSlot.getInventory().getParentContainer();
boolean playersGroupItem = (draggedItem != null
&& draggedItem.isGroupHeldItem()
&& containerIsPlayerControlled(clickedContainer));
if (draggedItem != null && (slotItem == null || playersGroupItem)) {
putItemDown(clickedSlot, draggedItem, Buttons.RIGHT != inputEvent.getButton(), playersGroupItem);
return true;
} else if (slotItem != null && draggedItem == null) {
if (KeyBindings.MOVE_TO_JUNK.isPressed() && clickedContainer != GameState.getPlayerCharacterGroup()) {
moveToJunk(slotItem);
} else if (KeyBindings.MOVE_TO_INVENTORY.isPressed() && clickedContainer != displayedCharacter) {
moveToInventory(slotItem);
} else {
pickItemUp(clickedSlot, Buttons.RIGHT != inputEvent.getButton());
}
return true;
} else if (slotItem != null && draggedItem != null) {
if (Buttons.RIGHT == inputEvent.getButton() && draggedItem.isStackable(slotItem)) {
pickItemUp(clickedSlot, false);
} else {
swapOrCombineItems(clickedSlot, slotItem, draggedItem);
}
return true;
}
}
return false;
}
示例10: handleTargetSelection
public boolean handleTargetSelection(int button, Vector2 tileCoordinates) {
if (targetSelectionInProgress) {
if (!group.getGroupLeader().canSeeTile((int) tileCoordinates.x, (int) tileCoordinates.y)) {
return true;
}
if (Buttons.RIGHT == button) {
if (!waitingForClickConfirmation) {
stopTargetSelection(false);
} else {
waitingForClickConfirmation = false;
}
return true;
}
if (!waitingForClickConfirmation) {
targetType.setTarget((int) tileCoordinates.x, (int) tileCoordinates.y, gameState.getCurrentMap());
}
boolean validTarget = targetType.isValidTarget();
ClickConfirmationAction action = handleClickConfirmation(tileCoordinates, targetType);
if (action == ClickConfirmationAction.CONFIRM) {
if (!validTarget) {
waitingForClickConfirmation = false;
}
return true;
} else if (action == ClickConfirmationAction.CANCEL) {
stopTargetSelection(false);
return true;
}
if (validTarget) {
stopTargetSelection(true);
}
return true;
}
return false;
}
示例11: 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;
}
示例12: touchDown
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
if (button == Buttons.RIGHT) {
mRightMousePressed = true;
}
return super.touchDown(screenX, screenY, pointer, button);
}
示例13: mouseClicked
@Override
public boolean mouseClicked(int screenX, int screenY, int mouseButton)
{
if (mouseButton == Buttons.RIGHT) return rightClick(screenX, screenY, _playingField.getMapOffset());
else if (mouseButton == Buttons.LEFT) return leftClick(screenX, screenY, _playingField.getMapOffset());
return false;
}
示例14: mouseClicked
@Override
public boolean mouseClicked(int screenX, int screenY, int mouseButton)
{
if (mouseButton == Buttons.LEFT)
{
return leftClick(screenX, screenY, _playingField.getMapOffset());
}
else if (mouseButton == Buttons.RIGHT)
{
close();
return true;
}
return false;
}
示例15: 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;
}
}