Package org.terasology.math

Examples of org.terasology.math.Rect2i.height()


    public void onDraw(Canvas canvas) {
        Rect2i region = canvas.getRegion();
        inputPort.updateRect();
        canvas.drawWidget(inputPort, Rect2i.createFromMinAndMax(
                (int) (inputPort.rect.minX() / 10.f * region.width()),
                (int) (inputPort.rect.minY() / 5.f * region.height()),
                (int) (inputPort.rect.maxX() / 10.f * region.width()),
                (int) (inputPort.rect.maxY() / 5.f * region.height())));
        for (Port port : ports) {
            port.updateRect();
            canvas.drawWidget(port, Rect2i.createFromMinAndMax(
View Full Code Here


        inputPort.updateRect();
        canvas.drawWidget(inputPort, Rect2i.createFromMinAndMax(
                (int) (inputPort.rect.minX() / 10.f * region.width()),
                (int) (inputPort.rect.minY() / 5.f * region.height()),
                (int) (inputPort.rect.maxX() / 10.f * region.width()),
                (int) (inputPort.rect.maxY() / 5.f * region.height())));
        for (Port port : ports) {
            port.updateRect();
            canvas.drawWidget(port, Rect2i.createFromMinAndMax(
                    (int) (port.rect.minX() / 10.f * region.width()),
                    (int) (port.rect.minY() / 5.f * region.height()),
 
View Full Code Here

                (int) (inputPort.rect.maxY() / 5.f * region.height())));
        for (Port port : ports) {
            port.updateRect();
            canvas.drawWidget(port, Rect2i.createFromMinAndMax(
                    (int) (port.rect.minX() / 10.f * region.width()),
                    (int) (port.rect.minY() / 5.f * region.height()),
                    (int) (port.rect.maxX() / 10.f * region.width()),
                    (int) (port.rect.maxY() / 5.f * region.height())));
        }
    }

View Full Code Here

            port.updateRect();
            canvas.drawWidget(port, Rect2i.createFromMinAndMax(
                    (int) (port.rect.minX() / 10.f * region.width()),
                    (int) (port.rect.minY() / 5.f * region.height()),
                    (int) (port.rect.maxX() / 10.f * region.width()),
                    (int) (port.rect.maxY() / 5.f * region.height())));
        }
    }

    public Port.InputPort getInputPort() {
        return inputPort;
View Full Code Here

            contentHeight = canvas.calculateRestrictedSize(content, new Vector2i(canvas.size().x - scrollbarWidth, Integer.MAX_VALUE)).y;

            boolean atBottom = scrollbar.getRange() == scrollbar.getValue();

            Rect2i contentRegion = Rect2i.createFromMinAndSize(0, 0, canvas.size().x - scrollbarWidth, canvas.size().y);
            scrollbar.setRange(contentHeight - contentRegion.height());
            if ((stickToBottom && atBottom) || moveToBottomPending) {
                scrollbar.setValue(scrollbar.getRange());
                moveToBottomPending = false;
            }
            if (moveToTopPending) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.