Example usage for org.lwjgl.opengl GL11 glColor4f

List of usage examples for org.lwjgl.opengl GL11 glColor4f

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glColor4f.

Prototype

public static native void glColor4f(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green,
        @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha);

Source Link

Document

Float version of #glColor4b Color4b

Usage

From source file:cd4017be.automation.Gui.GuiItemSorter.java

@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.renderEngine.bindTexture(new ResourceLocation("automation", "textures/gui/itemSorter.png"));
    this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
    this.drawItemConfig(tileEntity, -54, 7);
    this.drawStringCentered(tileEntity.getInventoryName(), this.guiLeft + this.xSize / 2, this.guiTop + 4,
            0x404040);//w  ww .  j  av a 2 s  . co  m
    this.drawStringCentered("Inventory", this.guiLeft + this.xSize / 2, this.guiTop + 36, 0x404040);
}

From source file:cd4017be.automation.Gui.GuiItemUpgrade.java

@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.renderEngine.bindTexture(new ResourceLocation("automation", "textures/gui/itemUpgrade.png"));
    this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
    if ((this.container.inventory.upgrade.mode & 1) != 0)
        this.drawTexturedModalRect(this.guiLeft + 52, this.guiTop + 15, 185, 0, 9, 18);
    if ((this.container.inventory.upgrade.mode & 2) != 0)
        this.drawTexturedModalRect(this.guiLeft + 43, this.guiTop + 15, 176, 0, 9, 18);
    if ((this.container.inventory.upgrade.mode & 4) != 0)
        this.drawTexturedModalRect(this.guiLeft + 79, this.guiTop + 24, 212, 9, 18, 9);
    if ((this.container.inventory.upgrade.mode & 8) != 0)
        this.drawTexturedModalRect(this.guiLeft + 79, this.guiTop + 15, 212, 0, 18, 9);
    if ((this.container.inventory.upgrade.mode & 16) != 0)
        this.drawTexturedModalRect(this.guiLeft + 61, this.guiTop + 15, 194, 0, 18, 18);
    if ((this.container.inventory.upgrade.mode & 32) != 0)
        this.drawTexturedModalRect(this.guiLeft + 97, this.guiTop + 15, 212, 18, 18, 18);
    if ((this.container.inventory.upgrade.mode & 64) != 0)
        this.drawTexturedModalRect(this.guiLeft + 115, this.guiTop + 15,
                (this.container.inventory.upgrade.mode & 128) != 0 ? 194 : 176, 18, 18, 18);
    this.drawStringCentered("" + this.container.inventory.upgrade.priority, this.guiLeft + 142,
            this.guiTop + 20, 0x404040);
    this.drawStringCentered(this.container.inventory.getInventoryName(), this.guiLeft + this.xSize / 2,
            this.guiTop + 4, 0x404040);
    this.drawStringCentered("Inventory", this.guiLeft + this.xSize / 2, this.guiTop + 54, 0x404040);
}

From source file:cd4017be.automation.Gui.GuiMatterInterface.java

@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.renderEngine.bindTexture(new ResourceLocation("automation", "textures/gui/matterInterface.png"));
    this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
    int n = list.length <= 6 ? 0 : scroll * 40 / (list.length - 6);
    this.drawTexturedModalRect(this.guiLeft + 160, this.guiTop + 16 + n, 176, 0, 8, 12);
    this.drawTexturedModalRect(this.guiLeft + 7, this.guiTop + 15,
            (tileEntity.netData.ints[0] & 2) == 0 ? 184 : 202, 0, 18, 18);
    this.drawItemConfig(tileEntity, -36, 7);
    for (int i = scroll; i < scroll + 6 && i < list.length; i++) {
        fontRendererObj.drawString(String.format("%d %s", list[i].stackSize, list[i].getDisplayName()),
                this.guiLeft + 70, this.guiTop + 17 + (i - scroll) * 8, 0x7fffff);
    }/*  w w  w.  jav a  2  s  . c o  m*/
    this.drawStringCentered(amount > 0 ? "" + amount : "All", this.guiLeft + 16, this.guiTop + 52, 0x808040);
    this.drawStringCentered(tileEntity.getInventoryName(), this.guiLeft + this.xSize / 2, this.guiTop + 4,
            0x404040);
    this.drawStringCentered("Inventory", this.guiLeft + this.xSize / 2, this.guiTop + 72, 0x404040);
}

From source file:cd4017be.automation.Gui.GuiSlider.java

@Override
protected void mouseDragged(Minecraft par1Minecraft, int x, int y) {
    if (this.visible) {
        if (this.dragging) {
            this.sliderValue = (float) (x - (this.xPosition + 4)) / (float) (this.width - 8);

            if (this.sliderValue < 0) {
                this.sliderValue = 0;
            }/*ww w .j a  v  a2  s  . co  m*/

            if (this.sliderValue > 1) {
                this.sliderValue = 1;
            }

            this.displayString = String.format(formatString,
                    this.sliderValue * (this.maxValue - this.minValue) + this.minValue);
        }

        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.drawTexturedModalRect(this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)),
                this.yPosition, 0, 66, 4, 20);
        this.drawTexturedModalRect(this.xPosition + (int) (this.sliderValue * (float) (this.width - 8)) + 4,
                this.yPosition, 196, 66, 4, 20);
    }
}

From source file:cd4017be.automation.jetpack.TickHandler.java

@SubscribeEvent
public void renderTick(TickEvent.RenderTickEvent event) {
    if (mc.currentScreen == null && event.phase == TickEvent.Phase.END) {
        ItemStack item = mc.thePlayer.getCurrentArmor(ItemJetpack.slotPos);
        if (item == null || !(item.getItem() instanceof ItemJetpack) || item.stackTagCompound == null)
            return;
        NBTTagCompound nbt = item.stackTagCompound;
        if (!nbt.getBoolean("On"))
            return;
        mc.fontRenderer.drawString("Jetpack Control Mode: " + JetPackConfig.getMode().name, 8, 8, 0x40ff40);
        GL11.glColor4f(1, 1, 1, 1);
        mc.renderEngine.bindTexture(new ResourceLocation("automation", "textures/gui/jetpack.png"));
        int hgt = this.getScreenHeight();
        mc.ingameGUI.drawTexturedModalRect(8, (hgt - 176) / 2, 0, 0, 16, 169);
        int n = power * 160 / ItemJetpack.maxPower;
        mc.ingameGUI.drawTexturedModalRect(9, (hgt - 176) / 2 + 161 - n, 16, 160 - n, 6, n);
        if (nbt.getInteger("power") < 0)
            mc.fontRenderer.drawString("Out of Fuel!", 8, (hgt + 176) / 2 - 8, 0xff7f3f);
        Vec3 mov = Vec3.Def(mc.thePlayer.posX - mc.thePlayer.lastTickPosX,
                mc.thePlayer.posY - mc.thePlayer.lastTickPosY, mc.thePlayer.posZ - mc.thePlayer.lastTickPosZ)
                .scale(20D);/*from  ww w .j  av  a 2s.c o m*/
        mc.fontRenderer.drawString(String.format("Speed  = %5.1f m/s", mov.l()), 8, hgt - 48, 0xff3f00);
        mc.fontRenderer.drawString(String.format("Ascent = %+5.1f m/s", mov.y), 8, hgt - 32, 0xff3f00);
        mc.fontRenderer.drawString(String.format("Height = %5.1f m", mc.thePlayer.posY), 8, hgt - 16, 0xff3f00);
    }
}

From source file:chb.mods.mffs.client.GuiAreaDefenseStation.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    int textur = mc.renderEngine.getTexture("/chb/mods/mffs/sprites/GuiDefStation.png");
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(textur);
    int w = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(w, k, 0, 0, xSize, ySize);
    int i1 = (79 * DefenceStation.getLinkPower()) / DefenceStation.getMaxlinkPower();
    drawTexturedModalRect(w + 8, k + 71, 176, 0, i1 + 1, 79);
}

From source file:chb.mods.mffs.client.GuiCapacitor.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    int textur = mc.renderEngine.getTexture("/chb/mods/mffs/sprites/GuiCapacitor.png");
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(textur);
    int w = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(w, k, 0, 0, xSize, ySize);
    int i1 = (79 * Core.getCapacity() / 100);
    drawTexturedModalRect(w + 8, k + 71, 176, 0, i1 + 1, 79);
}

From source file:chb.mods.mffs.client.GuiConverter.java

License:Open Source License

protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    int textur = mc.renderEngine.getTexture("/chb/mods/mffs/sprites/GuiConvertor.png");
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(textur);
    int w = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(w, k, 0, 0, xSize, ySize);
    int i1 = (79 * Converter.getCapacity()) / 100;
    drawTexturedModalRect(w + 8, k + 71, 176, 0, i1 + 1, 79);
}

From source file:chb.mods.mffs.client.GuiExtractor.java

License:Open Source License

@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    int textur = mc.renderEngine.getTexture("/chb/mods/mffs/sprites/GuiExtractor.png");
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(textur);
    int w = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(w, k, 0, 0, xSize, ySize);

    int Workpowerslider = (79 * tileEntity.getWorkdone() / 100);
    drawTexturedModalRect(w + 49, k + 69, 176, 0, Workpowerslider, 6);

    int WorkCylce;

    if (tileEntity.getWorkCylce() > ModularForceFieldSystem.ForceciumWorkCylce) {
        WorkCylce = (32 * tileEntity.getWorkCylce()) / ModularForceFieldSystem.ForceciumBlockWorkCylce;
    } else {//from  www  .  ja v a2s  .  com
        WorkCylce = (32 * tileEntity.getWorkCylce()) / ModularForceFieldSystem.ForceciumWorkCylce;
    }

    drawTexturedModalRect(w + 73, k + 30, 179, 81, WorkCylce, 32);

    int ForceEnergy = (24 * tileEntity.getForceEnergybuffer() / tileEntity.getMaxForceEnergyBuffer());
    drawTexturedModalRect(w + 137, k + 40, 219, 80, 32, ForceEnergy);
}

From source file:chb.mods.mffs.client.GuiGraphicButton.java

License:Open Source License

/**
 * Draws this button to the screen.//from   www .ja  va  2s .c o m
 */
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
    if (this.drawButton) {
        GL11.glBindTexture(GL11.GL_TEXTURE_2D,
                par1Minecraft.renderEngine.getTexture("/chb/mods/mffs/sprites/items.png"));

        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

        if ((tileEntity instanceof TileEntityConverter) && typ == 1) {
            switch (((TileEntityConverter) tileEntity).getswitchtyp()) {
            case 0:
                this.drawTexturedModalRect(this.xPosition, this.yPosition, 80, 80, this.width, this.height);
                break;
            case 1:
                this.drawTexturedModalRect(this.xPosition, this.yPosition, 64, 80, this.width, this.height);
                break;
            }
        }

        if (tileEntity instanceof TileEntityProjector) {
            if (typ == 1) {
                switch (((TileEntityProjector) tileEntity).getaccesstyp()) {
                case 0:
                    this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 80, this.width, this.height);
                    break;
                case 1:
                    this.drawTexturedModalRect(this.xPosition, this.yPosition, 16, 80, this.width, this.height);
                    break;
                case 2:
                    this.drawTexturedModalRect(this.xPosition, this.yPosition, 48, 80, this.width, this.height);
                    break;
                case 3:
                    this.drawTexturedModalRect(this.xPosition, this.yPosition, 32, 80, this.width, this.height);
                    break;
                }
            }
            if (typ == 2) {
                switch (((TileEntityProjector) tileEntity).getswitchtyp()) {
                case 0:
                    this.drawTexturedModalRect(this.xPosition, this.yPosition, 80, 80, this.width, this.height);
                    break;
                case 1:
                    this.drawTexturedModalRect(this.xPosition, this.yPosition, 64, 80, this.width, this.height);
                    break;
                }
            }
        }

        if (tileEntity instanceof TileEntityCapacitor) {
            if (typ == 1) {
                switch (((TileEntityCapacitor) tileEntity).getswitchtyp()) {
                case 0:
                    this.drawTexturedModalRect(this.xPosition, this.yPosition, 80, 80, this.width, this.height);
                    break;
                case 1:
                    this.drawTexturedModalRect(this.xPosition, this.yPosition, 64, 80, this.width, this.height);
                    break;
                }
            }

            if (typ == 2) {
                switch (((TileEntityCapacitor) tileEntity).getPowerlinkmode()) {
                case 0:
                    this.drawTexturedModalRect(this.xPosition, this.yPosition, 96, 80, this.width, this.height);
                    break;
                case 1:
                    this.drawTexturedModalRect(this.xPosition, this.yPosition, 112, 80, this.width,
                            this.height);
                    break;
                case 2:
                    this.drawTexturedModalRect(this.xPosition, this.yPosition, 128, 80, this.width,
                            this.height);
                    break;
                }
            }
        }
    }
}