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


Java Mouse.next方法代码示例

本文整理汇总了Java中org.lwjgl.input.Mouse.next方法的典型用法代码示例。如果您正苦于以下问题:Java Mouse.next方法的具体用法?Java Mouse.next怎么用?Java Mouse.next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.input.Mouse的用法示例。


在下文中一共展示了Mouse.next方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Delegates mouse and keyboard input.
 */
public void handleInput() throws IOException
{
    if (Mouse.isCreated())
    {
        while (Mouse.next())
        {
            this.handleMouseInput();
        }
    }

    if (Keyboard.isCreated())
    {
        while (Keyboard.next())
        {
            this.handleKeyboardInput();
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:GuiScreen.java

示例2: updateUI

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void updateUI() {
	gameUI.draw();
	gameUI.drawString(WIDTH + TILE_SIZE / 4, 200, "Lives: " + Player.Lives);
	gameUI.drawString(WIDTH + TILE_SIZE / 4, 220, "Gold: " + Player.Gold);
	gameUI.drawString(WIDTH + TILE_SIZE / 4, 300, "Score:");
	gameUI.drawString(WIDTH + TILE_SIZE / 4, 320, "" + Player.Score);
	gameUI.drawString(WIDTH + TILE_SIZE / 4, 400, "Wave: " + waveManager.getWaveNumber());
	gameUI.drawString(0, 0, StateManager.framesInLastSecond + " fps");
	
	if (Mouse.next()){
		boolean mouseClicked = Mouse.isButtonDown(0);
		if (mouseClicked) {
			if (towerPickerMenu.isButtonClicked("TowerMonkey"))
				player.pickTower(new TowerMonkey(TowerType.TowerMonkey,grid.getTile(0, 0), waveManager.getCurrentWave().getEnemyList()));
			if (towerPickerMenu.isButtonClicked("TowerSling"))
				player.pickTower(new TowerSling(TowerType.TowerSling,grid.getTile(0, 0), waveManager.getCurrentWave().getEnemyList()));
			if (towerPickerMenu.isButtonClicked("TowerIce"))
				player.pickTower(new TowerIce(TowerType.TowerIce,grid.getTile(0, 0), waveManager.getCurrentWave().getEnemyList()));
			if (towerPickerMenu.isButtonClicked("TowerLightning"))
				player.pickTower(new TowerLightning(TowerType.TowerLightning,grid.getTile(0, 0), waveManager.getCurrentWave().getEnemyList()));
		}
	}
}
 
开发者ID:imaTowan,项目名称:Towan,代码行数:24,代码来源:Game.java

示例3: handleInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Delegates mouse and keyboard input.
 */
public void handleInput() throws IOException
{
    if (Mouse.isCreated())
    {
        while (Mouse.next())
        {
            if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Pre(this))) continue;
            this.handleMouseInput();
            if (this.equals(this.mc.currentScreen)) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.MouseInputEvent.Post(this));
        }
    }

    if (Keyboard.isCreated())
    {
        while (Keyboard.next())
        {
            if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Pre(this))) continue;
            this.handleKeyboardInput();
            if (this.equals(this.mc.currentScreen)) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.KeyboardInputEvent.Post(this));
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:GuiScreen.java

示例4: handleInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void handleInput()
{
    for(; Mouse.next(); handleMouseInput()) { }
    for(; Keyboard.next(); handleKeyboardInput()) { }
}
 
开发者ID:jd-lang,项目名称:betaexpansion,代码行数:6,代码来源:GuiScreen.java

示例5: runTickMouse

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void runTickMouse() throws IOException
{
    while (Mouse.next())
    {
        int i = Mouse.getEventButton();
        KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState());

        if (Mouse.getEventButtonState())
        {
            if (this.player.isSpectator() && i == 2)
            {
                this.ingameGUI.getSpectatorGui().onMiddleClick();
            }
            else
            {
                KeyBinding.onTick(i - 100);
            }
        }

        long j = getSystemTime() - this.systemTime;

        if (j <= 200L)
        {
            int k = Mouse.getEventDWheel();

            if (k != 0)
            {
                if (this.player.isSpectator())
                {
                    k = k < 0 ? -1 : 1;

                    if (this.ingameGUI.getSpectatorGui().isMenuActive())
                    {
                        this.ingameGUI.getSpectatorGui().onMouseScroll(-k);
                    }
                    else
                    {
                        float f = MathHelper.clamp(this.player.capabilities.getFlySpeed() + (float)k * 0.005F, 0.0F, 0.2F);
                        this.player.capabilities.setFlySpeed(f);
                    }
                }
                else
                {
                    this.player.inventory.changeCurrentItem(k);
                }
            }

            if (this.currentScreen == null)
            {
                if (!this.inGameHasFocus && Mouse.getEventButtonState())
                {
                    this.setIngameFocus();
                }
            }
            else if (this.currentScreen != null)
            {
                this.currentScreen.handleMouseInput();
            }
        }
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:62,代码来源:Minecraft.java

示例6: update

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
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,代码行数:46,代码来源:Editor.java

示例7: runTickMouse

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void runTickMouse() throws IOException
{
    while (Mouse.next())
    {
        if (net.minecraftforge.client.ForgeHooksClient.postMouseEvent()) continue;

        int i = Mouse.getEventButton();
        KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState());

        if (Mouse.getEventButtonState())
        {
            if (this.thePlayer.isSpectator() && i == 2)
            {
                this.ingameGUI.getSpectatorGui().onMiddleClick();
            }
            else
            {
                KeyBinding.onTick(i - 100);
            }
        }

        long j = getSystemTime() - this.systemTime;

        if (j <= 200L)
        {
            int k = Mouse.getEventDWheel();

            if (k != 0)
            {
                if (this.thePlayer.isSpectator())
                {
                    k = k < 0 ? -1 : 1;

                    if (this.ingameGUI.getSpectatorGui().isMenuActive())
                    {
                        this.ingameGUI.getSpectatorGui().onMouseScroll(-k);
                    }
                    else
                    {
                        float f = MathHelper.clamp_float(this.thePlayer.capabilities.getFlySpeed() + (float)k * 0.005F, 0.0F, 0.2F);
                        this.thePlayer.capabilities.setFlySpeed(f);
                    }
                }
                else
                {
                    this.thePlayer.inventory.changeCurrentItem(k);
                }
            }

            if (this.currentScreen == null)
            {
                if (!this.inGameHasFocus && Mouse.getEventButtonState())
                {
                    this.setIngameFocus();
                }
            }
            else if (this.currentScreen != null)
            {
                this.currentScreen.handleMouseInput();
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:64,代码来源:Minecraft.java


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