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


Java Buttons.RIGHT屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:Aeo-Informatik,項目名稱:Space-Bombs,代碼行數:17,代碼來源:KeyboardInputProcessor.java

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

示例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 );
		}
	}
}
 
開發者ID:infinity8,項目名稱:Roguelike,代碼行數:20,代碼來源:InventoryPanel.java

示例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;
}
 
開發者ID:langurmonkey,項目名稱:rts-engine,代碼行數:22,代碼來源:SelectionListener.java

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

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

示例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);
}
 
開發者ID:lycying,項目名稱:c2d-engine,代碼行數:21,代碼來源:PolygonHelper.java

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

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

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

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

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

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

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

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


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