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

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

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

Mouse.getX介绍

暂无

代码示例

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

public int getX () {
  return (int)(Mouse.getX() * Display.getPixelScaleFactor());
}

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

public int getX () {
  return (int)(Mouse.getX() * 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 xDelta = Mouse.getEventDX();
int yDelta = Mouse.getEventDY();
int x = Mouse.getX();
int y = Mouse.getY();

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

/**
 * Get the absolute x position of the mouse cursor within the container
 * 
 * @return The absolute x position of the mouse cursor
 */
public int getAbsoluteMouseX() {
  return Mouse.getX();
}

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

protected int getMouseX() {
  return Mouse.getX() * width / mc.displayWidth;
}
protected int getMouseY() {

代码示例来源:origin: com.googlecode.apparat/apparat-playerglobal

public double mouseY() { return Mouse.getX(); }
}

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

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

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

public int getX() {
  int i = scaledresolution.getScaledWidth();
  return Mouse.getX() * i / displayWidth;
}

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

protected int getMouseX(boolean rightSide) {
 return (int) ((Mouse.getX() * this.width / this.mc.displayWidth - leftOffset(rightSide)) / PAGE_SCALE);
}

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

public float getPreciseMouseX() {
  ScaledResolution scaledResolution = new ScaledResolution(ClientProxy.MINECRAFT);
  return (float) Mouse.getX() / scaledResolution.getScaleFactor();
}

代码示例来源: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 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();
    Minecraft.getMinecraft().displayGuiScreen(new GuiResearchStationSelection(GuiResearchStation.this, Mouse.getX(), Mouse.getY()));
  }
};

代码示例来源: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;
}

相关文章