当前位置: 首页>>代码示例>>Java>>正文


Java CCRenderState.changeTexture方法代码示例

本文整理汇总了Java中codechicken.lib.render.CCRenderState.changeTexture方法的典型用法代码示例。如果您正苦于以下问题:Java CCRenderState.changeTexture方法的具体用法?Java CCRenderState.changeTexture怎么用?Java CCRenderState.changeTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在codechicken.lib.render.CCRenderState的用法示例。


在下文中一共展示了CCRenderState.changeTexture方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawGuiContainerBackgroundLayer

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
    GL11.glColor4f(1, 1, 1, 1);
    CCRenderState.changeTexture("nei:textures/gui/recipebg.png");
    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(j, k, 0, 0, xSize, ySize);

    GL11.glPushMatrix();
    GL11.glTranslatef(j + 5, k + 16, 0);
    IRecipeHandler recipehandler = currenthandlers.get(recipetype);
    for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
        recipehandler.drawBackground(i);
        GL11.glTranslatef(0, 65, 0);
    }
    GL11.glPopMatrix();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:18,代码来源:GuiRecipe.java

示例2: drawGuiContainerBackgroundLayer

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
    GlStateManager.color(1, 1, 1, 1);
    CCRenderState.changeTexture("nei:textures/gui/recipebg.png");
    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(j, k, 0, 0, xSize, ySize);

    GlStateManager.pushMatrix();
    GlStateManager.translate(j + 5, k + 16, 0);
    IRecipeHandler recipehandler = currenthandlers.get(recipetype);
    for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
        recipehandler.drawBackground(i);
        GlStateManager.translate(0, 65, 0);
    }
    GlStateManager.popMatrix();
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:18,代码来源:GuiRecipe.java

示例3: drawForeground

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void drawForeground(int recipe) {
    GL11.glColor4f(1, 1, 1, 1);
    GL11.glDisable(GL11.GL_LIGHTING);
    if (this.getGuiTexture() != null && !this.getGuiTexture().isEmpty() && this.progressBar != null) {
        CCRenderState.changeTexture(getGuiTexture());
        drawProgressBar(progressBar.posX, progressBar.posY, progressBar.textureX, progressBar.textureY, progressBar.width, progressBar.height, progressBar.ticks, progressBar.direction);    
    }
    drawExtras(recipe);
}
 
开发者ID:GWYOG,项目名称:CustomNEIPlugins,代码行数:11,代码来源:PluginMachineRecipe.java

示例4: drawBackground

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void drawBackground(int recipe) {
    GL11.glColor4f(1, 1, 1, 1);
    if (!this.guiBackgroundTextureLocation.equals("nei:textures/gui/recipebg.png") && recipe % recipiesPerPage() == 0) {
        CCRenderState.changeTexture(this.guiBackgroundTextureLocation);
        GuiDraw.drawTexturedModalRect(-5, -16, 0, 0, 176, 166);
    }
    if (this.getGuiTexture() != null && !this.getGuiTexture().isEmpty()) {
        CCRenderState.changeTexture(getGuiTexture());
        GuiDraw.drawTexturedModalRect(0, 0, this.guiOffset.offsetX, this.guiOffset.offsetY, 166, 65);
    }
 }
 
开发者ID:GWYOG,项目名称:CustomNEIPlugins,代码行数:13,代码来源:PluginMachineRecipe.java

示例5: draw

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void draw(int x, int y, int w, int h) {
    CCRenderState.changeTexture(tex);
    CCRenderState.reset();
    CCRenderState.startDrawing();

    int[] sw = new int[]{x, x+seg_w[0], x+w-seg_w[2], x+w};
    int[] sh = new int[]{y, y+seg_h[0], y+h-seg_h[2], y+h};

    for(int seg = 0; seg < 9; seg++)
        drawSeg(sw, sh, seg);

    CCRenderState.draw();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:Canvas9Seg.java

示例6: drawSlot

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawSlot(int slot, int x, int y, int mx, int my, float frame) {
    GL11.glColor4f(1, 1, 1, 1);
    Potion potion = validPotions.get(slot);
    PotionEffect effect = getEffect(potion.id);
    boolean blank = effect == null;
    if (effect == null)
        effect = new PotionEffect(potion.id, 1200, 0);
    int shade = selectedslot == slot ? 2 : blank ? 1 : 0;

    CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
    drawTexturedModalRect(x, y, 0, 166 + getSlotHeight(slot) * shade, width - 30, getSlotHeight(slot));
    drawTexturedModalRect(x + width - 30, y, width - 23, 166 + getSlotHeight(slot) * shade, 30, getSlotHeight(slot));

    if (potion.hasStatusIcon()) {
        CCRenderState.changeTexture("textures/gui/container/inventory.png");
        int icon = potion.getStatusIconIndex();
        drawTexturedModalRect(x + 1, y + 1, icon % 8 * 18, 198 + icon / 8 * 18, 18, 18);
    }

    String name = StatCollector.translateToLocal(potion.getName());
    String amp = effect.getAmplifier() > 0 ? " " + translateAmplifier(effect.getAmplifier()) : "";
    int textColour = shade == 0 ? 0x685e4a : shade == 1 ? 0x407f10 : 0xffff80;
    if (fontRenderer.getStringWidth(name + amp) < width - 20) {
        fontRenderer.drawString(name + amp, x + 20, y + 1, textColour);
    } else {
        fontRenderer.drawString(name, x + 20, y + 1, textColour);
        FontUtils.drawRightString(amp, x + width - 10, y + 10, textColour);
    }

    String duration = Potion.getDurationString(effect);
    textColour = shade == 0 ? 0xA0A0A0 : shade == 1 ? 0x808080 : 0xCCCCCC;
    fontRenderer.drawStringWithShadow(duration, x + 20, y + 10, textColour);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:35,代码来源:GuiPotionCreator.java

示例7: drawBackground

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void drawBackground() {
    CCRenderState.changeTexture("nei:textures/gui/potion.png");
    drawTexturedModalRect(0, 0, 0, 0, xSize, ySize);

    FontUtils.drawCenteredString("Favourite Potions", xSize / 2, 4, 0x404040);
    fontRendererObj.drawString("Duration", 12, 40, 0x404040);
    fontRendererObj.drawString("Level", 19, 73, 0x404040);
    FontUtils.drawCenteredString(translateAmplifier(amplifier), 33, 86, 0xFF606060);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:GuiPotionCreator.java

示例8: drawSlots

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void drawSlots(GuiEnchantmentModifier gui) {
    for (int slot = 0; slot < 3; slot++) {
        int shade = 0;
        String text = "";

        int containerslot = slot + getScrolledSlots();
        if (containerslot + 1 > slotEnchantment.size()) {
            shade = 1;
        } else {
            EnchantmentHash e = slotEnchantment.get(containerslot);
            shade = e.state;
            text = e.enchantment.getTranslatedName(e.level == -1 ? level : e.level);
            if (gui.mc.fontRenderer.getStringWidth(text) > 95 && text.contains("Projectile")) {
                text = text.replace("Projectile", "Proj");
            }
            if (gui.mc.fontRenderer.getStringWidth(text) > 95 && text.contains("Protection")) {
                text = text.replace("Protection", "Protect");
            }
            if (gui.mc.fontRenderer.getStringWidth(text) > 95 && text.contains("Bane of")) {
                text = text.replace("Bane of ", "");
            }
        }

        CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
        GL11.glColor3f(1, 1, 1);
        if (hasScrollBar()) {
            gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth - 30, slotheight);
            gui.drawTexturedModalRect(relx + cwidth - 30, rely + slot * slotheight, cwidth - 23, gui.ySize + slotheight * shade, 30, slotheight);
        } else {
            gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth + 7, slotheight);
        }

        gui.getFontRenderer().drawString(text, relx + 4, rely + slot * slotheight + 5, textColourFromState(shade));
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:36,代码来源:ContainerEnchantmentModifier.java

示例9: drawGuiContainerBackgroundLayer

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
    GL11.glColor4f(1, 1, 1, 1);
    CCRenderState.changeTexture("nei:textures/gui/inv.png");

    int x = guiLeft;
    int y = guiTop - 4;

    drawTexturedModalRect(x - 23, y, 0, 0, 199, 204);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:GuiExtendedCreativeInv.java

示例10: drawGuiContainerBackgroundLayer

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GL11.glColor4f(1, 1, 1, 1);
    CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
    GL11.glTranslatef(guiLeft, guiTop, 0);
    drawTexturedModalRect(0, 0, 0, 0, xSize, ySize);

    container.onUpdate(i, j);
    container.drawSlots(this);
    container.drawScrollBar(this);

    String levelstring = "" + container.level;
    fontRendererObj.drawString(levelstring, 33 - fontRendererObj.getStringWidth(levelstring) / 2, 34, 0xFF606060);

    GL11.glTranslatef(-guiLeft, -guiTop, 0);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:16,代码来源:GuiEnchantmentModifier.java

示例11: drawSlot

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawSlot(int slot, int x, int y, int mx, int my, float frame) {
    GlStateManager.color(1, 1, 1, 1);
    Potion potion = validPotions.get(slot);
    PotionEffect effect = getEffect(potion.id);
    boolean blank = effect == null;
    if (effect == null)
        effect = new PotionEffect(potion.id, 1200, 0);
    int shade = selectedslot == slot ? 2 : blank ? 1 : 0;

    CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
    drawTexturedModalRect(x, y, 0, 166 + getSlotHeight(slot) * shade, width - 30, getSlotHeight(slot));
    drawTexturedModalRect(x + width - 30, y, width - 23, 166 + getSlotHeight(slot) * shade, 30, getSlotHeight(slot));

    if (potion.hasStatusIcon()) {
        CCRenderState.changeTexture("textures/gui/container/inventory.png");
        int icon = potion.getStatusIconIndex();
        drawTexturedModalRect(x + 1, y + 1, icon % 8 * 18, 198 + icon / 8 * 18, 18, 18);
    }

    String name = StatCollector.translateToLocal(potion.getName());
    String amp = effect.getAmplifier() > 0 ? " " + translateAmplifier(effect.getAmplifier()) : "";
    int textColour = shade == 0 ? 0x685e4a : shade == 1 ? 0x407f10 : 0xffff80;
    if (fontRenderer.getStringWidth(name + amp) < width - 20) {
        fontRenderer.drawString(name + amp, x + 20, y + 1, textColour);
    } else {
        fontRenderer.drawString(name, x + 20, y + 1, textColour);
        FontUtils.drawRightString(amp, x + width - 10, y + 10, textColour);
    }

    String duration = Potion.getDurationString(effect);
    textColour = shade == 0 ? 0xA0A0A0 : shade == 1 ? 0x808080 : 0xCCCCCC;
    fontRenderer.drawStringWithShadow(duration, x + 20, y + 10, textColour);
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:35,代码来源:GuiPotionCreator.java

示例12: drawSlots

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void drawSlots(GuiEnchantmentModifier gui) {
    for (int slot = 0; slot < 3; slot++) {
        int shade = 0;
        String text = "";

        int containerslot = slot + getScrolledSlots();
        if (containerslot + 1 > slotEnchantment.size()) {
            shade = 1;
        } else {
            EnchantmentHash e = slotEnchantment.get(containerslot);
            shade = e.state;
            text = e.enchantment.getTranslatedName(e.level == -1 ? level : e.level);
            if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Projectile")) {
                text = text.replace("Projectile", "Proj");
            }
            if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Protection")) {
                text = text.replace("Protection", "Protect");
            }
            if (gui.mc.fontRendererObj.getStringWidth(text) > 95 && text.contains("Bane of")) {
                text = text.replace("Bane of ", "");
            }
        }

        CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
        GlStateManager.color(1, 1, 1);
        if (hasScrollBar()) {
            gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth - 30, slotheight);
            gui.drawTexturedModalRect(relx + cwidth - 30, rely + slot * slotheight, cwidth - 23, gui.ySize + slotheight * shade, 30, slotheight);
        } else {
            gui.drawTexturedModalRect(relx, rely + slot * slotheight, 0, gui.ySize + slotheight * shade, cwidth + 7, slotheight);
        }

        gui.getFontRenderer().drawString(text, relx + 4, rely + slot * slotheight + 5, textColourFromState(shade));
    }
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:36,代码来源:ContainerEnchantmentModifier.java

示例13: drawGuiContainerBackgroundLayer

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
    GlStateManager.color(1, 1, 1, 1);
    CCRenderState.changeTexture("nei:textures/gui/inv.png");

    int x = guiLeft;
    int y = guiTop - 4;

    drawTexturedModalRect(x - 23, y, 0, 0, 199, 204);
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:11,代码来源:GuiExtendedCreativeInv.java

示例14: drawGuiContainerBackgroundLayer

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GlStateManager.color(1, 1, 1, 1);
    CCRenderState.changeTexture("textures/gui/container/enchanting_table.png");
    GlStateManager.translate(guiLeft, guiTop, 0);
    drawTexturedModalRect(0, 0, 0, 0, xSize, ySize);

    container.onUpdate(i, j);
    container.drawSlots(this);
    container.drawScrollBar(this);

    String levelstring = "" + container.level;
    fontRendererObj.drawString(levelstring, 33 - fontRendererObj.getStringWidth(levelstring) / 2, 34, 0xFF606060);

    GlStateManager.translate(-guiLeft, -guiTop, 0);
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:16,代码来源:GuiEnchantmentModifier.java

示例15: drawButtonTex

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void drawButtonTex(int mousex, int mousey) {
    super.drawButtonTex(mousex, mousey);

    GlStateManager.color(1, 1, 1, 1);
    CCRenderState.changeTexture("nei:textures/patreonNeon.png");
    int texh = height-4;
    int texw = texh*4;
    drawModalRectWithCustomSizedTexture(x+width/2-texw/2, y+height/2-texh/2, 0, 0, texw, texh, texw, texh);
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:11,代码来源:PatreonButton.java


注:本文中的codechicken.lib.render.CCRenderState.changeTexture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。