本文整理匯總了Java中com.badlogic.gdx.Input.Buttons.LEFT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Buttons.LEFT屬性的具體用法?Java Buttons.LEFT怎麽用?Java Buttons.LEFT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.badlogic.gdx.Input.Buttons
的用法示例。
在下文中一共展示了Buttons.LEFT屬性的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: touchDown
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
if (PAUSED)
return false;
if (System.currentTimeMillis() - timeLastClick < 200) {
}
timeLastClick = System.currentTimeMillis();
boutonClicked = button;
if (button == Buttons.LEFT) {
ship.attack();
}
return true;
}
示例4: touchUp
@Override
public boolean touchUp (int screenX, int screenY, int pointer, int button) {
boolean result = false;
if (button == Buttons.LEFT) {
if (pickConstraint != null) {
((btDynamicsWorld)world.collisionWorld).removeConstraint(pickConstraint);
pickConstraint.dispose();
pickConstraint = null;
result = true;
}
if (pickedBody != null) {
pickedBody.forceActivationState(Collision.ACTIVE_TAG);
pickedBody.setDeactivationTime(0f);
pickedBody = null;
}
}
return result ? result : super.touchUp(screenX, screenY, pointer, button);
}
示例5: mouseClicked
@Override
public boolean mouseClicked(int screenX, int screenY, int mouseButton)
{
super.mouseClicked(screenX, screenY, mouseButton);
// Check for drag-mode:
if (isMouseOnWindow(screenX, screenY)
&& mouseButton == Buttons.LEFT)
{
_dragMode = true;
_oldMousePos = new Point(screenX, screenY);
closeIfNeeded(screenX, screenY, mouseButton);
return true;
}
return false;
}
示例6: touchDown
@Override
public boolean touchDown(final int _screenX, final int _screenY, final int _pointer, final int _button) {
boolean processed = false;
if (_button == Buttons.LEFT) {
// TODO check if UI has been clicked
// do things if the cursor is in the visible area
if (FovWrapper.getInstance().isLit(mouseOverX, mouseOverY)) {
processed = toggleHighlightedActors();
}
if (!processed) {
processed = addPlayerWalkPath();
}
return processed;
}
return processed;
}
示例7: touchDown
@Override
public boolean touchDown(int x, int y, int pointer, int button) {
if (button == Buttons.LEFT) {
if (Click.NONE == click) {
secondPoint.set(Engine.screenToWorld(x, y));
click = Click.FIRST;
// do start
} else if (Click.FIRST == click) {
secondPoint.set(Engine.screenToWorld(x, y));
if (worldCenter.dst(secondPoint) > 0) {
model.radius = worldCenter.dst(secondPoint);
updateToUI();
click = Click.NONE;
// do end
}
}
}
return super.touchDown(x, y, pointer, button);
}
示例8: 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;
}
示例9: 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);
}
示例10: touchDown
@Override
public boolean touchDown(int x, int y, int pointer, int button) {
if (button == Buttons.LEFT) {
if (Click.NONE == click) {
secondPoint.set(Engine.screenToWorld(x, y));
click = Click.FIRST;
// do start
} else if (click == Click.FIRST) {
secondPoint.set(Engine.screenToWorld(x, y));
float width = secondPoint.x - worldCenter.x;
float height = secondPoint.y - worldCenter.y;
model.width = Math.abs(width) * 2;
model.height = Math.abs(height) * 2;
updateToUI();
click = Click.NONE;
// do end
}
}
return super.touchDown(x, y, pointer, button);
}
示例11: touchDown
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
if (pointer >= 10)
return true;
if (button != Buttons.LEFT)
return false;
mTime = Gdx.input.getCurrentEventTime();
if (mPointerDown++ == 0) {
mDownTime = getTime();
mType = MotionEvent.ACTION_DOWN;
} else {
mType = MotionEvent.ACTION_POINTER_DOWN;
}
mPointerX[pointer] = mCurX = screenX;
mPointerY[pointer] = mCurY = screenY;
mPointer = pointer;
//GdxMap.log.debug("down " + screenX + ":" + screenY
// + " / " + pointer + " " + mPointerDown
// + " " + (getTime() - mDownTime));
mMap.input.fire(null, this);
return true;
}
示例12: 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;
}
示例13: mouseDown
@Override
public ActionableRenderNode mouseDown(int screenX, int screenY, int pointer, int button) {
if (!isIncludedInRender()) {
return null;
}
if (button != Buttons.LEFT) {
return null;
}
if (!element.isEnabled()) {
return null;
}
if (outerArea.contains(screenX, screenY)) {
setState(NodeState.ACTION);
return this;
}
return null;
}
示例14: mouseDown
@Override
public ActionableRenderNode mouseDown(int screenX, int screenY, int pointer, int button) {
if (!isIncludedInRender()) {
return null;
}
if (button != Buttons.LEFT) {
return null;
}
if (!element.isEnabled()) {
return null;
}
if (outerArea.contains(screenX, screenY)) {
setState(NodeState.ACTION);
if (sliderPosition.contains(screenX - getContentRenderX(), screenY - getContentRenderY())) {
dragging = true;
} else {
dragging = false;
}
return this;
}
return null;
}
示例15: touchDown
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
if (checkProcessing() && button == Buttons.LEFT) {
Vector3 vec = camera.unproject(new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0));
selectionBegin = new Vector2(vec.x, vec.y);
return true;
}
return false;
}