@Override public void setCursorPosition (int x, int y) { Mouse.setCursorPosition(x, Gdx.graphics.getHeight() - 1 - y); }
@Override public void setCursorPosition (int x, int y) { Mouse.setCursorPosition(x, Gdx.graphics.getHeight() - 1 - y); }
/** * Calculates the absolute mouse coordinates from the scaled ones and sets the cursor accordingly * * @param x * @param y */ private void setAbsoluteMouse(double x, double y) { x = x * this.mc.displayWidth / this.width; y = -(y + 1 - height) * this.mc.displayHeight / height; Mouse.setCursorPosition((int) x, (int) y); }
public void setPosition(final int x, final int y) { init(); Mouse.setCursorPosition(x, y); }
@Override public void setMousePosition(final int x, final int y) { int viewportHeight = getViewportHeight(); Mouse.setCursorPosition(x, viewportHeight - y); }
public GuiResearchStationSelection(GuiResearchStation parent, int x, int y) { super(parent.getContainer(), 400, 240); this.parent = parent; Mouse.setCursorPosition(x, y); }
@Override public void setCursorPosition (int x, int y) { Mouse.setCursorPosition(x, Gdx.graphics.getHeight() - 1 - y); }
@Override protected boolean onGuiCloseRequested() { getContainer().addSlots(); int x = Mouse.getX(); int y = Mouse.getY(); Minecraft.getMinecraft().displayGuiScreen(parent); Mouse.setCursorPosition(x, y); return false; }
@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); } };
@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); } };
@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); } };
@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; }
@Override public void initGui() { super.initGui(); x0 = (xSize - BUTTON_WIDTH) / 2 - SLIDER_WIDTH; y0 = getFontRenderer().FONT_HEIGHT + 28; vertical = new SliderVertical(this, xSize - 6 - SLIDER_WIDTH, y0, SLIDER_WIDTH, NUM_ENTRIES * BUTTON_HEIGHT + (NUM_ENTRIES - 1) * BUTTON_OFFSET, 10); vertical.setVisible(false); addElement(vertical); directoryButtons = new ElementDirectoryButton[NUM_ENTRIES]; for (int i = 0; i < NUM_ENTRIES; i++) { directoryButtons[i] = new ElementDirectoryButton(i, this, x0, y0); addElement(directoryButtons[i]); } Mouse.setCursorPosition((directoryButtons[0].getPosX() + (directoryButtons[0].getWidth() >> 1) + guiLeft) * this.mc.displayWidth / this.width, (this.height - (1 + directoryButtons[0].getPosY() + (directoryButtons[0].getHeight() >> 1) + guiTop + 1)) * this.mc.displayHeight / this.height); final String configText = StringHelper.localize("gui.thermaldynamics.transport.config"); int stringWidth = getFontRenderer().getStringWidth(configText); buttonConfig = new ElementButtonManaged(this, xSize - 12 - stringWidth, 16, stringWidth + 8, 16, configText) { @Override public void onClick() { PacketTileInfo myPayload = container.transportDuct.newPacketTileInfo(); myPayload.addByte(DuctUnitTransport.NETWORK_CONFIG); PacketHandler.sendToServer(myPayload); } }; addElement(buttonConfig); }