Package com.pahimar.repackage.cofh.lib.gui.element

Examples of com.pahimar.repackage.cofh.lib.gui.element.ElementBase


    @Override
    protected void keyTyped(char characterTyped, int keyPressed) {

        for (int i = elements.size(); i-- > 0; ) {
            ElementBase c = elements.get(i);
            if (!c.isVisible() || !c.isEnabled()) {
                continue;
            }
            if (c.onKeyTyped(characterTyped, keyPressed)) {
                return;
            }
        }
        super.keyTyped(characterTyped, keyPressed);
    }
View Full Code Here


        int wheelMovement = Mouse.getEventDWheel();

        if (wheelMovement != 0) {
            for (int i = elements.size(); i-- > 0; ) {
                ElementBase c = elements.get(i);
                if (!c.isVisible() || !c.isEnabled() || !c.intersectsWith(mouseX, mouseY)) {
                    continue;
                }
                if (c.onMouseWheel(mouseX, mouseY, wheelMovement)) {
                    return;
                }
            }
            TabBase tab = getTabAtPosition(mouseX, mouseY);
View Full Code Here

        mX -= guiLeft;
        mY -= guiTop;

        for (int i = elements.size(); i-- > 0; ) {
            ElementBase c = elements.get(i);
            if (!c.isVisible() || !c.isEnabled() || !c.intersectsWith(mX, mY)) {
                continue;
            }
            if (c.onMousePressed(mX, mY, mouseButton)) {
                return;
            }
        }
        TabBase tab = getTabAtPosition(mX, mY);
        if (tab != null && !tab.onMousePressed(mX, mY, mouseButton)) {
View Full Code Here

        mX -= guiLeft;
        mY -= guiTop;

        if (mouseButton >= 0 && mouseButton <= 2) { // 0:left, 1:right, 2: middle
            for (int i = elements.size(); i-- > 0; ) {
                ElementBase c = elements.get(i);
                if (!c.isVisible() || !c.isEnabled()) { // no bounds checking on mouseUp events
                    continue;
                }
                c.onMouseReleased(mX, mY);
            }
        }
        mX += guiLeft;
        mY += guiTop;
View Full Code Here

     */
    protected void drawElements(float partialTick, boolean foreground) {

        if (foreground) {
            for (int i = 0; i < elements.size(); i++) {
                ElementBase element = elements.get(i);
                if (element.isVisible()) {
                    element.drawForeground(mouseX, mouseY);
                }
            }
        } else {
            for (int i = 0; i < elements.size(); i++) {
                ElementBase element = elements.get(i);
                if (element.isVisible()) {
                    element.drawBackground(mouseX, mouseY, partialTick);
                }
            }
        }
    }
View Full Code Here

        TabBase tab = getTabAtPosition(mouseX, mouseY);

        if (tab != null) {
            tab.addTooltip(tooltip);
        }
        ElementBase element = getElementAtPosition(mouseX, mouseY);

        if (element != null) {
            element.addTooltip(tooltip);
        }
    }
View Full Code Here

    }

    protected ElementBase getElementAtPosition(int mX, int mY) {

        for (int i = elements.size(); i-- > 0; ) {
            ElementBase element = elements.get(i);
            if (element.intersectsWith(mX, mY)) {
                return element;
            }
        }
        return null;
    }
View Full Code Here

    }

    protected final void updateElements() {

        for (int i = elements.size(); i-- > 0; ) {
            ElementBase c = elements.get(i);
            if (c.isVisible() && c.isEnabled()) {
                c.update(mouseX, mouseY);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.pahimar.repackage.cofh.lib.gui.element.ElementBase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.