本文整理汇总了Java中org.lwjgl.input.Mouse.hasWheel方法的典型用法代码示例。如果您正苦于以下问题:Java Mouse.hasWheel方法的具体用法?Java Mouse.hasWheel怎么用?Java Mouse.hasWheel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.input.Mouse
的用法示例。
在下文中一共展示了Mouse.hasWheel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawScreen
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void drawScreen(int x, int y, float par3) {
GL11.glPushMatrix();
ScaledResolution scaledRes = new ScaledResolution(this.mc);
float scale = (float)scaledRes.getScaleFactor() / (float)Math.pow(scaledRes.getScaleFactor(), 2.0);
GL11.glScalef((float)scale, (float)scale, (float)scale);
int mouseX = Mouse.getX();
int mouseY = Display.getHeight() - Mouse.getY();
Gui.instance.update(mouseX, mouseY);
Gui.instance.render();
GL11.glPopMatrix();
if (Mouse.hasWheel()) {
int wheel = Mouse.getDWheel();
this.scrollVelocity = wheel < 0 ? -120 : (wheel > 0 ? 120 : 0);
}
Gui.instance.mouseScroll(this.scrollVelocity);
}
示例2: update
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void update() {
if (Bit.getInstance() == null) return;
int mouseX = (Mouse.getX() / 2);
int mouseY = ((Display.getHeight() - Mouse.getY()) / 2);
Iterator<Window> iter = Bit.getInstance().getClickGui().getWindows().iterator();
int wheel = Mouse.hasWheel() ? Mouse.getDWheel() : 0;
if (Bit.getInstance().getClickGui().getTopMost() != null)
Bit.getInstance().getClickGui().getTopMost().mouseScroll(wheel < 0 ? -1 : (wheel > 0 ? 1 : 0));
while (iter.hasNext()) {
Window comp = iter.next();
comp.update(mouseX, mouseY);
}
}
示例3: 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);
}
}
示例4: hasWheel
import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public static boolean hasWheel() {
return Mouse.hasWheel();
}