@Override protected void drawGuiContainerBackgroundLayer(float f, int r, int v) { super.drawGuiContainerBackgroundLayer(f, r, v); int j = (width - xSize) / 2; int k = (height - ySize) / 2; }
@Override protected void drawGuiContainerBackgroundLayer(float f, int r, int v) { super.drawGuiContainerBackgroundLayer(f, r, v); int j = (width - xSize) / 2; int k = (height - ySize) / 2; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glEnable(GL11.GL_BLEND); if (mode == AspectMode.DEMAND) { Aspect c = this.getActive(); int sep = 120; double px = 2D * Math.abs(dx) / width; int sp = 4000; // Math.max(1, (int)(6*Math.abs(-(px*px)+2*px))); // dx = // -30;////////////////////////////////////////////////////////////////////////////////////////////////////////REMOVE if (dx > 0) { dx += sp; } if (dx < 0) { dx -= sp; } if (dx >= sep) { dx = 0; index--; this.markButtons(true); } if (dx <= -sep) { dx = 0; index++; this.markButtons(true); } int m = dx != 0 ? 1 : 0; int min = index > 0 ? -m : 0; int max = index < list.size() - 1 ? m : 0; Tessellator v5 = Tessellator.instance; // for (int i = min; i <= max; i++) { int i = 0; int diff = i - index; int a = j + i * sep + dx; Aspect ca = list.get(index + i); ResourceLocation loc = ca.getImage(); mc.renderEngine.bindTexture(loc); v5.startDrawingQuads(); v5.setColorOpaque_I(ca.getColor()); int s = 32; int w = s; int tx = dx + j + xSize / 2 - s / 2 + 50 + i * sep; int ty = k + 42 - s / 2; /* if (diff < 0) { int over = j-a; if (over > 0) { w -= over; //ReikaJavaLibrary.pConsole(ca.getName()+" : "+over); } } else if (diff > 0) { int over = tx+s-xSize-j+16; if (over > 0) { w -= over; //ReikaJavaLibrary.pConsole(ca.getName()+" : "+a+" > "+over); } }*/ float tw = (float) w / s; v5.addVertexWithUV(tx, ty + s, 0, 0, 1); v5.addVertexWithUV(tx + w, ty + s, 0, tw, 1); v5.addVertexWithUV(tx + w, ty, 0, tw, 0); v5.addVertexWithUV(tx, ty, 0, 0, 0); v5.draw(); } // } // ReikaJavaLibrary.pConsole(ca+" > "+c+" > "+cb); GL11.glDisable(GL11.GL_BLEND); }
@Override protected void drawGuiContainerBackgroundLayer(float f, int a, int b) { super.drawGuiContainerBackgroundLayer(f, a, b); }