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


Java Mouse.getDWheel方法代码示例

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


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

示例1: updateScreen

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public final void updateScreen()
{
	onUpdate();
	
	// scrollbar
	if(!scrollbarLocked)
	{
		scroll += Mouse.getDWheel() / 10;
		
		if(scroll > 0)
			scroll = 0;
		else if(scroll < maxScroll)
			scroll = maxScroll;
		
		if(maxScroll == 0)
			scrollKnobPosition = 0;
		else
			scrollKnobPosition =
				(int)((height - 131) * scroll / (float)maxScroll);
		scrollKnobPosition += 2;
	}
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:24,代码来源:NavigatorScreen.java

示例2: 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);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:17,代码来源:GuiGrabber.java

示例3: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void handleMouseInput() {
    if (listening) {
        int wheel = -Mouse.getDWheel();
        wheel = MathHelper.clamp(wheel, -1, 1);
        currentScroll += (float) wheel / states;
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:9,代码来源:WidgetVerticalScrollbar.java

示例4: calculateZoom

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void calculateZoom() {
	float targetZoom = distanceFromPlayer.getTarget();
	float zoomLevel = Mouse.getDWheel() * 0.0008f * targetZoom;
	targetZoom -= zoomLevel;
	if (targetZoom < 1) {
		targetZoom = 1;
	}
	distanceFromPlayer.setTarget(targetZoom);
	distanceFromPlayer.update(0.01f);
}
 
开发者ID:TheThinMatrix,项目名称:LowPolyWater,代码行数:11,代码来源:Camera.java

示例5: 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);
    }
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:14,代码来源:ClickGuiDisplayer.java

示例6: calculateZoom

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void calculateZoom() {
	float zoomLevel = Mouse.getDWheel() * 0.1f;
	distanceFromPlayer -= zoomLevel;
	if (distanceFromPlayer < 12f)
		distanceFromPlayer = 12f;
	if (distanceFromPlayer > 100f)
		distanceFromPlayer = 100f;
}
 
开发者ID:Essentria,项目名称:Elgin-Plant-Game,代码行数:9,代码来源:Camera.java

示例7: handleMouseInput

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void handleMouseInput() throws IOException{
    if(startProfile.isMouseOver() && startProfile.enabled){
        int wheel = Mouse.getDWheel();
        if(wheel != 0) {
            seconds = seconds + ((wheel / 120) * 5); /* 1 Click is 120, 1 click is 5 seconds */
            seconds = Math.max(seconds, 5);
            startProfile.displayString = "Profile for " + seconds + " seconds";
        }
    }
    super.handleMouseInput();
    Mouse.getDWheel();
}
 
开发者ID:TerminatorNL,项目名称:LagGoggles,代码行数:14,代码来源:GuiProfile.java

示例8: calculateZoom

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void calculateZoom() {
    float targetZoom = distanceFromPlayer.getTarget();
    float zoomLevel = Mouse.getDWheel() * 0.0008f * targetZoom;
    targetZoom -= zoomLevel;
    if (targetZoom < 0) {
        targetZoom = 0;
    }
    //if small Terrain
    if (Configs.TERRAIN_SIZE <= 100) {
        if (targetZoom > 35) {
            targetZoom = 35;
        }
    }
    //if medium terrain
    else if (Configs.TERRAIN_SIZE <= 200) {
        if (targetZoom > 75) {
            targetZoom = 75;
        }
    }
    //if large terrain
    else if (Configs.TERRAIN_SIZE >= 300) {
        if (targetZoom > 100) {
            targetZoom = 100;
        }
    }
    //error with terrain size
    else {
        System.err.println("Mouse Zoom Control Could Not Be Performed!!");
    }
    distanceFromPlayer.setTarget(targetZoom);
    distanceFromPlayer.update(0.01f);
}
 
开发者ID:GryPLOfficial,项目名称:EcoSystem-Official,代码行数:33,代码来源:Camera.java

示例9: calculateZoom

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void calculateZoom(){
	float targetZoom = distanceFromPlayer.getTarget();
	float zoomLevel = Mouse.getDWheel() * 0.0008f * targetZoom;
	targetZoom -= zoomLevel;
	if(targetZoom<1){
		targetZoom = 1;
	}else if(targetZoom > 20){
		targetZoom = 20;
	}
	distanceFromPlayer.setTarget(targetZoom);
	distanceFromPlayer.update(0.01f);
}
 
开发者ID:TheThinMatrix,项目名称:OcclusionQueries,代码行数:13,代码来源:Camera.java

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

示例11: getDWheel

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public static int getDWheel() {
	return Mouse.getDWheel();
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:4,代码来源:IMouse.java

示例12: drawScreen

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
    super.drawScreen(mouseX, mouseY, partialTicks);
    frameCount++;

    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(TEXTURE_BACKGROUND);
    int x = (this.width - this.xSize) / 2;
    int z = (this.height - this.ySize) / 2;
    this.drawTexturedModalRect(x, z, 0, 0, this.xSize, this.ySize);

    if(renderContext.doesRenderIn3D()) {
        if (Mouse.isButtonDown(0) && frameCount > 20) {
            renderContext.rotateRender(0.25 * Mouse.getDY(), 0.25 * Mouse.getDX(), 0);
        }
    } else {
        if (Mouse.isButtonDown(0) && frameCount > 20) {
            renderContext.moveRender(0.25 * Mouse.getDX(), 0, -0.25 * Mouse.getDY());
        }
    }
    int dwheel = Mouse.getDWheel();
    if(dwheel < 0) {
        renderContext.zoomOut();
    } else if(dwheel > 0) {
        renderContext.zoomIn();
    }

    if(GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindSneak)) {
        if(renderContext.getShiftSnap() == -1) {
            renderContext.snapSamples();
        }
    } else {
        renderContext.releaseSamples();
    }

    ScaledResolution res = new ScaledResolution(mc);
    Rectangle scissorFrame = new Rectangle((guiLeft + 8) * res.getScaleFactor(), (guiTop + 43) * res.getScaleFactor(),
            160 * res.getScaleFactor(), 94 * res.getScaleFactor());
    GL11.glEnable(GL11.GL_SCISSOR_TEST);
    GL11.glScissor(scissorFrame.x, scissorFrame.y, scissorFrame.width, scissorFrame.height);
    x = 88;
    z = 66;
    renderContext.renderAt(this.guiLeft + x, this.guiTop + z, partialTicks);
    GL11.glDisable(GL11.GL_SCISSOR_TEST);

    drawButtons(mouseX, mouseY);

    GlStateManager.disableDepth();
    fontRenderer.drawStringWithShadow(machine.getLocalizedName(), this.guiLeft + 10, this.guiTop + 11, 0xFFFFFFFF);
    if(machine.requiresBlueprint()) {
        String reqBlueprint = I18n.format("tooltip.machinery.blueprint.required");
        fontRenderer.drawString(reqBlueprint, this.guiLeft + 10, this.guiTop + 106, 0x444444);
    }
    GlStateManager.enableDepth();

    scissorFrame = new Rectangle(MathHelper.floor(this.guiLeft + 8), MathHelper.floor(this.guiTop + 8), 160, 94);
    if(!renderContext.doesRenderIn3D() && scissorFrame.contains(mouseX, mouseY)) {
        render2DHover(mouseX, mouseY, x, z);
    }
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:61,代码来源:GuiScreenBlueprint.java


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