本文整理汇总了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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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();
}
示例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);
}
}
示例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();
}
示例11: handleMouseInput
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void handleMouseInput() throws IOException
{
scaleModifier += Mouse.getEventDWheel()/40;
super.handleMouseInput();
}
示例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();
}
}
}
}
示例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();
}
}
}
}