List of usage examples for org.lwjgl.opengl GL11 glColor4f
public static native void glColor4f(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha);
From source file:cn.lambdacraft.crafting.client.gui.GuiGenFire.java
License:Open Source License
@Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glPushMatrix();/* w w w .j a v a 2 s .c o m*/ GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); bindTexture(ClientProps.GUI_GENFIRE_PATH); int x = (width - xSize) / 2; int y = (height - ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); int len = 0; if (te.maxBurnTime > 0) { len = te.tickLeft * 39 / te.maxBurnTime; this.drawTexturedModalRect(x + 109, y + 52, 173, 0, len, 3); } len = te.currentEnergy * 50 / te.maxStorage; if (len > 0) this.drawTexturedModalRect(x + 75, y + 65 - len, 173, 55 - len, 14, len); this.drawElements(); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); }
From source file:cn.lambdacraft.crafting.client.gui.GuiGenLava.java
License:Open Source License
@Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); String guiName = CBCBlocks.genLava.getLocalizedName(); this.fontRenderer.drawString(guiName, 7, 7, 0xff9944); super.drawGuiContainerForegroundLayer(par1, par2); }
From source file:cn.lambdacraft.crafting.client.gui.GuiGenLava.java
License:Open Source License
@Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glPushMatrix();//from w w w. j a v a 2s .c o m GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); bindTexture(ClientProps.GUI_GENLAVA_PATH); int x = (width - xSize) / 2; int y = (height - ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); int len = 0; len = te.bucketCnt * 47 / te.maxStorage; len += Math.round(2.35F * te.currentEnergy / TileGeneratorLava.ENERGY_PER_BUCKET); this.drawTexturedModalRect(x + 91, y + 65 - len, 173, 59 - len, 6, len); this.drawElements(); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); }
From source file:cn.lambdacraft.crafting.client.gui.GuiGenSolar.java
License:Open Source License
@Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); String guiName = CBCBlocks.genSolar.getLocalizedName(); this.fontRenderer.drawString(EnumChatFormatting.GOLD + guiName, 7, 7, 0xff9944); super.drawGuiContainerForegroundLayer(par1, par2); }
From source file:cn.lambdacraft.crafting.client.gui.GuiGenSolar.java
License:Open Source License
@Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glPushMatrix();/*w ww .j a va 2 s .co m*/ GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); bindTexture(ClientProps.GUI_GENSOLAR_PATH); int x = (width - xSize) / 2; int y = (height - ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); int len = 0; len = te.currentEnergy * 48 / te.maxStorage; if (len > 0) this.drawTexturedModalRect(x + 24, y + 52, 174, 70, len, 7); if (te.worldObj.isDaytime()) { this.drawTexturedModalRect(x + 13, y + 19, 173, 0, 60, 30); this.drawTexturedModalRect(x + 86, y + 44, 186, 9, 5, 5); } else { this.drawTexturedModalRect(x + 13, y + 19, 173, 34, 60, 30); this.drawTexturedModalRect(x + 86, y + 44, 186, 44, 5, 5); } this.drawElements(); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); }
From source file:cn.lambdacraft.crafting.client.gui.GuiWeaponCrafter.java
License:Open Source License
@Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { if (!this.te.isLoad) return;// w ww .j av a2 s.c o m GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); bindTexture(ClientProps.GUI_WEAPONCRAFTER_PATH); int x = (width - xSize) / 2; int y = (height - ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); this.drawElements(); int dy = 0; if (te.iconType == CrafterIconType.NOMATERIAL) dy = 60; else if (te.iconType == CrafterIconType.CRAFTING) dy = 16; else dy = 38; drawTexturedModalRect(x + 160, y + 16, 232, dy, 8, 18); int height = te.heatForRendering * 64 / te.maxHeat; if (height > 0) { drawTexturedModalRect(x + 174, y + 78 - height, 232, 150 - height, 8, height); } if (te.heatRequired > 0) { if (te.currentRecipe != null) { height = te.currentRecipe.heatRequired * 64 / te.maxHeat; drawTexturedModalRect(x + 173, y + 77 - height, 201, 1, 6, 3); } } if (te.maxBurnTime != 0) { height = te.burnTimeLeft * 22 / te.maxBurnTime; if (height > 0) drawTexturedModalRect(x + 156, y + 78 - height, 211, 101 - height, 16, height); } }
From source file:cn.lambdacraft.deathmatch.client.gui.GuiArmorCharger.java
License:Open Source License
@Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); String blockName = EnumChatFormatting.DARK_GRAY + StatCollector.translateToLocal(DMBlocks.armorCharger.getLocalizedName()); fontRenderer.drawString(blockName, 88 - fontRenderer.getStringWidth(blockName) / 2, 5, 0x969494); super.drawGuiContainerForegroundLayer(par1, par2); }
From source file:cn.lambdacraft.deathmatch.client.gui.GuiArmorCharger.java
License:Open Source License
@Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(ClientProps.GUI_ARMORCHARGER_PATH); int x = (width - xSize) / 2; int y = (height - ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); this.drawElements(); int length = te.currentEnergy * 64 / TileArmorCharger.ENERGY_MAX; this.drawTexturedModalRect(x + 80, y + 28, 176, 0, length, 10); if (te.isCharging) { int height = (int) (te.worldObj.getWorldTime() % 43); this.drawTexturedModalRect(x + 29, y + 21, 176, 56, 43, height); }//from w ww . ja v a2s .com }
From source file:cn.lambdacraft.deathmatch.client.gui.GuiHealthCharger.java
License:Open Source License
@Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(ClientProps.GUI_HECHARGER_PATH); int x = (width - xSize) / 2; int y = (height - ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); this.drawElements(); if (te.currentEnergy > 0) { int len = te.currentEnergy * 48 / TileHealthCharger.ENERGY_MAX; this.drawTexturedModalRect(x + 154, y + 55 - len, 176, 93 - len, 5, len); }//from ww w. j av a 2s . c o m if (te.mainEff > 0) { int len = te.mainEff * 46 / TileHealthCharger.HEALTH_MAX; this.drawTexturedModalRect(x + 20, y + 54 - len, 176, 46 - len, 14, len); } if (te.sideEff > 0) { int len = te.sideEff * 46 / TileHealthCharger.EFFECT_MAX; this.drawTexturedModalRect(x + 42, y + 54 - len, 176, 140 - len, 14, len); } if (te.prgAddMain > 0) { int len = te.prgAddMain * 17 / TileHealthCharger.PROGRESS_TIME; this.drawTexturedModalRect(x + 36, y + 77 - len, 176, 157 - len, 14, len); } if (te.prgAddSide > 0) { int len = te.prgAddSide * 17 / TileHealthCharger.PROGRESS_TIME; this.drawTexturedModalRect(x + 58, y + 77 - len, 176, 157 - len, 14, len); } }
From source file:cn.lambdacraft.deathmatch.client.gui.GuiMedFiller.java
License:Open Source License
@Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); // String blockName = DMBlocks.medkitFiller.getLocalizedName(); String blockName = DMBlocks.medkitFiller.getLocalizedName(); fontRenderer.drawString(EnumChatFormatting.RED + blockName, 100 - fontRenderer.getStringWidth(blockName) / 2, 2, 0xffffff); blockName = StatCollector.translateToLocal("container.inventory"); fontRenderer.drawString(EnumChatFormatting.DARK_GRAY + blockName, 8, 85, 0xffffff); super.drawGuiContainerForegroundLayer(par1, par2); }