public class GuiButtonItem<T> extends GuiButton { protected static final GuiElement GUI_Button_pressed = new GuiElement(144, 216, 18, 18, 256, 256); protected static final GuiElement GUI_Button_normal = new GuiElement(144 + 18 * 2, 216, 18, 18, 256, 256); protected static final GuiElement GUI_Button_hover = new GuiElement(144 + 18 * 4, 216, 18, 18, 256, 256); guiPressed.draw(x, y); guiHover.draw(x, y); guiNormal.draw(x, y);
@Override protected void drawIcon(Minecraft mc) { mc.getTextureManager().bindTexture(Icons.ICON); Icons.ICON_Anvil.draw(x, y); }
private static GuiElement topLeft = new GuiElement(0,0, 4, 4, 256,256); private static GuiElement topRight = new GuiElement(resW+4,0, 4, 4); private static GuiElement botLeft = new GuiElement(0, resH+4, 4, 4); private static GuiElement botRight = new GuiElement(resW+4, resH+4, 4, 4); private static GuiElement sliderNormal = new GuiElement(0, 83, 3, 5); private static GuiElement sliderHover = sliderNormal.shift(sliderNormal.w, 0); private static GuiElement sliderTop = new GuiElement(3, 88, 3, 4); private static GuiElement sliderBot = new GuiElement(3, 92, 3, 4);
public class GuiTinkerTabs extends GuiModule { protected static final GuiElement GUI_Tab = new GuiElement(0, 2, 28, 28, 256, 256); protected static final GuiElement GUI_TabActiveL = new GuiElement(0, 32, 28, 32, 256, 256); protected static final GuiElement GUI_TabActiveC = new GuiElement(28, 32, 28, 32, 256, 256); protected static final GuiElement GUI_TabActiveR = new GuiElement(140, 32, 28, 32, 256, 256);
public GuiElement(int x, int y, int w, int h) { this.x = x; this.y = y; this.w = w; this.h = h; setTextureSize(defaultTexW, defaultTexH); }
protected void drawIcon(Slot slot, GuiElement element) { this.mc.getTextureManager().bindTexture(Icons.ICON); element.draw(slot.xPos + this.cornerX - 1, slot.yPos + this.cornerY - 1); }
public GuiElement get(int x, int y, int w, int h) { return new GuiElement(x, y, w, h, this.w, this.h); } }
public GuiElement(int x, int y, int w, int h, int texW, int texH) { this(x, y, w, h); setTextureSize(texW, texH); defaultTexW = texW; defaultTexH = texH; }
private static final GuiElement TextFieldActive = new GuiElement(0, 210, 102, 12, 256, 256); private static final GuiElement ItemCover = new GuiElement(176, 18, 80, 64); private static final GuiElement SlotBackground = new GuiElement(176, 0, 18, 18); private static final GuiElement SlotBorder = new GuiElement(194, 0, 18, 18); private static final GuiElement SlotSpaceTop = new GuiElement(0, 174 + 2, 18, 2); private static final GuiElement SlotSpaceBottom = new GuiElement(0, 174, 18, 2); private static final GuiElement PanelSpaceL = new GuiElement(0, 174, 5, 4); private static final GuiElement PanelSpaceR = new GuiElement(9, 174, 9, 4); private static final GuiElement BeamLeft = new GuiElement(0, 180, 2, 7); private static final GuiElement BeamRight = new GuiElement(131, 180, 2, 7); private static final GuiElementScalable BeamCenter = new GuiElementScalable(2, 180, 129, 7); protected GuiElement beamL = new GuiElement(0, 0, 0, 0); protected GuiElement beamR = new GuiElement(0, 0, 0, 0); protected GuiElementScalable beamC = new GuiElementScalable(0, 0, 0, 0); TextFieldActive.draw(cornerX + 68, cornerY + 6); Icons.ICON_Anvil.draw(logoX, logoY); ItemCover.draw(this.cornerX + 7, this.cornerY + 18); for(int i = 0; i < activeSlots; i++) { Slot slot = inventorySlots.getSlot(i); SlotBackground.draw(x + this.cornerX + slot.xPos - 1, y + this.cornerY + slot.yPos - 1); Slot slot = inventorySlots.getSlot(i);
@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() } }
public GuiElement shift(int xd, int yd) { return new GuiElement(this.x + xd, this.y + yd, this.w, this.h, this.texW, this.texH); }
public class GuiTinkerTank extends GuiContainer implements IGuiLiquidTank { protected GuiElement scala = new GuiElement(122, 0, 106, 106, 256, 256); scala.draw(8, 16);
@Override @SideOnly(Side.CLIENT) public void renderHUDEffect(int x, int y, PotionEffect effect, Minecraft mc, float alpha) { mc.getTextureManager().bindTexture(Icons.ICON); GuiElement element; switch(effect.getAmplifier()) { case 0: element = Icons.ICON_PIGGYBACK_1; break; case 1: element = Icons.ICON_PIGGYBACK_2; break; case 2: element = Icons.ICON_PIGGYBACK_3; break; default: element = Icons.ICON_PIGGYBACK_3; break; } element.draw(x + 6, y + 7); } }
protected GuiElement overlapBottomLeft = GuiGeneric.overlapBottomLeft; protected GuiElement overlapBottomRight = GuiGeneric.overlapBottomRight; protected GuiElement overlapTop = new GuiElement(7, 0, 7, 7, 64, 64); // same as borderTop but only 7 wide
protected GuiElement scala = new GuiElement(176, 76, 52, 52, 256, 256); scala.draw(8 + cornerX, 16 + cornerY);
@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); } }