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


Java Mouse.getY方法代码示例

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


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

示例1: handleLoadingScreen

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public boolean handleLoadingScreen(ScaledResolution scaledResolution) throws IOException
{
    if (client.currentScreen instanceof GuiNotification)
    {
        int width = scaledResolution.getScaledWidth();
        int height = scaledResolution.getScaledHeight();
        int mouseX = Mouse.getX() * width / client.displayWidth;
        int mouseZ = height - Mouse.getY() * height / client.displayHeight - 1;

        client.currentScreen.drawScreen(mouseX, mouseZ, 0);
        client.currentScreen.handleInput();

        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:FMLClientHandler.java

示例2: func_73863_a

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
@Override
public void func_73863_a(int mouseXx, int mouseYy, float partialTicks) {
    if (Bit.getInstance() == null) return;
    int mouseX = (Mouse.getX() / 2);
    int mouseY = ((Display.getHeight() - Mouse.getY()) / 2);
    try {
        TessRenderUtil.drawRect(0, 0, Display.getWidth(), Display.getHeight(), new Color(0, 0, 0, 55).getRGB());
    } catch (Exception e) {
    }

    RenderUtil.scaleProperly();
    Wrapper.drawStringWithShadow_scaled(Bit.ID, 20, 15, ColorUtil.getClientColor(), 2);
    Iterator<Window> iter = Bit.getInstance().getClickGui().getWindows().iterator();
    while (iter.hasNext()) {
        GL11.glPushMatrix();
        Window comp = iter.next();
        comp.render(mouseX, mouseY);
        GL11.glPopMatrix();
    }
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:21,代码来源:ClickGuiDisplayer.java

示例3: getMousePos

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private static int[] getMousePos() {
    ScaledResolution resolution = new ScaledResolution(MC);
    int width = resolution.getScaledWidth();
    int height = resolution.getScaledHeight();
    int mouseX = Mouse.getX() * width / MC.displayWidth;
    int mouseY = height - Mouse.getY() * height / MC.displayHeight - 1;
    return new int[] {mouseX, mouseY};
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:9,代码来源:MinecraftGuiProxy.java

示例4: clickOn

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
protected void clickOn() {
	if (Mouse.getX() >= posX && Mouse.getX() <= posX + width && PZGUI.getHeight() - Mouse.getY() >= posY && PZGUI.getHeight() - Mouse.getY() <= posY + height) {
		
		if (Mouse.isButtonDown(0) && isClicked == false)
		{
			onClicked();
		}
	}
}
 
开发者ID:hungthuanmk,项目名称:HCMIU_PlantsAndZombies,代码行数:10,代码来源:Sun.java

示例5: BackgroundDrawnEvent

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public BackgroundDrawnEvent(GuiScreen gui)
{
    super(gui);
    final ScaledResolution scaledresolution = new ScaledResolution(gui.mc);
    final int scaledWidth = scaledresolution.getScaledWidth();
    final int scaledHeight = scaledresolution.getScaledHeight();
    this.mouseX = Mouse.getX() * scaledWidth / gui.mc.displayWidth;
    this.mouseY = scaledHeight - Mouse.getY() * scaledHeight / gui.mc.displayHeight - 1;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:GuiScreenEvent.java

示例6: clickInventory

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void clickInventory(int k, boolean state) {
    try {
        GuiContainer inventory = (GuiContainer) Wrapper.currentScreen();

        int x = Mouse.getX() * inventory.field_146294_l / inventory.field_146297_k.field_71443_c;
        int y = inventory.field_146295_m - Mouse.getY() * inventory.field_146295_m / inventory.field_146297_k.field_71440_d - 1;

        int touchValue = (int) ReflectionUtil.getFieldValue("field_146298_h", inventory, GuiScreen.class);
        if (state) {
            if (inventory.field_146297_k.field_71474_y.field_85185_A && touchValue++ > 0) return;

            ReflectionUtil.setField("field_146287_f", GuiScreen.class, inventory, k);
            ReflectionUtil.setField("field_146288_g", GuiScreen.class, inventory, Minecraft.func_71386_F());
            int eventButton = (int) ReflectionUtil.getFieldValue("field_146287_f", inventory, GuiScreen.class);
            ReflectionUtil.invokeMethod("func_73864_a", GuiScreen.class, inventory, new Object[]{x, y, eventButton}, int.class, int.class, int.class);
        } else if (k != -1) {

            if (inventory.field_146297_k.field_71474_y.field_85185_A && touchValue-- > 0) return;

            ReflectionUtil.setField("field_146287_f", GuiScreen.class, inventory, -1);
            ReflectionUtil.invokeMethod("func_146286_b", GuiScreen.class, inventory, new Object[]{x, y, k}, int.class, int.class, int.class);
        } else if ((int) ReflectionUtil.getFieldValue("field_146287_f", inventory, GuiScreen.class) != -1 && (long) ReflectionUtil.getFieldValue("field_146288_g", inventory, GuiScreen.class) > 0L) {
            long l = Minecraft.func_71386_F() - (long) ReflectionUtil.getFieldValue("field_146288_g", inventory, GuiScreen.class);
            ReflectionUtil.invokeMethod("func_146273_a", GuiScreen.class, inventory, new Object[]{x, y, (int) ReflectionUtil.getFieldValue("field_146287_f", inventory, GuiScreen.class), l}, int.class, int.class, int.class, long.class);
        }
    } catch (Exception e) {
    }
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:29,代码来源:ModuleAutoclicker.java

示例7: isButtonClicked

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public boolean isButtonClicked(String buttonName) {
	Button b = getButton(buttonName);
	float mouseY = HEIGHT - Mouse.getY() - 1;
	
	if (Mouse.getX() > b.getX() && Mouse.getX() < b.getX() + b.getWidth() && mouseY > b.getY() && mouseY < b.getY() + b.getHeight()) {
		return true;
	}
	return false;
}
 
开发者ID:imaTowan,项目名称:Towan,代码行数:10,代码来源:UI.java

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

示例9: input

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private void input() {
	int mousex = Mouse.getX();
	int mousey = 480 - Mouse.getY() - 1;
	boolean mouseClicked = Mouse.isButtonDown(0);
	
	
	if (mouseClicked) {
		int grid_x = Math.round(mousex / World.BLOCK_SIZE);
		int grid_y = Math.round(mousey / World.BLOCK_SIZE);
		bt = getBT(bt);
		grid.setAt(grid_x, grid_y, bt);
	}
	while (Keyboard.next()) {
		if (Keyboard.getEventKey() == Keyboard.KEY_S) {
			grid.save(new File("save.xml"));
		}
		if (Keyboard.getEventKey() == Keyboard.KEY_L) {
			grid.load(new File("save.xml"));
		}
		if (Keyboard.getEventKey() == Keyboard.KEY_SPACE) {
			if (bt == DIRT) {
				setBT(GRASS);
			} else if (bt == GRASS) {
				setBT(STONE);
			} else if (bt == STONE) {
				setBT(AIR);
			} else if (bt == AIR) {
				setBT(DIRT);
			}
		}
	}
}
 
开发者ID:nitrodragon,项目名称:lwjgl_collection,代码行数:33,代码来源:AltBoot.java

示例10: calculateMouseRay

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private Vector3f calculateMouseRay() {
	float mouseX = Mouse.getX();
	float mouseY = Mouse.getY();
	Vector2f normalizedCoords = getNormalisedDeviceCoordinates(mouseX, mouseY);
	Vector4f clipCoords = new Vector4f(normalizedCoords.x, normalizedCoords.y, -1.0f, 1.0f);
	Vector4f eyeCoords = toEyeCoords(clipCoords);
	Vector3f worldRay = toWorldCoords(eyeCoords);
	return worldRay;
}
 
开发者ID:Essentria,项目名称:Elgin-Plant-Game,代码行数:10,代码来源:MousePicker.java

示例11: newFrame

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public static void newFrame() {
    keysFrame.flip();
    
    scaledW = ZWrapper.getScaledWidth();
    scaledH = ZWrapper.getScaledHeight();

    mouseX = Mouse.getX() * scaledW / ZWrapper.getScreenWidth();
    mouseY = scaledH - Mouse.getY() * scaledH / ZWrapper.getScreenHeight() -1;
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:10,代码来源:Keys.java

示例12: ShiftingCameraLaterally

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
private ShiftingCameraLaterally() {
    
	try {
        Display.setDisplayMode(new DisplayMode(640, 480));
        Display.setTitle("X Axis Camera Movement");
        Display.create();
    } catch (LWJGLException e) {
        e.printStackTrace();
    }
    
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0, 640, 480, 0, 1, -1);
    glMatrixMode(GL_MODELVIEW);
    
    float x_cam = 0;

    while (!Display.isCloseRequested()) {
        // Render Code here
        glClear(GL_COLOR_BUFFER_BIT);
        // Put a matrix that's a clone of the original into the matrix stock
        glPushMatrix();
        // Pushes screen laterally, depending on x_cam
        glTranslatef(x_cam, 0, 0);
        
        // Move screen with the Mouse speed
        // if the mouse is in the window and space is pressed
        if (Keyboard.isKeyDown(Keyboard.KEY_SPACE)
        		&& Mouse.getX() > 0 && Mouse.getX() < 639) {
        	x_cam += Mouse.getDX();
        }
        // True coords of the mouse
        float mousex = Mouse.getX() - x_cam;
        float mousey = 480 - Mouse.getY() - 1;
        
        System.out.println(mousex + ", " + mousey);
        
        glBegin(GL_QUADS);
        	glVertex2i(400, 400);
        	glVertex2i(450, 400);
        	glVertex2i(450, 450);
        	glVertex2i(400, 450);
        glEnd();
        
        glBegin(GL_LINES);
        	glVertex2i(400, 400);
        	glVertex2i(400, 400);
        glEnd();
        
        // Disposes of translations made to the matrix
        glPopMatrix();
        
        Display.update();
        Display.sync(60);
    }
    Display.destroy();
    System.exit(0);
}
 
开发者ID:nitrodragon,项目名称:lwjgl_collection,代码行数:59,代码来源:ShiftingCameraLaterally.java

示例13: mouseClicked

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
public void mouseClicked(int mX, int mY, int button) {
    int mouseX = Mouse.getX();
    int mouseY = Display.getHeight() - Mouse.getY();
    Gui.instance.mousePress(mouseX, mouseY, button);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:6,代码来源:GuiGrabber.java

示例14: getAbsoluteMouseY

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Get the absolute y position of the mouse cursor within the container
 * 
 * @return The absolute y position of the mouse cursor
 */
public int getAbsoluteMouseY() {
	return height - Mouse.getY();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:9,代码来源:Input.java

示例15: getMouseY

import org.lwjgl.input.Mouse; //导入方法依赖的package包/类
/**
 * Get the y position of the mouse cursor
 * 
 * @return The y position of the mouse cursor
 */
public int getMouseY() {
	return (int) (((height-Mouse.getY()) * scaleY)+yoffset);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:9,代码来源:Input.java


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