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


Java TextureUtils.changeTexture方法代码示例

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


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

示例1: renderTracker

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
public static void renderTracker(int freq)
{
    GlStateManager.disableLighting();

    TextureUtils.bindBlockTexture();
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();
    ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    ccrs.colour = 0xFFFFFFFF;
    model.render(ccrs, new IconTransformation(TextureUtils.getBlockTexture("obsidian")));
    ccrs.draw();
    
    Matrix4 pearlMat = RenderUtils.getMatrix(
        new Vector3(0, 0.44+RedstoneEther.getSineWave(ClientUtils.getRenderTime(), 7)*0.02, 0),
        new Rotation(RedstoneEther.getRotation(ClientUtils.getRenderTime(), freq), new Vector3(0, 1, 0)),
        0.04);

    TextureUtils.changeTexture("wrcbe:textures/hedronmap.png");
    ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    ccrs.colour = freq == 0 ? 0xC0C0C0FF : 0xFFFFFFFF;
    CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
    ccrs.draw();

    GlStateManager.enableLighting();
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:26,代码来源:RenderTracker.java

示例2: renderPearl

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
public static void renderPearl(CCRenderState ccrs, Vector3 pos, WirelessPart p) {
    GlStateManager.pushMatrix();

    pos.translation().glApply();
    p.rotationT().at(center).glApply();
    p.getPearlPos().translation().glApply();
    p.getPearlRotation().glApply();
    new Scale(p.getPearlScale()).glApply();
    float light = 1;
    if (p.tile() != null) {
        GlStateManager.rotate((float) (p.getPearlSpin() * MathHelper.todeg), 0, 1, 0);
        light = p.getPearlLight();
    }

    GlStateManager.disableLighting();
    ccrs.reset();
    TextureUtils.changeTexture("wrcbe:textures/hedronmap.png");
    ccrs.pullLightmap();
    ccrs.colour = Colour.packRGBA(light, light, light, 1);
    ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_NORMAL);
    CCModelLibrary.icosahedron4.render(ccrs);
    ccrs.draw();
    GlStateManager.enableLighting();

    GlStateManager.popMatrix();
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:27,代码来源:RenderWireless.java

示例3: drawGuiContainerBackgroundLayer

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    TextureUtils.changeTexture(chestInv.getSize() == 0 ? "textures/gui/container/dispenser.png" : "textures/gui/container/generic_54.png");
    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;

    switch (chestInv.getSize()) {
        case 0:
        case 2:
            drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
            break;
        case 1:
            drawTexturedModalRect(x, y, 0, 0, xSize, 71);
            drawTexturedModalRect(x, y + 71, 0, 126, xSize, 96);
            break;

    }
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:19,代码来源:GuiEnderItemStorage.java

示例4: drawGuiContainerBackgroundLayer

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
    GlStateManager.color(1, 1, 1, 1);
    TextureUtils.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:TheCBProject,项目名称:NotEnoughItems,代码行数:18,代码来源:GuiRecipe.java

示例5: renderMap

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
@Override
public void renderMap(ItemStack stack, @Nullable MapData data, boolean inFrame) {
    if (inFrame) {
        TextureUtils.changeTexture("textures/map/map_background.png");
        GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
        GlStateManager.scale(0.0078125F, 0.0078125F, 0.0078125F);
        GlStateManager.translate(-64.0F, -64.0F, 0.0F);
        GlStateManager.translate(0.0F, 0.0F, -1.0F);
        if (data != null) {
            Minecraft.getMinecraft().entityRenderer.getMapItemRenderer().renderMap(data, inFrame);
        }
    } else {
        GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
        GlStateManager.scale(0.38F, 0.38F, 0.38F);
        GlStateManager.disableLighting();
        TextureUtils.changeTexture("textures/map/map_background.png");
        Tessellator tessellator = Tessellator.getInstance();
        VertexBuffer vertexbuffer = tessellator.getBuffer();
        GlStateManager.translate(-0.5F, -0.5F, 0.0F);
        GlStateManager.scale(0.0078125F, 0.0078125F, 0.0078125F);
        vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
        vertexbuffer.pos(-7.0D, 135.0D, 0.0D).tex(0.0D, 1.0D).endVertex();
        vertexbuffer.pos(135.0D, 135.0D, 0.0D).tex(1.0D, 1.0D).endVertex();
        vertexbuffer.pos(135.0D, -7.0D, 0.0D).tex(1.0D, 0.0D).endVertex();
        vertexbuffer.pos(-7.0D, -7.0D, 0.0D).tex(0.0D, 0.0D).endVertex();
        tessellator.draw();
        if (data != null) {
            Minecraft.getMinecraft().entityRenderer.getMapItemRenderer().renderMap(data, inFrame);
        }
    }
    render(stack, data, inFrame);
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:34,代码来源:WirelessMapRenderer.java

示例6: drawArrow

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
private void drawArrow(int x, int y, int colour)
{
    TextureUtils.changeTexture("wrcbe:textures/gui/arrow.png");
    
    new ColourARGB(colour).glColour();
    Tessellator t = Tessellator.getInstance();
    VertexBuffer buffer = t.getBuffer();
    buffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    buffer.pos(x + 0, y + 8, zLevel).tex( arrowdirection * 0.25, 1).endVertex();
    buffer.pos(x + 8, y + 8, zLevel).tex( (arrowdirection + 1) * 0.25, 1).endVertex();
    buffer.pos(x + 8, y + 0, zLevel).tex( (arrowdirection + 1) * 0.25, 0).endVertex();
    buffer.pos(x + 0, y + 0, zLevel).tex( arrowdirection * 0.25, 0).endVertex();
    t.draw();
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:15,代码来源:GuiButtonArrow.java

示例7: drawBackground

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
@Override
public void drawBackground() {
    if (largeGui) {
        TextureUtils.changeTexture("wrcbe:textures/gui/wirelessLarge.png");
    } else
        TextureUtils.changeTexture("wrcbe:textures/gui/wirelessSmall.png");
    GlStateManager.color(1, 1, 1, 1);
    drawTexturedModalRect(0, 0, 0, 0, xSize, ySize);
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:10,代码来源:GuiRedstoneWireless.java

示例8: renderChest

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
public static void renderChest(int rotation, Frequency freq, double x, double y, double z, int offset, float lidAngle) {
    TileEntityRendererDispatcher info = TileEntityRendererDispatcher.instance;
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();

    renderEndPortal.render(x, y, z, 0, info.entityX, info.entityY, info.entityZ, info.renderEngine);
    GlStateManager.color(1, 1, 1, 1);

    TextureUtils.changeTexture("enderstorage:textures/enderchest.png");
    GlStateManager.pushMatrix();
    GlStateManager.enableRescaleNormal();
    GlStateManager.color(1, 1, 1, 1);
    GlStateManager.translate(x, y + 1.0, z + 1.0F);
    GlStateManager.scale(1.0F, -1F, -1F);
    GlStateManager.translate(0.5F, 0.5F, 0.5F);
    GlStateManager.rotate(rotation * 90, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(-0.5F, -0.5F, -0.5F);
    model.chestLid.rotateAngleX = lidAngle;
    model.render(freq.hasOwner());
    GlStateManager.popMatrix();

    GlStateManager.pushMatrix();
    GlStateManager.translate(x, y, z);
    renderButtons(freq, rotation, lidAngle);
    GlStateManager.popMatrix();

    double time = ClientUtils.getRenderTime() + offset;
    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + 0.2 + lidAngle * -0.5 + RenderUtils.getPearlBob(time), z + 0.5), new Rotation(time / 3, new Vector3(0, 1, 0)), 0.04);

    GlStateManager.disableLighting();
    TextureUtils.changeTexture("enderstorage:textures/hedronmap.png");
    GlStateManager.pushMatrix();

    ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron7.render(ccrs, pearlMat);
    ccrs.draw();
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:40,代码来源:RenderTileEnderChest.java

示例9: renderButtons

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
private static void renderButtons(Frequency freq, int rot, double lidAngle) {
    TextureUtils.changeTexture("enderstorage:textures/buttons.png");

    drawButton(0, freq.getLeft().getWoolMeta(), rot, lidAngle);
    drawButton(1, freq.getMiddle().getWoolMeta(), rot, lidAngle);
    drawButton(2, freq.getRight().getWoolMeta(), rot, lidAngle);
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:8,代码来源:RenderTileEnderChest.java

示例10: renderTank

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
public static void renderTank(CCRenderState ccrs, int rotation, float valve, Frequency freq, double x, double y, double z, int offset) {
    ccrs.reset();
    TileEntityRendererDispatcher info = TileEntityRendererDispatcher.instance;
    renderEndPortal.render(x, y, z, 0, info.entityX, info.entityY, info.entityZ, info.renderEngine);
    GlStateManager.color(1, 1, 1, 1);

    GlStateManager.pushMatrix();
    GlStateManager.translate(x + 0.5, y, z + 0.5);
    GlStateManager.rotate(-90 * (rotation + 2), 0, 1, 0);

    TextureUtils.changeTexture("enderstorage:textures/endertank.png");
    ccrs.startDrawing(4, POSITION_TEX_COLOR_NORMAL);
    tankModel.render(ccrs);
    valveModel.render(ccrs, new Rotation(valve, new Vector3(0, 0, 1)).at(new Vector3(0, 0.4165, 0)), new UVTranslation(0, freq.hasOwner() ? 13 / 64D : 0));
    ccrs.draw();

    TextureUtils.changeTexture("enderstorage:textures/buttons.png");
    ccrs.startDrawing(7, POSITION_TEX_COLOR_NORMAL);
    EnumColour[] colours = freq.toArray();
    for (int i = 0; i < 3; i++) {
        buttons[i].render(ccrs, new UVTranslation(0.25 * (colours[i].getWoolMeta() % 4), 0.25 * (colours[i].getWoolMeta() / 4)));
    }
    ccrs.draw();
    GlStateManager.popMatrix();

    double time = ClientUtils.getRenderTime() + offset;
    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + 0.45 + RenderUtils.getPearlBob(time) * 2, z + 0.5), new Rotation(time / 3, new Vector3(0, 1, 0)), 0.04);

    GlStateManager.disableLighting();
    TextureUtils.changeTexture("enderstorage:textures/hedronmap.png");
    ccrs.startDrawing(4, POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
    ccrs.draw();
    GlStateManager.enableLighting();
    ccrs.reset();
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:37,代码来源:RenderTileEnderTank.java

示例11: renderItem

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
    renderWrapped(stack);

    double rot = ClientUtils.getRenderTime() / 3F;
    double height;
    double size;
    double updown = (float) Math.sin(((ClientUtils.getRenderTime() % 50) / 25F) * 3.141593) * 0.2;

    if (stack.getMetadata() == 0) {
        height = 0.9;
        size = 0.08;
    } else {
        height = 0.5;
        size = 0.05;
    }

    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();

    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(0.5, height + (updown + 0.3), 0.5), new Rotation(rot, new Vector3(0, 1, 0)), size);

    disableLighting();
    pushMatrix();
    TextureUtils.changeTexture("chickenchunks:textures/hedronmap.png");
    ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
    ccrs.draw();
    popMatrix();
    enableLighting();
}
 
开发者ID:TheCBProject,项目名称:ChickenChunks,代码行数:32,代码来源:ChunkLoaderItemModel.java

示例12: drawContainerBackground

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
private void drawContainerBackground() {
    GlStateManager.color(1F, 1F, 1F, 1F);
    TextureUtils.changeTexture("chickenchunks:textures/gui/gui_small.png");
    int posx = width / 2 - 88;
    int posy = height / 2 - 83;
    drawTexturedModalRect(posx, posy, 0, 0, 176, 166);
}
 
开发者ID:TheCBProject,项目名称:ChickenChunks,代码行数:8,代码来源:GuiChunkLoader.java

示例13: renderItem

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
    GlStateManager.pushMatrix();

    TextureUtils.changeTexture("translocator:textures/model/tex.png");
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    TileTranslocatorRenderer.renderAttachment(ccrs, 2, stack.getItemDamage(), 1D, 0, 0.0D, 0.0D, 0.5D);
    ccrs.draw();

    GlStateManager.popMatrix();
}
 
开发者ID:TheCBProject,项目名称:Translocators,代码行数:13,代码来源:TranslocatorItemRender.java

示例14: drawGuiContainerBackgroundLayer

import codechicken.lib.texture.TextureUtils; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GlStateManager.pushMatrix();
    GlStateManager.translate(guiLeft, guiTop, 0);
    GlStateManager.color(1, 1, 1, 1);

    TextureUtils.changeTexture("textures/gui/container/dispenser.png");
    drawTexturedModalRect(0, 0, 0, 0, xSize, ySize);

    fontRendererObj.drawString(I18n.translateToLocal(((ContainerItemTranslocator) inventorySlots).getName()), 6, 6, 0x404040);
    fontRendererObj.drawString(I18n.translateToLocal("container.inventory"), 6, 72, 0x404040);
    GlStateManager.popMatrix();
}
 
开发者ID:TheCBProject,项目名称:Translocators,代码行数:14,代码来源:GuiTranslocator.java

示例15: drawButtonTex

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

    GlStateManager.color(1, 1, 1, 1);
    TextureUtils.changeTexture("nei:textures/patreon_neon.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:TheCBProject,项目名称:NotEnoughItems,代码行数:11,代码来源:PatreonButton.java


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