protected int drawSlots(int xPos, int yPos) { int width = columns * slot.w; int height = ySize - border.h * 2; int fullRows = (lastSlotId - firstSlotId) / columns; int y; for(y = 0; y < fullRows * slot.h && y < height; y += slot.h) { slot.drawScaledX(xPos, yPos + y, width); } // draw partial row and unused slots int slotsLeft = (lastSlotId - firstSlotId) % columns; if(slotsLeft > 0) { slot.drawScaledX(xPos, yPos + y, slotsLeft * slot.w); // empty slots that don't exist slotEmpty.drawScaledX(xPos + slotsLeft * slot.w, yPos + y, width - slotsLeft * slot.w); } return width; } }
@Override public void draw() { int x = xPos; int y = yPos; // background if(highlighted) { x += leftHighlight.draw(x, y); x += centerHighlight.drawScaledX(x, y, width - left.w - right.w); rightHighlight.draw(x, y); } else { x += left.draw(x, y); x += center.drawScaledX(x, y, width - left.w - right.w); right.draw(x, y); } // text x = xPos + left.w + 1; //fontRenderer.drawStringWithShadow() } }
int y; for(y = 0; y < fullRows * slot.h && y < ySize; y += slot.h) { slot.drawScaledX(guiLeft, guiTop + y, w); slot.drawScaledX(guiLeft, guiTop + y, slotsLeft * slot.w); slotEmpty.drawScaledX(guiLeft + slotsLeft * slot.w, guiTop + y, w - slotsLeft * slot.w);
@Override public void draw() { int x = xPos; int y = yPos; int midW = width - borderLeft.w - borderRight.w; int midH = height - borderTop.h - borderBottom.h; // top row x += cornerTopLeft.draw(x, y); x += borderTop.drawScaledX(x, y, midW); cornerTopRight.draw(x, y); // center row x = xPos; y += borderTop.h; x += borderLeft.drawScaledY(x, y, midH); x += midW; borderRight.drawScaledY(x, y, midH); // bottom row x = xPos; y += midH; x += cornerBottomLeft.draw(x, y); x += borderBottom.drawScaledX(x, y, midW); cornerBottomRight.draw(x, y); } }
public int drawScaled(int xPos, int yPos, int width, int height) { // we draw full height row-wise int full = height / this.h; for(int i = 0; i < full; i++) { drawScaledX(xPos, yPos + i * this.h, width); } yPos += full * this.h; // and the remainder is drawn manually int yRest = height % this.h; // the same as drawScaledX but with the remaining height for(int i = 0; i < width / w; i++) { drawScaledY(xPos + i * w, yPos, yRest); } // remainder that doesn't fit total width int remainder = width % w; if(remainder > 0) { GuiScreen.drawModalRectWithCustomSizedTexture(xPos + width - remainder, yPos, x, y, remainder, yRest, texW, texH); } return width; }
textBackground.drawScaledX(x, y, midW); y += textBackground.h;
x += beamC.drawScaledX(x, y, buttons.xSize); beamR.draw(x, y); x += beamC.drawScaledX(x, y, toolInfo.xSize); beamR.draw(x, y);