• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Rectangle4i类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中codechicken.lib.vec.Rectangle4i的典型用法代码示例。如果您正苦于以下问题:Java Rectangle4i类的具体用法?Java Rectangle4i怎么用?Java Rectangle4i使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Rectangle4i类属于codechicken.lib.vec包,在下文中一共展示了Rectangle4i类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: renderFluidGauge

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
public static void renderFluidGauge(FluidStack stack, Rectangle4i rect, double density, double res)
{
    if(!shouldRenderFluid(stack))
        return;
    
    int alpha = 255;
    if(stack.getFluid().isGaseous())
        alpha = (int) (fluidDensityToAlpha(density)*255);
    else
    {
        int height = (int) (rect.h*density);
        rect.y +=rect.h-height;
        rect.h = height;
    }
    
    IIcon tex = prepareFluidRender(stack, alpha);
    CCRenderState.startDrawing();
    renderFluidQuad(
            new Vector3(rect.x, rect.y+rect.h, 0),
            new Vector3(rect.w,0, 0),
            new Vector3(0, -rect.h, 0), tex, res);
    CCRenderState.draw();
    postFluidRender();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:25,代码来源:RenderUtils.java


示例2: draw

import codechicken.lib.vec.Rectangle4i; //导入依赖的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


示例3: drawSlot

import codechicken.lib.vec.Rectangle4i; //导入依赖的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: clickButton

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
public boolean clickButton(int mousex, int mousey, int button) {
    int x = buttonX();
    List<String> values = values();
    for (int i = 0; i < options.size(); i++) {
        if (new Rectangle4i(x, 0, 20, 20).contains(mousex, mousey)) {
            String s = options.get(i);
            boolean set = values.contains(s);
            if (button == 0 && !set) {
                setValue(s);
                return true;
            }
            if (button == 1 && set) {
                remValue(s);
                return true;
            }
            return false;
        }
        x += 24;
    }
    return false;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:22,代码来源:OptionStringSet.java


示例5: drawIcons

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
@Override
public void drawIcons() {
    int x = buttonX();
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(120, 24, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(120, 12, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(168, 24, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(144, 12, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(180, 24, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(132, 12, 12, 12));
    x += 24;
    RenderHelper.enableGUIStandardItemLighting();
    GlStateManager.enableRescaleNormal();
    ItemStack sword = new ItemStack(Items.DIAMOND_SWORD);
    sword.addEnchantment(Enchantment.getEnchantmentByLocation("sharpness"), 1);
    GuiHelper.drawItem(x + 2, 2, sword);
    x += 24;
    GuiHelper.drawItem(x + 2, 2, new ItemStack(Items.POTIONITEM));
    x += 24;
    GuiHelper.drawItem(x + 2, 2, new ItemStack(Blocks.STONE));
    x += 24;
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:27,代码来源:OptionUtilities.java


示例6: draw

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
@Override
public void draw(int mousex, int mousey) {
    if (itemsPerPage == 0) {
        return;
    }

    GuiHelper.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
            }

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

            index++;
        }
    }
    GuiHelper.disableMatrixStackLogging();
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:23,代码来源:ItemPanel.java


示例7: drawSlot

import codechicken.lib.vec.Rectangle4i; //导入依赖的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);
        codechicken.nei.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;

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

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


示例8: hideItemPanelSlot

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
@Override
public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int width, int height)
{
	if(gui instanceof GuiMekanism)
	{
		GuiMekanism guiMek = (GuiMekanism)gui;
		
		Rectangle4i rect = new Rectangle4i(x, y, width, height);
		
		for(GuiElement element : guiMek.guiElements)
		{
			if(element.getBounds(guiMek.getXPos(), guiMek.getYPos()).intersects(rect)) 
			{
				return true;
			}
		}
	}
	
	return false;
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:21,代码来源:ElementBoundHandler.java


示例9: slotValid

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
private boolean slotValid(GuiContainer gui, int i) {
    Rectangle4i rect = getSlotRect(i);
    for (INEIGuiHandler handler : GuiInfo.guiHandlers)
        if (handler.hideItemPanelSlot(gui, rect.x, rect.y, rect.w, rect.h))
            return false;
    return true;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:8,代码来源:ItemPanel.java


示例10: contains

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
@Override
public boolean contains(int px, int py) {
    GuiContainer gui = NEIClientUtils.getGuiContainer();
    Rectangle4i rect = new Rectangle4i(px, py, 1, 1);
    for (INEIGuiHandler handler : GuiInfo.guiHandlers)
        if (handler.hideItemPanelSlot(gui, rect.x, rect.y, rect.w, rect.h))
            return false;

    return super.contains(px, py);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:ItemPanel.java


示例11: drawModeButton

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
public void drawModeButton(int mousex, int mousey) {
    GL11.glColor4f(1, 1, 1, 1);
    Rectangle4i b = modeButtonSize();
    boolean hover = b.contains(mousex, mousey);
    LayoutManager.drawButtonBackground(b.x, b.y, b.w, b.h, true, getButtonTex(hover));
    drawStringC(modeButtonText(), b.x, b.y, b.w, b.h, getTextColour(hover));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:8,代码来源:DataDumper.java


示例12: drawDumpButton

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
public void drawDumpButton(int mousex, int mousey) {
    GL11.glColor4f(1, 1, 1, 1);
    Rectangle4i b = dumpButtonSize();
    boolean hover = b.contains(mousex, mousey);
    LayoutManager.drawButtonBackground(b.x, b.y, b.w, b.h, true, getButtonTex(hover));
    drawStringC(dumpButtonText(), b.x, b.y, b.w, b.h, getTextColour(hover));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:8,代码来源:DataDumper.java


示例13: handleTooltip

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
@Override
public List<String> handleTooltip(int mousex, int mousey, List<String> currenttip) {
    if (new Rectangle4i(10, 0, textField.x - 10, 20).contains(mousex, mousey)) {
        String tip = translateN(name + ".tip");
        if (!tip.equals(name + ".tip"))
            currenttip.add(tip);
    }
    return currenttip;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:10,代码来源:OptionTextField.java


示例14: handleTooltip

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
@Override
public List<String> handleTooltip(int mousex, int mousey, List<String> currenttip) {
    if (new Rectangle4i(4, 4, 50, 20).contains(mousex, mousey))
        currenttip.add(translateN(name + ".tip"));
    int x = buttonX();
    for (String option : options) {
        if (new Rectangle4i(x, 0, 20, 20).contains(mousex, mousey))
            currenttip.add(translateN(name + "." + option));

        x += 24;
    }
    return currenttip;
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:OptionStringSet.java


示例15: selectionBox

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
public Rectangle4i selectionBox() {
    Point pos = renderPos();
    Dimension size = displaySize();
    Dimension rect = sampleSize();
    return new Rectangle4i(
            (size.width - rect.width) * pos.x / 10000,
            (size.height - rect.height) * pos.y / 10000,
            rect.width, rect.height);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:10,代码来源:GuiHighlightTips.java


示例16: drawWorldSelector

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
private void drawWorldSelector(Option o, int mousex, int mousey) {
    Rectangle4i b = worldButtonSize();
    boolean set = o.hasWorldOverride();
    boolean mouseover = b.contains(mousex, mousey);
    GL11.glColor4f(1, 1, 1, 1);
    LayoutManager.drawButtonBackground(b.x, b.y, b.w, b.h, true, !set ? 0 : mouseover ? 2 : 1);
    drawStringC("W", b.x, b.y, b.w, b.h, -1);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:9,代码来源:GuiOptionList.java


示例17: drawWorldSelector

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
private void drawWorldSelector(Option o, int mousex, int mousey) {
    Rectangle4i b = worldButtonSize();
    boolean set = o.hasWorldOverride();
    boolean mouseover = b.contains(mousex, mousey);
    GlStateManager.color(1, 1, 1, 1);
    LayoutManager.drawButtonBackground(b.x, b.y, b.w, b.h, true, !set ? 0 : mouseover ? 2 : 1);
    drawStringC("W", b.x, b.y, b.w, b.h, -1);
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:9,代码来源:GuiOptionList.java


示例18: handleTooltip

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
@Override
public List<String> handleTooltip(int mousex, int mousey, List<String> currenttip) {
    if (new Rectangle4i(10, 0, textField.x - 10, 20).contains(mousex, mousey)) {
        String tip = translateN(name + ".tip");
        if (!tip.equals(name + ".tip")) {
            currenttip.add(tip);
        }
    }
    return currenttip;
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:11,代码来源:OptionTextField.java


示例19: handleTooltip

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
@Override
public List<String> handleTooltip(int mousex, int mousey, List<String> currenttip) {
    if (new Rectangle4i(4, 4, 50, 20).contains(mousex, mousey)) {
        currenttip.add(translateN(name + ".tip"));
    }
    int x = buttonX();
    for (String option : options) {
        if (new Rectangle4i(x, 0, 20, 20).contains(mousex, mousey)) {
            currenttip.add(translateN(name + "." + option));
        }

        x += 24;
    }
    return currenttip;
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:16,代码来源:OptionStringSet.java


示例20: drawIcons

import codechicken.lib.vec.Rectangle4i; //导入依赖的package包/类
@Override
public void drawIcons() {
    int x = buttonX();
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(132, 12, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(156, 12, 12, 12));
    x += 24;
    LayoutManager.drawIcon(x + 4, 4, new Rectangle4i(168, 12, 12, 12));
    x += 24;
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:11,代码来源:OptionGamemodes.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RepositoryConnectorFactory类代码示例发布时间:2022-05-22
下一篇:
Java SequenceStartEvent类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap