本文整理汇总了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;
}
}
示例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();
}
}
示例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};
}
示例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();
}
}
}
示例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;
}
示例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) {
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}