Java Code Examples for codechicken.lib.vec.Rectangle4i#contains()

The following examples show how to use codechicken.lib.vec.Rectangle4i#contains() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemPanel.java    From NotEnoughItems with MIT License 6 votes vote down vote up
@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();
}
 
Example 2
Source File: ItemPanel.java    From NotEnoughItems with MIT License 6 votes vote down vote up
@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();
}
 
Example 3
Source File: GuiOptionList.java    From NotEnoughItems with MIT License 5 votes vote down vote up
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);
}
 
Example 4
Source File: GuiOptionList.java    From NotEnoughItems with MIT License 5 votes vote down vote up
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);
}
 
Example 5
Source File: DataDumper.java    From NotEnoughItems with MIT License 4 votes vote down vote up
public void drawButton(int mousex, int mousey, Rectangle4i b, String text) {
    GlStateManager.color(1, 1, 1, 1);
    boolean hover = b.contains(mousex, mousey);
    LayoutManager.drawButtonBackground(b.x, b.y, b.w, b.h, true, getButtonTex(hover));
    drawStringC(text, b.x, b.y, b.w, b.h, getTextColour(hover));
}
 
Example 6
Source File: DataDumper.java    From NotEnoughItems with MIT License 4 votes vote down vote up
public void drawButton(int mousex, int mousey, Rectangle4i b, String text) {
    GlStateManager.color(1, 1, 1, 1);
    boolean hover = b.contains(mousex, mousey);
    LayoutManager.drawButtonBackground(b.x, b.y, b.w, b.h, true, getButtonTex(hover));
    drawStringC(text, b.x, b.y, b.w, b.h, getTextColour(hover));
}