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


Java GuiContainerManager.drawItem方法代码示例

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


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

示例1: draw

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public void draw(int mousex, int mousey) {
    if (itemsPerPage == 0)
        return;

    GuiContainerManager.enableMatrixStackLogging();
    int index = firstIndex;
    for (int i = 0; i < rows * columns && index < items.size(); i++) {
        if (validSlotMap[i]) {
            Rectangle4i rect = getSlotRect(i);
            if (rect.contains(mousex, mousey))
                drawRect(rect.x, rect.y, rect.w, rect.h, 0xee555555);//highlight

            GuiContainerManager.drawItem(rect.x + 1, rect.y + 1, items.get(index));

            index++;
        }
    }
    GuiContainerManager.disableMatrixStackLogging();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:ItemPanel.java

示例2: renderOverlay

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public void renderOverlay(GuiContainerManager gui, Slot slot)
{
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(770, 1);
    GL11.glColor4d(0.6, 0.6, 0.6, 0.7);
    
    GuiContainerManager.setColouredItemRender(true);
    for(PositionedStack stack : ingreds)
    {
        if(stack.relx == slot.xDisplayPosition && stack.rely == slot.yDisplayPosition)
            GuiContainerManager.drawItem(stack.relx, stack.rely, stack.item);
    }
    GuiContainerManager.setColouredItemRender(false);
    
    GL11.glColor4f(1, 1, 1, 1);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_LIGHTING);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:20,代码来源:DefaultOverlayRenderer.java

示例3: drawSlot

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
protected void drawSlot(int slot, int x, int y, int mx, int my, float frame) {
    int w = windowBounds().width;
    Rectangle4i r = new Rectangle4i(x, y, w, getSlotHeight(slot));
    if(slot < sorted.size()) {
        SubsetTag tag = sorted.get(slot);
        LayoutManager.getLayoutStyle().drawSubsetTag(tag.displayName(), x, y, r.w, r.h, tag.state.state, r.contains(mx, my));
    }
    else {
        ItemStack stack = state.items.get(slot-sorted.size());
        boolean hidden = SubsetWidget.isHidden(stack);

        int itemx = w/2-8;
        int itemy = 1;

        LayoutManager.getLayoutStyle().drawSubsetTag(null, x, y, r.w, r.h, hidden ? 0 : 2, false);

        GuiContainerManager.drawItem(x+itemx, y+itemy, stack);
        if(new Rectangle4i(itemx, itemy, 16, 16).contains(mx, my))
            SubsetWidget.hoverStack = stack;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:23,代码来源:SubsetWidget.java

示例4: drawIcons

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public void drawIcons()
{
    int x = buttonX();
    LayoutManager.drawIcon(x+4, 4, new Image(120, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(120, 12, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(168, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(144, 12, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(180, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(132, 12, 12, 12)); x+=24;
    RenderHelper.enableGUIStandardItemLighting();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    ItemStack sword = new ItemStack(Items.diamond_sword);
    sword.addEnchantment(Enchantment.sharpness, 1);
    GuiContainerManager.drawItem(x+2, 2, sword); x+=24;
    GuiContainerManager.drawItem(x+2, 2, new ItemStack(Items.potionitem)); x+=24;
    GuiContainerManager.drawItem(x+2, 2, new ItemStack(Blocks.stone)); x+=24;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:OptionUtilities.java

示例5: drawIcons

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public void drawIcons()
{
    int x = buttonX();
    LayoutManager.drawIcon(x+4, 4, new Image(120, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(120, 12, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(168, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(144, 12, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(180, 24, 12, 12)); x+=24;
    LayoutManager.drawIcon(x+4, 4, new Image(132, 12, 12, 12)); x+=24;
    RenderHelper.enableGUIStandardItemLighting();
    GlStateManager.enableRescaleNormal();
    ItemStack sword = new ItemStack(Items.diamond_sword);
    sword.addEnchantment(Enchantment.sharpness, 1);
    GuiContainerManager.drawItem(x+2, 2, sword); x+=24;
    GuiContainerManager.drawItem(x+2, 2, new ItemStack(Items.potionitem)); x+=24;
    GuiContainerManager.drawItem(x+2, 2, new ItemStack(Blocks.stone)); x+=24;
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:19,代码来源:OptionUtilities.java

示例6: drawItems

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
private void drawItems() {
    Dimension d = GuiDraw.displayRes();

    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.loadIdentity();
    GlStateManager.ortho(0, d.width*16D/iconSize, d.height*16D/iconSize, 0, 1000, 3000);
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.clearColor(0, 0, 0, 0);
    GlStateManager.clear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);

    int rows = d.height / boxSize;
    int cols = d.width / boxSize;
    int fit = rows*cols;

    RenderHelper.enableGUIStandardItemLighting();
    GlStateManager.enableRescaleNormal();
    GlStateManager.color(1, 1, 1, 1);

    for(int i = 0; drawIndex < ItemPanel.items.size() && i < fit; drawIndex++, i++) {
        int x = i%cols * 18;
        int y = i/cols * 18;
        GuiContainerManager.drawItem(x+1, y+1, ItemPanel.items.get(drawIndex));
    }

    GL11.glFlush();
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:27,代码来源:GuiItemIconDumper.java

示例7: renderOverlay

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public void renderOverlay(GuiContainerManager gui, Slot slot) {
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);

    GuiContainerManager.setItemRenderColour(0xA0A0A0B0);
    for (PositionedStack stack : ingreds) {
        if (stack.relx == slot.xPos && stack.rely == slot.yPos) {
            GuiContainerManager.drawItem(stack.relx, stack.rely, stack.item);
        }
    }
    GuiContainerManager.setItemRenderColour(-1);

    GlStateManager.disableBlend();
    GlStateManager.enableLighting();
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:17,代码来源:DefaultOverlayRenderer.java

示例8: postDraw

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public void postDraw(int mousex, int mousey) {
    if (draggedStack != null) {
        GuiContainerManager.drawItems.zLevel += 100;
        GuiContainerManager.drawItem(mousex - 8, mousey - 8, draggedStack);
        GuiContainerManager.drawItems.zLevel -= 100;
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:9,代码来源:ItemPanel.java

示例9: renderOverlay

import codechicken.nei.guihook.GuiContainerManager; //导入方法依赖的package包/类
@Override
public void renderOverlay(GuiContainerManager gui, Slot slot) {
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);

    GuiContainerManager.setItemRenderColour(0xA0A0A0B0);
    for (PositionedStack stack : ingreds) {
        if (stack.relx == slot.xDisplayPosition && stack.rely == slot.yDisplayPosition)
            GuiContainerManager.drawItem(stack.relx, stack.rely, stack.item);
    }
    GuiContainerManager.setItemRenderColour(-1);

    GlStateManager.disableBlend();
    GlStateManager.enableLighting();
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:16,代码来源:DefaultOverlayRenderer.java


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