Пример #1
0
  protected void drawLedgers() {

    int xPos = 8;
    for (Ledger ledger : ledgers) {

      ledger.update();
      if (!ledger.isVisible()) continue;

      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      ledger.draw(gui.getSizeX(), xPos);
      xPos += ledger.getHeight();
    }
  }
Пример #2
0
  protected Ledger getAtPosition(int mX, int mY) {

    int xShift = ((gui.width - gui.getSizeX()) / 2) + gui.getSizeX();
    int yShift = ((gui.height - gui.getSizeY()) / 2) + 8;

    for (int i = 0; i < ledgers.size(); i++) {
      Ledger ledger = ledgers.get(i);
      if (!ledger.isVisible()) continue;

      ledger.currentShiftX = xShift;
      ledger.currentShiftY = yShift;
      if (ledger.intersectsWith(mX, mY, xShift, yShift)) return ledger;

      yShift += ledger.getHeight();
    }

    return null;
  }