当前位置: 首页>>代码示例>>Java>>正文


Java Keys.ESCAPE属性代码示例

本文整理汇总了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;
    }
}
 
开发者ID:Darkxell,项目名称:Les-Chroniques-de-Norwand,代码行数:20,代码来源:PlayState.java

示例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);
}
 
开发者ID:GGJG2016,项目名称:EvilBunnyGod,代码行数:17,代码来源:Screen.java

示例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;
}
 
开发者ID:alexschimpf,项目名称:joe,代码行数:22,代码来源:ParticleEffectViewer.java

示例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;
}
 
开发者ID:hauke96,项目名称:METRO,代码行数:21,代码来源:GameScreenContainer.java

示例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;
}
 
开发者ID:igorcrevar,项目名称:GoingUnder,代码行数:20,代码来源:GameListener.java

示例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;
}
 
开发者ID:CherokeeLanguage,项目名称:cll1-gdx,代码行数:14,代码来源:AbstractScreen.java

示例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;
}
 
开发者ID:Osaris31,项目名称:exterminate,代码行数:31,代码来源:CameraController.java

示例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;
}
 
开发者ID:stdio2016,项目名称:ShapeClear,代码行数:11,代码来源:MainMenu.java

示例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;
}
 
开发者ID:stdio2016,项目名称:ShapeClear,代码行数:10,代码来源:GameScreen.java

示例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;
}
 
开发者ID:JayKEm,项目名称:Aftamath,代码行数:39,代码来源:MyInputProcessor.java

示例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;
}
 
开发者ID:Quillraven,项目名称:Protoman-vs-Megaman,代码行数:32,代码来源:GSGameLogic.java

示例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;
}
 
开发者ID:Quillraven,项目名称:Protoman-vs-Megaman,代码行数:8,代码来源:MainMenuPage.java

示例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;
    }
}
 
开发者ID:vs-slavchev,项目名称:Virtual-Evil,代码行数:30,代码来源:UiInputProcessor.java

示例14: keyDown

@Override
public boolean keyDown(int keycode) {
	if (keycode == Keys.ESCAPE) {
		onMenuPressed();
		return true;
	}
	return false;

}
 
开发者ID:adketuri,项目名称:umbracraft,代码行数:9,代码来源:MainMenuButton.java

示例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;
}
 
开发者ID:adketuri,项目名称:umbracraft,代码行数:13,代码来源:WindowLayout.java


注:本文中的com.badlogic.gdx.Input.Keys.ESCAPE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。