use of net.minecraft.client.gui.FontRenderer in project EnderIO by SleepyTrousers.
the class GuiTravelAccessable method drawGuiContainerBackgroundLayer.
@Override
public void drawGuiContainerBackgroundLayer(float f, int i, int j) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
bindGuiTexture();
int sx = (width - xSize) / 2;
int sy = (height - ySize) / 2;
drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize);
int col = ColorUtil.getRGB(Color.white);
int x = sx;
int y = sy + 38;
FontRenderer fr = getFontRenderer();
x = sx + col0x - fr.getStringWidth(privateStr) / 2;
fr.drawStringWithShadow(privateStr, x, y, col);
x = sx + col1x - fr.getStringWidth(protectedStr) / 2;
fr.drawStringWithShadow(protectedStr, x, y, col);
x = sx + col2x - fr.getStringWidth(publicStr) / 2;
fr.drawStringWithShadow(publicStr, x, y, col);
checkLabelForChange();
super.drawGuiContainerBackgroundLayer(f, i, j);
}
use of net.minecraft.client.gui.FontRenderer in project EnderIO by SleepyTrousers.
the class ItemBlockDecoration method doItemOverlayIntoGUI.
@SideOnly(Side.CLIENT)
public static void doItemOverlayIntoGUI(@Nonnull ItemStack stack, int xPosition, int yPosition) {
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
GlStateManager.disableLighting();
GlStateManager.disableDepth();
GlStateManager.disableBlend();
fr.drawStringWithShadow("\"", xPosition, yPosition, 0xFFFFFF);
fr.drawStringWithShadow("\"", xPosition + 19 - 2 - fr.getStringWidth("\""), yPosition, 0xFFFFFF);
GlStateManager.enableLighting();
GlStateManager.enableDepth();
GlStateManager.enableBlend();
}
use of net.minecraft.client.gui.FontRenderer in project EnderIO by SleepyTrousers.
the class GuiZombieGenerator method drawGuiContainerBackgroundLayer.
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
bindGuiTexture();
int sx = (width - xSize) / 2;
int sy = (height - ySize) / 2;
drawTexturedModalRect(sx, sy, 0, 0, xSize, ySize);
TileZombieGenerator gen = getTileEntity();
FontRenderer fr = getFontRenderer();
int output = 0;
if (gen.isActive()) {
output = gen.getPowerUsePerTick();
}
String txt = Lang.GUI_ZOMBGEN_OUTPUT.get(LangPower.RFt(output));
int sw = fr.getStringWidth(txt);
fr.drawStringWithShadow(txt, guiLeft + xSize / 2 - sw / 2, guiTop + fr.FONT_HEIGHT / 2 + 3, ColorUtil.getRGB(Color.WHITE));
int x = guiLeft + 80;
int y = guiTop + 21;
if (!gen.tank.isEmpty()) {
RenderUtil.renderGuiTank(gen.tank.getFluid(), gen.tank.getCapacity(), gen.tank.getFluidAmount(), x, y, zLevel, 16, 47);
if (gen.isActive()) {
txt = LangFluid.tMB(ZombieGenConfig.ticksPerBucketOfFuel.get() / 1000);
sw = fr.getStringWidth(txt);
fr.drawStringWithShadow(txt, x - sw / 2 + 7, y + fr.FONT_HEIGHT / 2 + 46, ColorUtil.getRGB(Color.WHITE));
}
}
bindGuiTexture();
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
}
use of net.minecraft.client.gui.FontRenderer in project EnderIO by SleepyTrousers.
the class AbstractGuiItemFilter method drawGuiContainerBackgroundLayer.
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int mouseX, int mouseY) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
bindGuiTexture();
int sx = (width - xSize) / 2;
int sy = (height - ySize) / 2;
drawTexturedModalRect(sx, sy, 0, 0, xSize, ySize);
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
fr.drawString(getUnlocalisedNameForHeading(), getGuiLeft() + 28, getGuiTop() + 13, ColorUtil.getRGB(Color.DARK_GRAY));
renderCustomOptions(getGuiTop() + 13, par1, mouseX, mouseY);
super.drawGuiContainerBackgroundLayer(par1, mouseX, mouseY);
}
use of net.minecraft.client.gui.FontRenderer in project EnderIO by SleepyTrousers.
the class ModItemFilterGui method renderCustomOptions.
@Override
public void renderCustomOptions(int top, float par1, int par2, int par3) {
FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
for (int i = 0; i < inputBounds.length; i++) {
String mod = filter.getModAt(i);
if (mod != null) {
Rectangle r = inputBounds[i];
mod = fr.trimStringToWidth(mod, tfWidth - 6);
fr.drawStringWithShadow(mod, getGuiLeft() + r.x + 41, getGuiTop() + r.y + 4, MOD_NAME_COLOR);
}
}
}
Aggregations