org.lwjgl.input.Mouse.getY()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中org.lwjgl.input.Mouse.getY()方法的一些代码示例,展示了Mouse.getY()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mouse.getY()方法的具体详情如下:
包路径:org.lwjgl.input.Mouse
类名称:Mouse
方法名:getY

Mouse.getY介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

public int getY () {
  return Gdx.graphics.getHeight() - 1 - (int)(Mouse.getY() * Display.getPixelScaleFactor());
}

代码示例来源:origin: libgdx/libgdx

public int getY () {
  return Gdx.graphics.getHeight() - 1 - (int)(Mouse.getY() * Display.getPixelScaleFactor());
}

代码示例来源:origin: MovingBlocks/Terasology

@Override
public Vector2i getPosition() {
  return new Vector2i(Mouse.getX() / this.uiScale, (Display.getHeight() - Mouse.getY()) / this.uiScale);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

/**
 * Send the input listener a special mouse-motion event with zero deltas in
 * order to initialize the listener's cursor position.
 */
private void sendFirstMouseEvent() {
  assert listener != null;
  assert Mouse.isCreated();
  int x = Mouse.getX();
  int y = Mouse.getY();
  int xDelta = 0;
  int yDelta = 0;
  int wheelDelta = 0;
  MouseMotionEvent evt = new MouseMotionEvent(x, y, xDelta, yDelta,
      curWheel, wheelDelta);
  evt.setTime(Mouse.getEventNanoseconds());
  listener.onMouseMotionEvent(evt);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

int yDelta = Mouse.getEventDY();
int x = Mouse.getX();
int y = Mouse.getY();

代码示例来源:origin: org.slick2d/slick2d-core

/**
 * 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() - 1;
}

代码示例来源:origin: AntiqueAtlasTeam/AntiqueAtlas

protected int getMouseY() {
    return height - Mouse.getY() * height / mc.displayHeight - 1;
  }
}

代码示例来源:origin: iLexiconn/LLibrary

public float getPreciseMouseY() {
  return this.height - (float) Mouse.getY() * this.height / (float) this.mc.displayHeight - 1.0F;
}

代码示例来源:origin: Vazkii/Botania

int sh = res.getScaledHeight();
x = Mouse.getX() * sw / mc.displayWidth;
y = sh - Mouse.getY() * sh / mc.displayHeight - 1;

代码示例来源:origin: mezz/JustEnoughItems

public int getY() {
    int j = scaledresolution.getScaledHeight();
    return j - Mouse.getY() * j / displayHeight - 1;
  }
}

代码示例来源:origin: SlimeKnights/Mantle

protected int getMouseY() {
 return (int) ((this.height - Mouse.getY() * this.height / this.mc.displayHeight - 1 - topOffset()) / PAGE_SCALE);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl

public int getY () {
  return Gdx.graphics.getHeight() - 1 - (int)(Mouse.getY() * Display.getPixelScaleFactor());
}

代码示例来源:origin: OpenMods/OpenModsLib

private static Vec3d getMouseVector(float z) {
  return projectionHelper.unproject(Mouse.getX(), Mouse.getY(), z);
}

代码示例来源:origin: Chisel-Team/Chisel

@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
  super.mouseClicked(mouseX, mouseY, mouseButton);
  if (!buttonRotate.isMouseOver() && panel.contains(mouseX - guiLeft, mouseY - guiTop)) {
    clickButton = mouseButton;
    panelClicked = true;
    clickX = Mouse.getX();
    clickY = Mouse.getY();
  }
}

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

@Override
  protected void onPressed() {
    getContainer().removeSlots();
    Minecraft.getMinecraft().displayGuiScreen(new GuiResearchStationSelection(GuiResearchStation.this, Mouse.getX(), Mouse.getY()));
  }
};

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

@Override
protected boolean onGuiCloseRequested() {
  getContainer().addSlots();
  int x = Mouse.getX();
  int y = Mouse.getY();
  Minecraft.getMinecraft().displayGuiScreen(parent);
  Mouse.setCursorPosition(x, y);
  return false;
}

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

@Override
  protected void onPressed() {
    getContainer().removeSlots();
    int x = Mouse.getX();
    int y = Mouse.getY();
    Minecraft.getMinecraft().displayGuiScreen(new GuiMailboxNameSelect(GuiMailboxInventory.this, true));
    Mouse.setCursorPosition(x, y);
  }
};

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

@Override
  protected void onPressed() {
    getContainer().removeSlots();
    int x = Mouse.getX();
    int y = Mouse.getY();
    Minecraft.getMinecraft().displayGuiScreen(new GuiMailboxNameSelect(GuiMailboxInventory.this, false));
    Mouse.setCursorPosition(x, y);
  }
};

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

@Override
  protected void onPressed() {
    getContainer().removeSlots();
    int x = Mouse.getX();
    int y = Mouse.getY();
    Minecraft.getMinecraft().displayGuiScreen(new GuiMailboxInventorySideSetup(GuiMailboxInventory.this));
    Mouse.setCursorPosition(x, y);
  }
};

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

@Override
protected boolean onGuiCloseRequested() {
  getContainer().addSlots();
  getContainer().setGui(parent);
  int x = Mouse.getX();
  int y = Mouse.getY();
  Minecraft.getMinecraft().displayGuiScreen(parent);
  Mouse.setCursorPosition(x, y);
  return false;
}

相关文章