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


Java Mouse.getEventDWheel方法代码示例

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


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

示例1: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Handles mouse input.
 */
public void handleMouseInput() throws IOException
{
    super.handleMouseInput();
    int i = Mouse.getEventDWheel();

    if (i != 0 && this.needsScrollBars())
    {
        int j = (((GuiContainerCreative.ContainerCreative)this.inventorySlots).itemList.size() + 9 - 1) / 9 - 5;

        if (i > 0)
        {
            i = 1;
        }

        if (i < 0)
        {
            i = -1;
        }

        this.currentScroll = (float)((double)this.currentScroll - (double)i / (double)j);
        this.currentScroll = MathHelper.clamp_float(this.currentScroll, 0.0F, 1.0F);
        ((GuiContainerCreative.ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:GuiContainerCreative.java

示例2: 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

示例3: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Handles mouse input.
 */
public void handleMouseInput() throws IOException
{
    super.handleMouseInput();
    int i = Mouse.getEventDWheel();

    if (i != 0)
    {
        if (i > 1)
        {
            i = 1;
        }

        if (i < -1)
        {
            i = -1;
        }

        if (!isShiftKeyDown())
        {
            i *= 7;
        }

        this.mc.ingameGUI.getChatGUI().scroll(i);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:29,代码来源:GuiChat.java

示例4: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Handles mouse input.
 */
public void handleMouseInput() throws IOException
{
    super.handleMouseInput();
    int i = Mouse.getEventDWheel();

    if (i != 0 && this.needsScrollBars())
    {
        int j = ((GuiContainerCreative.ContainerCreative)this.inventorySlots).itemList.size() / 9 - 5;

        if (i > 0)
        {
            i = 1;
        }

        if (i < 0)
        {
            i = -1;
        }

        this.currentScroll = (float)((double)this.currentScroll - (double)i / (double)j);
        this.currentScroll = MathHelper.clamp_float(this.currentScroll, 0.0F, 1.0F);
        ((GuiContainerCreative.ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:28,代码来源:GuiContainerCreative.java

示例5: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Handles mouse input.
 */
public void handleMouseInput() throws IOException
{
    super.handleMouseInput();
    int i = Mouse.getEventDWheel();

    if (i != 0 && this.needsScrollBars())
    {
        int j = (((GuiContainerCreative.ContainerCreative)this.inventorySlots).itemList.size() + 9 - 1) / 9 - 5;

        if (i > 0)
        {
            i = 1;
        }

        if (i < 0)
        {
            i = -1;
        }

        this.currentScroll = (float)((double)this.currentScroll - (double)i / (double)j);
        this.currentScroll = MathHelper.clamp(this.currentScroll, 0.0F, 1.0F);
        ((GuiContainerCreative.ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:GuiContainerCreative.java

示例6: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void handleMouseInput() throws IOException {
	super.handleMouseInput();
	
	Rule[] rules = this.entity.getRules();
	
	this.listScrollPosition += Mouse.getEventDWheel() / 10;
	this.listScrollPosition = Math.min(0, this.listScrollPosition);
	this.listScrollPosition = Math.max(Math.min(0, rules.length * this.entryHeight * -1 + this.listHeight), this.listScrollPosition);
}
 
开发者ID:astronautlabs,项目名称:rezolve,代码行数:11,代码来源:SecurityServerGuiContainer.java

示例7: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Handles mouse input.
 */
@Override
public void handleMouseInput() throws IOException {
    super.handleMouseInput();
    int i = Mouse.getEventDWheel();

    if (i != 0 && needsScrollBars()) {
        int j = ((ContainerSearcher) inventorySlots).itemList.size() / 9 - 5 + 1;

        if (i > 0) {
            i = 1;
        }

        if (i < 0) {
            i = -1;
        }

        currentScroll = (float) (currentScroll - (double) i / (double) j);

        if (currentScroll < 0.0F) {
            currentScroll = 0.0F;
        }

        if (currentScroll > 1.0F) {
            currentScroll = 1.0F;
        }

        ((ContainerSearcher) inventorySlots).scrollTo(currentScroll);
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:33,代码来源:GuiSearcher.java

示例8: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void handleMouseInput() throws IOException {
	if(mode.getId() != -1)
		if(Mouse.getEventDWheel() == -120)
			scroll += 15;
		else if(Mouse.getEventDWheel() == 120)
			scroll -= 15;
	super.handleMouseInput();
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:10,代码来源:GuiBookScreen.java

示例9: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void handleMouseInput(int mouseX, int mouseY) throws IOException
{
    boolean isHovering = mouseX >= this.left && mouseX <= this.left + this.listWidth &&
                         mouseY >= this.top && mouseY <= this.bottom;
    if (!isHovering)
        return;

    int scroll = Mouse.getEventDWheel();
    if (scroll != 0)
    {
        this.scrollDistance += (float)((-1 * scroll / 120.0F) * this.slotHeight / 2);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:14,代码来源:GuiScrollingList.java

示例10: 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

示例11: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void handleMouseInput() throws IOException
{
	scaleModifier += Mouse.getEventDWheel()/40;
	super.handleMouseInput();
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:7,代码来源:GuiEntityRenderer.java

示例12: 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

示例13: 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


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