本文整理汇总了Java中com.badlogic.gdx.Input.Keys.ESCAPE属性的典型用法代码示例。如果您正苦于以下问题:Java Keys.ESCAPE属性的具体用法?Java Keys.ESCAPE怎么用?Java Keys.ESCAPE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.badlogic.gdx.Input.Keys
的用法示例。
在下文中一共展示了Keys.ESCAPE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onKeyPressed
public void onKeyPressed(UserEvent e) {
datapointer.playerinputconvertor.onKeyPressed(e);
switch (e.value) {
case Keys.ESCAPE:
parent.parent.substate = new InGameMenuState(parent.parent);
break;
case Keys.A:
activedcapacity = (byte) ((activedcapacity == 1 || datapointer.player.inventory
.getCapFromId((byte) 1) == null) ? 0 : 1);
break;
case Keys.Z:
activedcapacity = (byte) ((activedcapacity == 2 || datapointer.player.inventory
.getCapFromId((byte) 2) == null) ? 0 : 2);
break;
case Keys.E:
activedcapacity = (byte) ((activedcapacity == 3 || datapointer.player.inventory
.getCapFromId((byte) 3) == null) ? 0 : 3);
break;
}
}
示例2: Screen
public Screen(ScreenManager manager) {
this.manager = manager;
adapter = new InputAdapter() {
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.ESCAPE)
Gdx.app.exit();
keyPressed = true;
ScreenManager.multiplexer.removeProcessor(adapter);
return true;
}
};
ScreenManager.multiplexer.addProcessor(adapter);
}
示例3: keyDown
@Override
public boolean keyDown(InputEvent event, int keyCode) {
switch (keyCode) {
case Keys.ESCAPE:
Gdx.app.exit();
break;
case Keys.Z:
sizeScale = Math.max(0.1f, sizeScale - 0.1f);
break;
case Keys.X:
sizeScale += 0.1f;
break;
case Keys.C:
ParticleEffectManager.getInstance().clearLiveEffects();
break;
case Keys.D:
Globals.printDebugInfo = !Globals.printDebugInfo;
break;
}
return true;
}
示例4: keyDownEvent
/**
* @param keycode
* The code of the pressed key.
* @return True when handled, false otherwise.
*/
public boolean keyDownEvent(int keycode)
{
if (keycode == Keys.ESCAPE) // Show in game window if no input control and no other window is focused/open.
{
InGameMenuWindow.show(_settings);
}
else
{
_containerRenderer.notifyKeyPressed(keycode);
if (_gameScreenInputProcessor != null)
{
_gameScreenInputProcessor.keyDown(keycode);
}
}
return true;
}
示例5: keyUp
@Override
public boolean keyUp(int keycode) {
if (keycode == Keys.BACK || keycode == Keys.ESCAPE) {
if (currentScene == gameScene) {
if (gameManager.isGameActive()) {
setScene(ISceneManager.IntroScene);
}
}
else if (currentScene instanceof com.igorcrevar.goingunder.scenes.TutorialScene) {
setScene(ISceneManager.IntroScene);
}
else {
Gdx.app.exit();
}
return true;
}
return false;
}
示例6: keyDown
@Override
public boolean keyDown(int keycode) {
switch (keycode) {
case Keys.BACK:
return onBack();
case Keys.ESCAPE:
return onBack();
case Keys.MENU:
return onMenu();
case Keys.F1:
return onMenu();
}
return false;
}
示例7: keyUp
@Override
public boolean keyUp(int keycode) {
if (keycode == Keys.ESCAPE || (keycode == Keys.SPACE && PAUSED)) {
PAUSED = !PAUSED;
Gdx.input.setCursorCatched(!PAUSED);
} else if (keycode == Keys.F5) {
cameraMode++;
cameraMode = cameraMode % 3;
if (cameraMode == 2) {
cameraMode = 0;
}
} else if (keycode == Keys.F6) {
cameraMode = 2;
} else if (keycode == Keys.F11) {
ExterminateGame.fullscree = !ExterminateGame.fullscree;
ExterminateGame.updateFullscreen();
}
if (keycode == Keys.F3) {
InGame.showInfo = !InGame.showInfo;
}
if (keycode == Keys.F4) {
drawHitBox = !drawHitBox;
}
keys.remove(keycode, 0);
return true;
}
示例8: keyUp
@Override
public boolean keyUp(int keycode) {
if(keycode==Keys.ESCAPE)
{
Gdx.app.log("MainMenu", "quit");
if(Gdx.app.getType()!=ApplicationType.iOS)
Gdx.app.exit();
return true;
}
return false;
}
示例9: keyUp
@Override
public boolean keyUp(int keycode) {
if(keycode==Keys.ESCAPE || keycode==Keys.BACK)
{
Gdx.app.log("GameScreen", "quit");
game.switchToMainMenu();
return true;
}
return false;
}
示例10: keyUp
public boolean keyUp(int k) {
if(mode==0){
if(k == Keys.W || k == Keys.UP) MyInput.setKey(Input.UP, false);
if(k == Keys.A || k == Keys.LEFT) MyInput.setKey(Input.LEFT, false);
if(k == Keys.S || k == Keys.DOWN) MyInput.setKey(Input.DOWN, false);
if(k == Keys.D || k == Keys.RIGHT) MyInput.setKey(Input.RIGHT, false);
if(k == Keys.SPACE) MyInput.setKey(Input.JUMP, false);
if(k == Keys.Q || k == Keys.CONTROL_RIGHT) MyInput.setKey(Input.INTERACT, false);
if(k == Keys.E || k == Keys.NUMPAD_0) MyInput.setKey(Input.ATTACK, false);
if(k == Keys.SHIFT_LEFT) MyInput.setKey(Input.SPECIAL, false);
if(k == Keys.CONTROL_LEFT || k == Keys.Z) MyInput.setKey(Input.RUN, false);
if(k == Keys.R || k == Keys.NUMPAD_1) MyInput.setKey(Input.USE, false);
if(k == Keys.ESCAPE) MyInput.setKey(Input.PAUSE, false);
if(k == Keys.ENTER) MyInput.setKey(Input.ENTER, false);
if(k == Keys.TAB) MyInput.setKey(Input.RESPAWN, false);
if(k == Keys.NUMPAD_8 || k == Keys.U) MyInput.setKey(Input.DEBUG_UP, false);
if(k == Keys.NUMPAD_2 || k == Keys.J) MyInput.setKey(Input.DEBUG_DOWN, false);
if(k == Keys.NUMPAD_4 || k == Keys.I) MyInput.setKey(Input.DEBUG_LEFT, false);
if(k == Keys.NUMPAD_6 || k == Keys.O) MyInput.setKey(Input.DEBUG_RIGHT, false);
if(k == Keys.NUMPAD_7 || k == Keys.LEFT_BRACKET) MyInput.setKey(Input.DEBUG_LEFT2, false);
if(k == Keys.NUMPAD_9 || k == Keys.RIGHT_BRACKET) MyInput.setKey(Input.DEBUG_RIGHT2, false);
if(k == Keys.M) MyInput.setKey(Input.DEBUG_CENTER, false);
if(k == Keys.F1) MyInput.setKey(Input.COLLISION, false);
if(k == Keys.F2) MyInput.setKey(Input.LIGHTS, false);
if(k == Keys.F3) MyInput.setKey(Input.DEBUG_TEXT, false);
if(k == Keys.F4) MyInput.setKey(Input.RENDER, false);
if(k == Keys.EQUALS) MyInput.setKey(Input.ZOOM_IN, false);
if(k == Keys.MINUS) MyInput.setKey(Input.ZOOM_OUT, false);
} else {
if(k == Keys.ESCAPE){ MyInput.setKey(Input.PAUSE, false); }
if(k == Keys.SPACE){ MyInput.setKey(Input.JUMP, false); }
if(k == Keys.ENTER){ MyInput.setKey(Input.ENTER, false); }
if(k == Keys.LEFT){ MyInput.setKey(Input.LEFT, false); }
if(k == Keys.RIGHT){ MyInput.setKey(Input.RIGHT, false); }
if(Keys.toString(k).toLowerCase().equals("delete")){ MyInput.setKey(Input.DOWN, false); }
if(k == Keys.SHIFT_LEFT || k == Keys.SHIFT_RIGHT){ MyInput.setKey(Input.UP, false); }
}
return true;
}
示例11: keyDown
@Override
public boolean keyDown(int keycode) {
switch (keycode) {
case Keys.UP: {
// move protoman up
if (protoman.isAlive()) {
protoman.setSpeed(MegamanConstants.PROTOMAN_SPEED, 90);
if (protomanFlame == null) {
protomanFlame = createParticleFX(ParticleFXType.FLAME, protoman, 13, 5, 0, 0.15f);
}
}
break;
}
case Keys.DOWN: {
// move protoman down
if (protoman.isAlive()) {
protoman.setSpeed(MegamanConstants.PROTOMAN_SPEED, 270);
if (protomanFlame == null) {
protomanFlame = createParticleFX(ParticleFXType.FLAME, protoman, 13, 5, 0, 0.15f);
}
}
break;
}
case Keys.ESCAPE: {
// switch to state menu
game.setGameState(GameStateType.MAIN_MENU, false, true, null);
break;
}
}
return true;
}
示例12: keyDown
@Override
public boolean keyDown(int optionIndex, int keyOrButtonCode) {
if (Keys.ESCAPE == keyOrButtonCode && game.isGameStateAvailable(GameStateType.GAME)) {
game.setGameState(GameStateType.GAME, true, false, null);
}
return false;
}
示例13: keyDown
@Override
public boolean keyDown(int keycode) {
switch (keycode) {
case Keys.ESCAPE:
gsm.setCurrentState(StateType.MAIN_MENU);
return true;
case Keys.F10:
saveScreenshot();
return true;
case Keys.Z:
Game.TESTING = !Game.TESTING;
return true;
case Keys.X:
Gdx.app.exit();
return true;
//examples
case Keys.TAB:
//open inventory
return true;
case Keys.T:
//open talents/perks
return true;
case Keys.L:
//open mission/quest/tasks log
return true;
default:
return false;
}
}
示例14: keyDown
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.ESCAPE) {
onMenuPressed();
return true;
}
return false;
}
示例15: keyDown
@Override
public boolean keyDown(int keycode) {
if (keycode == Keys.ESCAPE && typeListener != null) {
Game.log("just pressed");
typeListener.invoke(InputCode.CANCEL);
return true;
}
if (keycode == Keys.ENTER && typeListener != null) {
typeListener.invoke(InputCode.CONFIRM);
return true;
}
return false;
}