Java Code Examples for org.lwjgl.input.Mouse.hasWheel()

The following are Jave code examples for showing how to use hasWheel() of the org.lwjgl.input.Mouse class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: BaseClient   File: GuiGrabber.java   View Source Code Vote up 6 votes
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);
}
 
Example 2
Project: bit-client   File: ClickGuiDisplayer.java   View Source Code Vote up 5 votes
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);
    }
}
 
Example 3
Project: BaseClient   File: AccountScreen.java   View Source Code Vote up 4 votes
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);
    }
}
 
Example 4
Project: EMC   File: IMouse.java   View Source Code Vote up 4 votes
public static boolean hasWheel() {
	return Mouse.hasWheel();
}