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


Java Mouse.getEventX方法代码示例

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


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

示例1: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void handleMouseInput() throws IOException
{
    int mouseX = Mouse.getEventX() * this.width / this.mc.displayWidth;
    int mouseY = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;

    super.handleMouseInput();

    if(mouseX > guiLeft + 100 && mouseX < guiLeft + 165 && mouseY > guiTop + 5 && mouseY < guiTop + 70)
    {
        int scroll = Mouse.getEventDWheel();
        if(scroll != 0)
        {
            scale += 0.1F * (1F * scroll / 120.0F);
            if(scale < 0.1F)
            {
                scale = 0.1F;
            }
        }
    }

    this.trackList.handleMouseInput(mouseX, mouseY);
}
 
开发者ID:iChun,项目名称:GeneralLaymansAestheticSpyingScreen,代码行数:24,代码来源:GuiWirelessOrder.java

示例2: drawScreen

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void drawScreen(int x, int y, float par3) {
    int mouseX = Mouse.getEventX() * this.width / this.mc.displayWidth;
    int mouseY = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
    if (this.currentLayerType == Type.CATEGORY) {
        for (Button categoryButton : this.categoryList) {
            categoryButton.draw(mouseX, mouseY);
        }
    } else if (this.currentLayerType == Type.MODULE) {
        this.backButton.draw(mouseX, mouseY);
        for (Button moduleButton : this.moduleList) {
            moduleButton.draw(mouseX, mouseY);
        }
    } else if (this.currentLayerType == Type.OPTION) {
        this.backButton.draw(mouseX, mouseY);
        for (Button optionButton : this.optionList) {
            optionButton.draw(mouseX, mouseY);
        }
    } else if (this.currentLayerType == Type.SLIDER) {
        this.backButton.draw(mouseX, mouseY);
        slider.draw(mouseX, mouseY);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:23,代码来源:ClickGui.java

示例3: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void handleMouseInput()
{
    if(Mouse.getEventButtonState())
    {
        int i = (Mouse.getEventX() * width) / mc.displayWidth;
        int k = height - (Mouse.getEventY() * height) / mc.displayHeight - 1;
        mouseClicked(i, k, Mouse.getEventButton());
    } else
    {
        int j = (Mouse.getEventX() * width) / mc.displayWidth;
        int l = height - (Mouse.getEventY() * height) / mc.displayHeight - 1;
        mouseMovedOrUp(j, l, Mouse.getEventButton());
    }
}
 
开发者ID:jd-lang,项目名称:betaexpansion,代码行数:15,代码来源:GuiScreen.java

示例4: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void handleMouseInput() throws IOException
{
    int mouseX = Mouse.getEventX() * this.width / this.mc.displayWidth;
    int mouseY = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;

    super.handleMouseInput();
    this.trackList.handleMouseInput(mouseX, mouseY);
}
 
开发者ID:iChun,项目名称:GeneralLaymansAestheticSpyingScreen,代码行数:10,代码来源:GuiProjectorSetter.java

示例5: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void handleMouseInput() throws IOException {
	int mouseX = Mouse.getEventX() * width / mc.displayWidth;
	int mouseY = height - Mouse.getEventY() * height / mc.displayHeight - 1;
	int button = Mouse.getEventButton();

	if (Mouse.getEventButtonState()) {
		//if (GuiScreen.isCtrlKeyDown()) {
		if (GuiScreen.isAltKeyDown()) {
			if (button == 0) {
				Slot slot = getSlotAtPos(mouseX, mouseY);
				if (slot != null && !slot.getStack().isEmpty()) {
					if (!ItemUtils.areItemsEqual(DankNullUtils.getSelectedStack(getDankNullInventory()), slot.getStack())) {
						int count = 0;
						for (Slot slotHovered : inventorySlots.inventorySlots) {
							count++;
							if (slotHovered.equals(slot)) {
								DankNullUtils.setSelectedStackIndex(getDankNullInventory(), (count - 1) - 36);
								return;
							}
						}
					}
				}
			}
			//}
		}
	}
	super.handleMouseInput();
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:30,代码来源:GuiDankNull.java

示例6: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Handles mouse input.
 */
public void handleMouseInput() throws IOException
{
    int i = Mouse.getEventX() * this.width / this.mc.displayWidth;
    int j = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
    int k = Mouse.getEventButton();

    if (Mouse.getEventButtonState())
    {
        if (this.mc.gameSettings.touchscreen && this.touchValue++ > 0)
        {
            return;
        }

        this.eventButton = k;
        this.lastMouseEvent = Minecraft.getSystemTime();
        this.mouseClicked(i, j, this.eventButton);
    }
    else if (k != -1)
    {
        if (this.mc.gameSettings.touchscreen && --this.touchValue > 0)
        {
            return;
        }

        this.eventButton = -1;
        this.mouseReleased(i, j, k);
    }
    else if (this.eventButton != -1 && this.lastMouseEvent > 0L)
    {
        long l = Minecraft.getSystemTime() - this.lastMouseEvent;
        this.mouseClickMove(i, j, this.eventButton, l);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:37,代码来源:GuiScreen.java

示例7: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void handleMouseInput() throws IOException
{
    int mouseX = Mouse.getEventX() * this.width / this.mc.displayWidth;
    int mouseY = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;

    super.handleMouseInput();
    if(syncTrack == 0 || !disableListWhenSyncTrack)
    {
        this.trackList.handleMouseInput(mouseX, mouseY);
    }
    bandNameString = bandName.getText();
}
 
开发者ID:iChun,项目名称:Clef,代码行数:14,代码来源:GuiPlayTrack.java

示例8: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Handles mouse input.
 */
@Override
public void handleMouseInput() throws IOException
{
    int mouseX = Mouse.getEventX() * this.width / this.mc.displayWidth;
    int mouseY = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;

    super.handleMouseInput();
    if (this.modInfo != null)
        this.modInfo.handleMouseInput(mouseX, mouseY);
    this.modList.handleMouseInput(mouseX, mouseY);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:GuiModList.java

示例9: MouseEvent

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public MouseEvent()
{
    this.x = Mouse.getEventX();
    this.y = Mouse.getEventY();
    this.dx = Mouse.getEventDX();
    this.dy = Mouse.getEventDY();
    this.dwheel = Mouse.getEventDWheel();
    this.button = Mouse.getEventButton();
    this.buttonstate = Mouse.getEventButtonState();
    this.nanoseconds = Mouse.getEventNanoseconds();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:MouseEvent.java

示例10: updateScreen

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void updateScreen()
{
    super.updateScreen();

    if (closing)
    {
        if (doneClosing || inventory == null)
        {
            Minecraft.getMinecraft().displayGuiScreen(null);

            ClientProxy.wipeOpen();
        }

        return;
    }

    ItemStack inHand = mc.player.getHeldItemMainhand();
    if (!Config.isItemStackAllowed(inHand))
    {
        inventory = null;
    }
    else
    {
        ItemStack stack = getter.getBelt();
        if (stack.getCount() <= 0)
        {
            inventory = null;
            stackEquipped = null;
        }
        // Reference comparison intended
        else if (stackEquipped != stack)
        {
            stackEquipped = stack;
            inventory = ItemToolBelt.getItems(stack);
            cachedStacks = null;
        }
    }

    if (inventory == null)
    {
        Minecraft.getMinecraft().displayGuiScreen(null);
    }
    else if (!GameSettings.isKeyDown(ClientProxy.keyOpenToolMenu))
    {
        if (Config.releaseToSwap)
        {
            int x = Mouse.getEventX() * this.width / this.mc.displayWidth;
            int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
            mouseReleased(x, y, -1);
        }
        else
        {
            animateClose();
        }
    }
}
 
开发者ID:gigaherz,项目名称:ToolBelt,代码行数:58,代码来源:GuiRadialMenu.java

示例11: drawScreen

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void drawScreen(int x, int y, float par3) {
    GL11.glDisable((int)3008);
    this.renderSkybox(x, y, par3);
    GL11.glEnable((int)3008);
    int mouseX = Mouse.getEventX() * this.width / this.mc.displayWidth;
    int mouseY = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
    if (this.buttonList.size() > 0) {
        if (this.prevWidth != this.width || this.prevHeight != this.height) {
            this.initGui();
            this.prevWidth = this.width;
            this.prevHeight = this.height;
        }
        if (Mouse.hasWheel() && this.buttonList.get(this.buttonList.size() - 1).getX2() - this.buttonList.get(0).getX1() > this.width && this.currentScreen == null) {
            int wheel = Mouse.getDWheel();
            if (wheel < 0) {
                this.scrollVelocity += 8;
            } else if (wheel > 0) {
                this.scrollVelocity -= 8;
            }
            if (this.scrollVelocity > 40) {
                this.scrollVelocity = 40;
            }
            if (this.scrollVelocity < -40) {
                this.scrollVelocity = -40;
            }
            this.scrollOffset -= this.scrollVelocity;
            if (this.scrollOffset > 0 - this.scrollVelocity) {
                this.scrollOffset = 0 - this.scrollVelocity;
            }
            if (this.buttonList.get(this.buttonList.size() - 1).getX2() - this.width + 20 < 0) {
                this.scrollOffset = (this.buttonList.get(this.buttonList.size() - 1).getX2() - this.width + 20 - this.scrollOffset) * -1;
            }
        }
        if (this.scrollVelocity < 0) {
            ++this.scrollVelocity;
        } else if (this.scrollVelocity > 0) {
            --this.scrollVelocity;
        }
        this.drawAltButtons(mouseX, mouseY);
    }
    this.drawCenteredString(this.info, 1.2f, 0, 2);
    this.drawCenteredString("\u00a7b" + AccountManager.accountList.size() + " Alts", 1.0f, 0, 14);
    this.addAltButton.draw(mouseX, mouseY);
    this.delAltButton.draw(mouseX, mouseY);
    this.editAltButton.draw(mouseX, mouseY);
    this.randomAltButton.draw(mouseX, mouseY);
    if (this.currentScreen != null) {
        this.currentScreen.draw(mouseX, mouseY);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:51,代码来源:AccountScreen.java


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