Advertisement
Guest User

Untitled

a guest
Feb 9th, 2015
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.29 KB | None | 0 0
  1. package com.nextlevelminecraft.cad435.ClientDependencies.GUI.GliderGui;
  2.  
  3. import com.nextlevelminecraft.cad435.ClientDependencies.libs.Shifty;
  4. import net.minecraft.client.Minecraft;
  5. import net.minecraft.client.gui.ScaledResolution;
  6. import net.minecraft.client.gui.inventory.GuiContainer;
  7. import net.minecraft.entity.player.InventoryPlayer;
  8. import net.minecraft.util.ResourceLocation;
  9. import org.lwjgl.opengl.GL11;
  10.  
  11.  
  12. //Drawing the gui
  13. public class GliderGui extends GuiContainer
  14. {
  15.     ResourceLocation BG, Inv;
  16.  
  17.     public GliderGui(InventoryPlayer inventoryPlayer)
  18.     {
  19.         super(new GliderGuiContainer(inventoryPlayer));
  20.         BG = new ResourceLocation("morestuff","textures/gui/GliderGui.png");
  21.         Inv = new ResourceLocation("minecraft","textures/gui/container/inventory.png");
  22.     }
  23.  
  24.  
  25.     @Override
  26.     protected void drawGuiContainerForegroundLayer(int param1, int param2)
  27.     {
  28.     }
  29.  
  30.     int m_width, expXSize,x,y;
  31.     @Override
  32.     protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
  33.     {
  34.  
  35.  
  36.         m_width = width / 2;
  37.  
  38.         expXSize = (int) (1.78 * ySize);
  39.  
  40.         x = (width - expXSize) / 2;
  41.         y = (height - ySize) / 2;
  42.  
  43.  
  44.         //Unteres SpielerInventar
  45.  
  46.         GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  47.         this.mc.getTextureManager().bindTexture(field_147001_a);
  48.         int k = this.guiLeft;
  49.         int l = this.guiTop+24;
  50.         mc.renderEngine.bindTexture(Inv);
  51.         this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
  52.  
  53.         //breite = 1.78*höhe
  54.  
  55.         //Blaupause
  56.         mc.renderEngine.bindTexture(BG);
  57.  
  58.         GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
  59.         GL11.glPushMatrix();
  60.  
  61.         GL11.glTranslatef(33, -28, 0);
  62.  
  63.         GL11.glBegin(GL11.GL_QUADS);
  64.  
  65.         GL11.glTexCoord2f(0f, 0f); // top left
  66.         GL11.glVertex2f(x, y);
  67.  
  68.         GL11.glTexCoord2f(0f, 1f); // bottom left
  69.         GL11.glVertex2f(x, y + ySize * 0.8f);
  70.  
  71.         GL11.glTexCoord2f(1f, 1f); // bottom right
  72.         GL11.glVertex2f(x + xSize * 1.28f, y + ySize * 0.8f);
  73.  
  74.         GL11.glTexCoord2f(1f, 0f); // top right
  75.         GL11.glVertex2f(x + xSize * 1.28f, y);
  76.  
  77.         GL11.glEnd();
  78.  
  79.         GL11.glPopAttrib();
  80.         GL11.glPopMatrix();
  81.  
  82.  
  83.     }
  84.  
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement