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


Java Buttons.LEFT屬性代碼示例

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

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

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

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

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

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

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

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

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

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

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

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

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


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