Search in sources :

Example 36 with FontRenderer

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);
}
Also used : FontRenderer(net.minecraft.client.gui.FontRenderer)

Example 37 with FontRenderer

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();
}
Also used : FontRenderer(net.minecraft.client.gui.FontRenderer) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 38 with FontRenderer

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);
}
Also used : FontRenderer(net.minecraft.client.gui.FontRenderer)

Example 39 with FontRenderer

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);
}
Also used : FontRenderer(net.minecraft.client.gui.FontRenderer)

Example 40 with FontRenderer

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);
        }
    }
}
Also used : Rectangle(java.awt.Rectangle) FontRenderer(net.minecraft.client.gui.FontRenderer)

Aggregations

FontRenderer (net.minecraft.client.gui.FontRenderer)266 ScaledResolution (net.minecraft.client.gui.ScaledResolution)45 Minecraft (net.minecraft.client.Minecraft)39 ItemStack (net.minecraft.item.ItemStack)30 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)13 ArrayList (java.util.ArrayList)12 Tessellator (net.minecraft.client.renderer.Tessellator)11 RenderItem (net.minecraft.client.renderer.RenderItem)10 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)10 EntityPlayer (net.minecraft.entity.player.EntityPlayer)8 BufferBuilder (net.minecraft.client.renderer.BufferBuilder)7 IBlockState (net.minecraft.block.state.IBlockState)6 Block (net.minecraft.block.Block)5 GuiButton (net.minecraft.client.gui.GuiButton)5 List (java.util.List)4 RenderManager (net.minecraft.client.renderer.entity.RenderManager)4 ResourceLocation (net.minecraft.util.ResourceLocation)4 IGuiRect (betterquesting.api2.client.gui.misc.IGuiRect)3 Bounds (ivorius.reccomplex.gui.table.Bounds)3 Item (net.minecraft.item.Item)3