Advertisement
Olivki

Gui.Java stuff

Mar 31st, 2012
3,169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 9.12 KB | None | 0 0
  1.     public static void drawBorderedRect(int x, int y, int x1, int y1, int size, int borderC, int insideC) {
  2.         drawVerticalLine(x, y, y1 -1, borderC);
  3.         drawVerticalLine(x1 - 1, y, y1 - 1, borderC);
  4.         drawHorizontalLine(x, x1 - 1, y, borderC);
  5.         drawHorizontalLine(x, x1 - 1, y1 -1, borderC);
  6.         drawRect(x + size, y + size, x1 - size, y1 - size, insideC);
  7.     }
  8.    
  9.     public static void drawWBorderedRect(int x, int y, int x1, int y1, int size, int borderC, int insideC) {
  10.         drawVerticalLine(x, y, y1 -1, borderC);
  11.         drawVerticalLine(x1 - 1, y, y1 - 1, borderC);
  12.         drawHorizontalLine(x + 1, x1 - 2, y, borderC);
  13.         drawHorizontalLine(x + 1, x1 - 2, y1 -1, borderC);
  14.         drawRect(x + size, y + size, x1 - size, y1 - size, insideC);
  15.     }
  16.    
  17.     public static void drawWHollowBorderedRect(int x, int y, int x1, int y1, int size, int borderC) {
  18.         drawVerticalLine(x, y, y1 -1, borderC);
  19.         drawVerticalLine(x1 - 1, y, y1 - 1, borderC);
  20.         drawHorizontalLine(x + 1, x1 - 2, y, borderC);
  21.         drawHorizontalLine(x + 1, x1 - 2, y1 -1, borderC);
  22.     }
  23.    
  24.     public void drawBorderedGradientRect(int x, int y, int x1, int y1, int size, int borderC, int insideC1, int insideC2) {
  25.         drawVerticalLine(x, y, y1 -1, borderC);
  26.         drawVerticalLine(x1 - 1, y, y1 - 1, borderC);
  27.         drawHorizontalLine(x, x1 - 1, y, borderC);
  28.         drawHorizontalLine(x, x1 - 1, y1 -1, borderC);
  29.         drawGradientRect(x + size, y + size, x1 - size, y1 - size, insideC1, insideC2);
  30.     }
  31.    
  32.     public void drawWBorderedGradientRect(int x, int y, int x1, int y1, int size, int borderC, int insideC1, int insideC2) {
  33.         drawVerticalLine(x, y, y1 -1, borderC);
  34.         drawVerticalLine(x1 - 1, y, y1 - 1, borderC);
  35.         drawHorizontalLine(x + 1, x1 - 2, y, borderC);
  36.         drawHorizontalLine(x + 1, x1 - 2, y1 -1, borderC);
  37.         drawGradientRect(x + size, y + size, x1 - size, y1 - size, insideC1, insideC2);
  38.     }
  39.    
  40.     public static void drawBorderedNTGradientRect(int x, int y, int x1, int y1, int size, int borderC, int insideC1, int insideC2) {
  41.         drawVerticalLine(x, y, y1 -1, borderC);
  42.         drawVerticalLine(x1 - 1, y, y1 - 1, borderC);
  43.         drawHorizontalLine(x, x1 - 1, y, borderC);
  44.         drawHorizontalLine(x, x1 - 1, y1 -1, borderC);
  45.         drawNTGradientRect(x + size, y + size, x1 - size, y1 - size, insideC1, insideC2);
  46.     }
  47.    
  48.     public static void drawWBorderedNTGradientRect(int x, int y, int x1, int y1, int size, int borderC, int insideC1, int insideC2) {
  49.         drawVerticalLine(x, y, y1 -1, borderC);
  50.         drawVerticalLine(x1 - 1, y, y1 - 1, borderC);
  51.         drawHorizontalLine(x + 1, x1 - 2, y, borderC);
  52.         drawHorizontalLine(x + 1, x1 - 2, y1 -1, borderC);
  53.         drawNTGradientRect(x + size, y + size, x1 - size, y1 - size, insideC1, insideC2);
  54.     }
  55.    
  56.     public static void drawNTGradientRect(int x, int y, int x1, int y1, int insideC1, int insideC2) {
  57.         for(int Loop = -5; Loop < 40; Loop++){
  58.         drawGradientRect(x, y, x1, y1, insideC1, insideC2);
  59.         }
  60.     }
  61.    
  62.     public void drawBorderedRectWithString(String s, int x, int y, int x1, int y1, int size, int borderC, int insideC, int SC) {
  63.         drawVerticalLine(x, y, y1 -1, borderC);
  64.         drawVerticalLine(x1 - 1, y, y1 - 1, borderC);
  65.         drawHorizontalLine(x, x1 - 1, y, borderC);
  66.         drawHorizontalLine(x, x1 - 1, y1 -1, borderC);
  67.         drawRect(x + size, y + size, x1 - size, y1 - size, insideC);
  68.        
  69.         int S1 = ((x1 - x) / 2);
  70.         int S2 = ((x1 - S1) - Minecraft.fontRenderer.getStringWidth(s) / 2);
  71.         int S3 = ((y1 - y) / 2);
  72.         int S4 = (y1 - S3);
  73.         Minecraft.fontRenderer.drawString(s, S2, S4 - 4, SC);
  74.     }
  75.    
  76.     public void drawBorderedGradientRectWithString(String s, int x, int y, int x1, int y1, int size, int borderC, int insideC1, int insideC2, int SC) {
  77.         drawVerticalLine(x, y, y1 -1, borderC);
  78.         drawVerticalLine(x1 - 1, y, y1 - 1, borderC);
  79.         drawHorizontalLine(x, x1 - 1, y, borderC);
  80.         drawHorizontalLine(x, x1 - 1, y1 -1, borderC);
  81.         drawGradientRect(x + size, y + size, x1 - size, y1 - size, insideC1, insideC2);
  82.        
  83.         int S1 = ((x1 - x) / 2);
  84.         int S2 = ((x1 - S1) - Minecraft.fontRenderer.getStringWidth(s) / 2);
  85.         int S3 = ((y1 - y) / 2);
  86.         int S4 = (y1 - S3);
  87.         Minecraft.fontRenderer.drawString(s, S2, S4 - 4, SC);
  88.     }
  89.    
  90.     public void drawBorderedNTGradientRectWithString(String s, int x, int y, int x1, int y1, int size, int borderC, int insideC1, int insideC2, int SC) {
  91.         drawVerticalLine(x, y, y1 -1, borderC);
  92.         drawVerticalLine(x1 - 1, y, y1 - 1, borderC);
  93.         drawHorizontalLine(x, x1 - 1, y, borderC);
  94.         drawHorizontalLine(x, x1 - 1, y1 -1, borderC);
  95.         drawNTGradientRect(x + size, y + size, x1 - size, y1 - size, insideC1, insideC2);
  96.        
  97.         int S1 = ((x1 - x) / 2);
  98.         int S2 = ((x1 - S1) - Minecraft.fontRenderer.getStringWidth(s) / 2);
  99.         int S3 = ((y1 - y) / 2);
  100.         int S4 = (y1 - S3);
  101.         Minecraft.fontRenderer.drawString(s, S2, S4 - 4, SC);
  102.     }
  103.    
  104.     public void drawWBorderedNTGradientRectWithString(String s, int x, int y, int x1, int y1, int size, int borderC, int insideC1, int insideC2, int SC) {
  105.         drawVerticalLine(x, y, y1 -1, borderC);
  106.         drawVerticalLine(x1 - 1, y, y1 - 1, borderC);
  107.         drawHorizontalLine(x + 1, x1 - 2, y, borderC);
  108.         drawHorizontalLine(x + 1, x1 - 2, y1 -1, borderC);
  109.         drawNTGradientRect(x + size, y + size, x1 - size, y1 - size, insideC1, insideC2);
  110.        
  111.         int S1 = ((x1 - x) / 2);
  112.         int S2 = ((x1 - S1) - Minecraft.fontRenderer.getStringWidth(s) / 2);
  113.         int S3 = ((y1 - y) / 2);
  114.         int S4 = (y1 - S3);
  115.         Minecraft.fontRenderer.drawString(s, S2, S4 - 4, SC);
  116.     }
  117.    
  118.     public void drawRectGui(String s, int X, int Y, boolean F){
  119.     drawRect(X, Y, X + 80, Y + 12, 0x43000000);
  120.     drawRect(X + 80, Y, X + 86, Y + 12, F ? 0xF900FF00 : 0xF9FF0000);
  121.     Minecraft.fontRenderer.drawString(s, X + 3, Y + 2, 0xFFFFFF);
  122.     }
  123.    
  124.     public void drawBorderedRectGui(String s, int X, int Y, boolean F){
  125.     drawBorderedRect(X, Y, X + 80, Y + 12, 1, 0xFF000000, 0x43000000);
  126.     drawRect(X + 80, Y, X + 86, Y + 12, F ? 0xF900FF00 : 0xF9FF0000);
  127.     Minecraft.fontRenderer.drawString(s, X + 3, Y + 2, 0xFFFFFF);
  128.     }
  129.    
  130.     public void drawBorderedRectGuiArraylist(String s, int X, int Y){
  131.     drawBorderedRect(X, Y, X + 80, Y + 12, 1, 0xFF000000, 0x43000000);
  132.     Minecraft.fontRenderer.drawString(s, X + 3, Y + 2, 0xFFFFFF);
  133.     }
  134.    
  135.     public void drawBorderedNTGradientRectGuiArraylist(String s, int X, int Y, int X1){
  136.     drawWBorderedNTGradientRect(X, Y, X1 + 4, Y + 12, 1, 0xFF3D3D3D, 0x21218359, 0xFF093604);
  137.    
  138.     int S1 = ((X1 - X) / 2);
  139.     int S2 = ((X1 - S1) - Minecraft.fontRenderer.getStringWidth(s) / 2);
  140.     int S3 = ((Y + 12 - Y) / 2);
  141.     int S4 = (Y + 12 - S3);
  142.     Minecraft.fontRenderer.drawString(s, S2, S4 - 4, 0xD9D9D9);
  143.     }
  144.  
  145. /*MORE STUFF*/
  146.  
  147.     public static void drawMoreRoundedBorderedRect(int x, int y, int x1, int y1, int size, int borderC, int insideC) {
  148.         drawVerticalLine(x, y + 1, y1 -2, borderC);
  149.         drawVerticalLine(x1 - 1, y + 1, y1 - 2, borderC);
  150.         drawHorizontalLine(x + 2, x1 - 3, y, borderC);
  151.         drawHorizontalLine(x + 2, x1 - 3, y1 -1, borderC);
  152.         drawHorizontalLine(x + 1, x + 1, y + 1, borderC);
  153.         drawHorizontalLine(x1 - 2, x1 - 2, y + 1, borderC);
  154.         drawHorizontalLine(x1 - 2, x1 - 2, y1 - 2, borderC);
  155.         drawHorizontalLine(x + 1, x + 1, y1 - 2, borderC);
  156.         drawRect(x + size, y + size, x1 - size, y1 - size, insideC);
  157.     }
  158.  
  159. /*Credits to AceOfDiamonds21 for this one*/
  160.  
  161.    protected void drawSideGradientRect(int i, int j, int k, int l, int i1, int j1)
  162.     {
  163.         float f = (float)(i1 >> 24 & 0xff) / 255F;
  164.         float f1 = (float)(i1 >> 16 & 0xff) / 255F;
  165.         float f2 = (float)(i1 >> 8 & 0xff) / 255F;
  166.         float f3 = (float)(i1 & 0xff) / 255F;
  167.         float f4 = (float)(j1 >> 24 & 0xff) / 255F;
  168.         float f5 = (float)(j1 >> 16 & 0xff) / 255F;
  169.         float f6 = (float)(j1 >> 8 & 0xff) / 255F;
  170.         float f7 = (float)(j1 & 0xff) / 255F;
  171.         GL11.glDisable(3553 /*GL_TEXTURE_2D*/);
  172.         GL11.glEnable(3042 /*GL_BLEND*/);
  173.         GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
  174.         GL11.glBlendFunc(770, 771);
  175.         GL11.glShadeModel(7425 /*GL_SMOOTH*/);
  176.         Tessellator tessellator = Tessellator.instance;
  177.         tessellator.startDrawingQuads();
  178.         tessellator.setColorRGBA_F(f1, f2, f3, f);
  179.         tessellator.addVertex(k, j, zLevel);
  180.         tessellator.setColorRGBA_F(f5, f6, f7, f4);
  181.         tessellator.addVertex(i, j, zLevel);
  182.         tessellator.addVertex(i, l, zLevel);
  183.         tessellator.setColorRGBA_F(f1, f2, f3, f);
  184.         tessellator.addVertex(k, l, zLevel);
  185.         tessellator.draw();
  186.         GL11.glShadeModel(7424 /*GL_FLAT*/);
  187.         GL11.glDisable(3042 /*GL_BLEND*/);
  188.         GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
  189.         GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
  190.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement