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


Java Keyboard.KEY_M屬性代碼示例

本文整理匯總了Java中org.lwjgl.input.Keyboard.KEY_M屬性的典型用法代碼示例。如果您正苦於以下問題:Java Keyboard.KEY_M屬性的具體用法?Java Keyboard.KEY_M怎麽用?Java Keyboard.KEY_M使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.lwjgl.input.Keyboard的用法示例。


在下文中一共展示了Keyboard.KEY_M屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerKeys

@Override
public void registerKeys()
{
    openGuiKey = new KeyBinding("minetogether.key.friends", Keyboard.KEY_M, "minetogether.keys");
    Minecraft.getMinecraft().gameSettings.keyBindings = ArrayUtils.add(Minecraft.getMinecraft().gameSettings.keyBindings, openGuiKey);
}
 
開發者ID:CreeperHost,項目名稱:CreeperHostGui,代碼行數:6,代碼來源:Client.java

示例2: registerKeys

@Override
public void registerKeys()
{
    openGuiKey = new KeyBinding("minetogether.key.friends", KeyConflictContext.UNIVERSAL, KeyModifier.CONTROL, Keyboard.KEY_M, "minetogether.keys");
    ClientRegistry.registerKeyBinding(openGuiKey);
}
 
開發者ID:CreeperHost,項目名稱:CreeperHostGui,代碼行數:6,代碼來源:Client.java

示例3: update

public void update() {
	draw();
	editorUI.drawString(WIDTH + 3, HEIGHT / 2, "Press 's' to");
	editorUI.drawString(WIDTH + 3, HEIGHT / 2 + 20, "save this");
	editorUI.drawString(WIDTH + 3, HEIGHT / 2 + 40, "map!");
	editorUI.drawString(WIDTH + 3, HEIGHT / 2 + 80, "Press 'm' to");
	editorUI.drawString(WIDTH + 3, HEIGHT / 2 + 100, "return to");
	editorUI.drawString(WIDTH + 3, HEIGHT / 2 + 120, "the menu!");
	
	// Mouse Input
	if (Mouse.next()){
		boolean mouseClicked = Mouse.isButtonDown(0);
		if (mouseClicked) {
			if (tilePickerMenu.isButtonClicked("Grass")) {
				index = 0;
			} else if (tilePickerMenu.isButtonClicked("Dirt")){
				index = 1;
			} else if (tilePickerMenu.isButtonClicked("Water")) {
				index = 2;
			} else if (tilePickerMenu.isButtonClicked("DirtStone")) {
				index = 3;
			} else if (tilePickerMenu.isButtonClicked("StoneFloor")) {
				index = 4;
			} else if (tilePickerMenu.isButtonClicked("Sand")) {
				index = 5;
			} else if (tilePickerMenu.isButtonClicked("Crystal")) {
				index = 6;
			} else {
				if (Mouse.getX() < WIDTH)
					setTile();
			}
		}
	}

	// Keyboard Input
	while (Keyboard.next()) {
		if (Keyboard.getEventKey() == Keyboard.KEY_S && Keyboard.getEventKeyState()) {
			SaveMap(MAP_NAME, grid);
			StateManager.checkMap = 0;
		}
		if (Keyboard.getEventKey() == Keyboard.KEY_M && Keyboard.getEventKeyState()) {
			StateManager.setState(GameState.MAINMENU);
		}
	}
}
 
開發者ID:imaTowan,項目名稱:Towan,代碼行數:45,代碼來源:Editor.java


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