Examples of minX()


Examples of org.terasology.math.Rect2f.minX()

                textureMat.setFloat2("scale", scale);
                textureMat.setFloat2("offset",
                        absoluteRegion.minX(),
                        absoluteRegion.minY());

                textureMat.setFloat2("texOffset", textureArea.minX() + ux * textureArea.width(), textureArea.minY() + uy * textureArea.height());
                textureMat.setFloat2("texSize", uw * textureArea.width(), uh * textureArea.height());
                break;
            }
            case SCALE_FILL: {
                textureMat.setFloat2("offset", absoluteRegion.minX(), absoluteRegion.minY());
View Full Code Here

Examples of org.terasology.math.Rect2f.minX()

                textureMat.setFloat2("scale", absoluteRegion.width(), absoluteRegion.height());

                float texBorderX = (scale.x - absoluteRegion.width()) / scale.x * uw;
                float texBorderY = (scale.y - absoluteRegion.height()) / scale.y * uh;

                textureMat.setFloat2("texOffset", textureArea.minX() + (ux + 0.5f * texBorderX) * textureArea.width()
                        , textureArea.minY() + (uy + 0.5f * texBorderY) * textureArea.height());
                textureMat.setFloat2("texSize", (uw - texBorderX) * textureArea.width(), (uh - texBorderY) * textureArea.height());
                break;
            }
            default: {
View Full Code Here

Examples of org.terasology.math.Rect2f.minX()

                textureMat.setFloat2("scale", scale);
                textureMat.setFloat2("offset",
                        absoluteRegion.minX() + 0.5f * (absoluteRegion.width() - scale.x),
                        absoluteRegion.minY() + 0.5f * (absoluteRegion.height() - scale.y));

                textureMat.setFloat2("texOffset", textureArea.minX() + ux * textureArea.width(), textureArea.minY() + uy * textureArea.height());
                textureMat.setFloat2("texSize", uw * textureArea.width(), uh * textureArea.height());
                break;
            }
        }

View Full Code Here

Examples of org.terasology.math.Rect2f.minX()

        }
        textureMat.setFloat2("scale", region.width(), region.height());
        textureMat.setFloat2("offset", region.minX(), region.minY());

        Rect2f textureArea = texture.getRegion();
        textureMat.setFloat2("texOffset", textureArea.minX() + ux * textureArea.width(), textureArea.minY() + uy * textureArea.height());
        textureMat.setFloat2("texSize", uw * textureArea.width(), uh * textureArea.height());

        textureMat.setTexture("texture", texture.getTexture());
        textureMat.setFloat4("color", 1, 1, 1, alpha);
        textureMat.bindTextures();
View Full Code Here

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

        final Rect2i pixelRegion = textureRegion.getPixelRegion();
        final Texture texture = textureRegion.getTexture();
        ByteBuffer textureBytes = texture.getData().getBuffers()[0];
        int stride = texture.getWidth() * 4;
        int posX = pixelRegion.minX();
        int posY = pixelRegion.minY();

        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        for (int y = 0; y < height; y++) {
            for (int x = 0; x < width; x++) {
View Full Code Here

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

    public static Mesh generateIconMesh(AssetUri uri, TextureRegion tex, int alphaLimit, boolean withContour, Vector4f colorContour) {
        ByteBuffer buffer = tex.getTexture().getData().getBuffers()[0];

        Rect2i pixelRegion = tex.getPixelRegion();
        int posX = pixelRegion.minX();
        int posY = pixelRegion.minY();

        int stride = tex.getTexture().getWidth() * 4;

        float textureSize = Math.max(tex.getWidth(), tex.getHeight());
View Full Code Here

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

        if (debug) {
            grid.paintDebug();
        }
        for (Rect2i region : debugRects) {
            canvas.drawLine(region.minX(), region.minY(), region.maxX(), region.minY(), Color.WHITE);
            canvas.drawLine(region.maxX(), region.minY(), region.maxX(), region.maxY(), Color.WHITE);
            canvas.drawLine(region.maxX(), region.maxY(), region.minX(), region.maxY(), Color.WHITE);
            canvas.drawLine(region.minX(), region.maxY(), region.minX(), region.minY(), Color.WHITE);
        }
    }
View Full Code Here

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

            grid.paintDebug();
        }
        for (Rect2i region : debugRects) {
            canvas.drawLine(region.minX(), region.minY(), region.maxX(), region.minY(), Color.WHITE);
            canvas.drawLine(region.maxX(), region.minY(), region.maxX(), region.maxY(), Color.WHITE);
            canvas.drawLine(region.maxX(), region.maxY(), region.minX(), region.maxY(), Color.WHITE);
            canvas.drawLine(region.minX(), region.maxY(), region.minX(), region.minY(), Color.WHITE);
        }
    }

    @Override
View Full Code Here

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

        }
        for (Rect2i region : debugRects) {
            canvas.drawLine(region.minX(), region.minY(), region.maxX(), region.minY(), Color.WHITE);
            canvas.drawLine(region.maxX(), region.minY(), region.maxX(), region.maxY(), Color.WHITE);
            canvas.drawLine(region.maxX(), region.maxY(), region.minX(), region.maxY(), Color.WHITE);
            canvas.drawLine(region.minX(), region.maxY(), region.minX(), region.minY(), Color.WHITE);
        }
    }

    @Override
    public void addWidget(UIWidget element, CCHint hint) {
View Full Code Here

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

        }
        for (Rect2i region : debugRects) {
            canvas.drawLine(region.minX(), region.minY(), region.maxX(), region.minY(), Color.WHITE);
            canvas.drawLine(region.maxX(), region.minY(), region.maxX(), region.maxY(), Color.WHITE);
            canvas.drawLine(region.maxX(), region.maxY(), region.minX(), region.maxY(), Color.WHITE);
            canvas.drawLine(region.minX(), region.maxY(), region.minX(), region.minY(), Color.WHITE);
        }
    }

    @Override
    public void addWidget(UIWidget element, CCHint hint) {
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.