Exemplo n.º 1
0
  @Override
  protected void layoutWidgets() {
    int top = 10;

    int swidth = mc.fontRenderer.getStringWidth(title.getText());
    title.setY(top).setX(width / 2 - swidth / 2).setHeight(11).setWidth(swidth);

    scroll.setGeometry(5, title.getY() + 16, width - 10, height - title.getY() - 16 - 30);

    buttonDone.setGeometry(width / 2 - 50, height - 25, 100, 20);

    int columnCount = columns.size();
    if (columnCount > 0) {
      int columnWidth = (width - 10 - 16 - (columnCount + 1) * columnMargin) / (columnCount);
      int columnX = columnMargin;
      for (List<Section> column : columns) {
        int sectionY = columnMargin;
        for (Section section : column) {
          section.setX(columnX);
          section.setY(sectionY);
          section.setWidth(columnWidth);
          sectionY += section.getHeight() + sectionMargin;
        }
        columnX += columnWidth + columnMargin;
      }
      scroll.updateInnerSize();
    }
  }
Exemplo n.º 2
0
 @Override
 public void render() {
   int x = (int) getWidthX() - 13 - Spoutcraft.getMinecraftFont().getTextWidth(this.getText());
   this.setX(x).setY((int) (getWidthX() / 5));
   super.render();
 }