@Override protected void drawGuiContainerBackgroundLayer(float f1, int i1, int i2) { ThermalScienceUtil.setTexture(guiTexture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); drawCenteredString( fontRendererObj, getName(), guiLeft + xSize / 2, guiTop + 4, ColorHelper.DYE_WHITE); drawProgress(); drawEnergy(); }
public void drawProgress(int progress, int xOffset, int yOffset) { ThermalScienceUtil.setTexture(ThermalScienceTextures.guiProgressArrowRight); ThermalScienceUtil.drawTexturedModalRect( xOffset + arrowX, yOffset + arrowY, 0, 0, arrowWidth, arrowHeight, 48, 16); if (progress > 0) { int width = Math.round((float) arrowWidth / 100f * (float) progress); ThermalScienceUtil.drawTexturedModalRect( xOffset + arrowX, yOffset + arrowY, 24, 0, width, arrowHeight, 48, 16); } }
public void drawEnergy(int energyStored, int maxEnergyStored, int xOffset, int yOffset) { ThermalScienceUtil.setTexture(ThermalScienceTextures.guiEnergy); ThermalScienceUtil.drawTexturedModalRect( xOffset + energyX, yOffset + energyY, 1, 0, energyWidth, energyHeight, 32, 64); if (energyStored > 0) { int cut = energyHeight - 2 - (int) Math.floor(40f / (float) maxEnergyStored * (float) energyStored); ThermalScienceUtil.drawTexturedModalRect( xOffset + energyX + 1, yOffset + energyY + cut + 1, 18, cut + 1, energyWidth - 2, energyHeight - cut - 2, 32, 64); } }