Example usage for com.badlogic.gdx.graphics.glutils ShapeRenderer triangle

List of usage examples for com.badlogic.gdx.graphics.glutils ShapeRenderer triangle

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.glutils ShapeRenderer triangle.

Prototype

public void triangle(float x1, float y1, float x2, float y2, float x3, float y3) 

Source Link

Document

Draws a triangle in x/y plane using ShapeType#Line or ShapeType#Filled .

Usage

From source file:com.company.minery.utils.spine.SkeletonRendererDebug.java

License:Open Source License

public void draw(Skeleton skeleton) {
    float skeletonX = skeleton.getX();
    float skeletonY = skeleton.getY();

    Gdx.gl.glEnable(GL20.GL_BLEND);//from  w w  w. j av  a  2 s .  c o m
    int srcFunc = premultipliedAlpha ? GL20.GL_ONE : GL20.GL_SRC_ALPHA;
    Gdx.gl.glBlendFunc(srcFunc, GL20.GL_ONE_MINUS_SRC_ALPHA);

    ShapeRenderer shapes = this.shapes;

    Array<Bone> bones = skeleton.getBones();
    if (drawBones) {
        shapes.setColor(boneLineColor);
        shapes.begin(ShapeType.Filled);
        for (int i = 0, n = bones.size; i < n; i++) {
            Bone bone = bones.get(i);
            if (bone.parent == null)
                continue;
            float x = skeletonX + bone.data.length * bone.m00 + bone.worldX;
            float y = skeletonY + bone.data.length * bone.m10 + bone.worldY;
            shapes.rectLine(skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, boneWidth * scale);
        }
        shapes.end();
        shapes.begin(ShapeType.Line);
        shapes.x(skeletonX, skeletonY, 4 * scale);
    } else
        shapes.begin(ShapeType.Line);

    if (drawRegionAttachments) {
        shapes.setColor(attachmentLineColor);
        Array<Slot> slots = skeleton.getSlots();
        for (int i = 0, n = slots.size; i < n; i++) {
            Slot slot = slots.get(i);
            Attachment attachment = slot.attachment;
            if (attachment instanceof RegionAttachment) {
                RegionAttachment regionAttachment = (RegionAttachment) attachment;
                regionAttachment.updateWorldVertices(slot, false);
                float[] vertices = regionAttachment.getWorldVertices();
                shapes.line(vertices[X1], vertices[Y1], vertices[X2], vertices[Y2]);
                shapes.line(vertices[X2], vertices[Y2], vertices[X3], vertices[Y3]);
                shapes.line(vertices[X3], vertices[Y3], vertices[X4], vertices[Y4]);
                shapes.line(vertices[X4], vertices[Y4], vertices[X1], vertices[Y1]);
            }
        }
    }

    if (drawMeshHull || drawMeshTriangles) {
        Array<Slot> slots = skeleton.getSlots();
        for (int i = 0, n = slots.size; i < n; i++) {
            Slot slot = slots.get(i);
            Attachment attachment = slot.attachment;
            float[] vertices = null;
            short[] triangles = null;
            int hullLength = 0;
            if (attachment instanceof MeshAttachment) {
                MeshAttachment mesh = (MeshAttachment) attachment;
                mesh.updateWorldVertices(slot, false);
                vertices = mesh.getWorldVertices();
                triangles = mesh.getTriangles();
                hullLength = mesh.getHullLength();
            } else if (attachment instanceof SkinnedMeshAttachment) {
                SkinnedMeshAttachment mesh = (SkinnedMeshAttachment) attachment;
                mesh.updateWorldVertices(slot, false);
                vertices = mesh.getWorldVertices();
                triangles = mesh.getTriangles();
                hullLength = mesh.getHullLength();
            }
            if (vertices == null || triangles == null)
                continue;
            if (drawMeshTriangles) {
                shapes.setColor(triangleLineColor);
                for (int ii = 0, nn = triangles.length; ii < nn; ii += 3) {
                    int v1 = triangles[ii] * 5, v2 = triangles[ii + 1] * 5, v3 = triangles[ii + 2] * 5;
                    shapes.triangle(vertices[v1], vertices[v1 + 1], //
                            vertices[v2], vertices[v2 + 1], //
                            vertices[v3], vertices[v3 + 1] //
                    );
                }
            }
            if (drawMeshHull && hullLength > 0) {
                shapes.setColor(attachmentLineColor);
                hullLength = hullLength / 2 * 5;
                float lastX = vertices[hullLength - 5], lastY = vertices[hullLength - 4];
                for (int ii = 0, nn = hullLength; ii < nn; ii += 5) {
                    float x = vertices[ii], y = vertices[ii + 1];
                    shapes.line(x, y, lastX, lastY);
                    lastX = x;
                    lastY = y;
                }
            }
        }
    }

    if (drawBoundingBoxes) {
        SkeletonBounds bounds = this.bounds;
        bounds.update(skeleton, true);
        shapes.setColor(aabbColor);
        shapes.rect(bounds.getMinX(), bounds.getMinY(), bounds.getWidth(), bounds.getHeight());
        shapes.setColor(boundingBoxColor);
        Array<FloatArray> polygons = bounds.getPolygons();
        for (int i = 0, n = polygons.size; i < n; i++) {
            FloatArray polygon = polygons.get(i);
            shapes.polygon(polygon.items, 0, polygon.size);
        }
    }

    shapes.end();
    shapes.begin(ShapeType.Filled);

    if (drawBones) {
        shapes.setColor(boneOriginColor);
        for (int i = 0, n = bones.size; i < n; i++) {
            Bone bone = bones.get(i);
            shapes.setColor(Color.GREEN);
            shapes.circle(skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * scale, 8);
        }
    }

    shapes.end();
}

From source file:com.hindelid.ld.thirtyfour.Octopus.java

License:Apache License

public void render(ShapeRenderer aShapeRenderer) {
    aShapeRenderer.curve(mPos.x, mPos.y, mPos.x + 0.5f, mPos.y + 1f, mPos.x + 0.5f, mPos.y + 1f, mPos.x + 1f,
            mPos.y, 30);/*w w  w  .ja  va  2 s  .  co  m*/
    aShapeRenderer.line(mPos.x, mPos.y, mPos.x + 1f, mPos.y);
    aShapeRenderer.triangle( // Left eye
            mPos.x + 0.3f, mPos.y + 0.4f, mPos.x + 0.35f, mPos.y + 0.45f, mPos.x + 0.45f, mPos.y + 0.32f);
    aShapeRenderer.triangle( // Right eye
            mPos.x + 0.7f, mPos.y + 0.4f, mPos.x + 0.65f, mPos.y + 0.45f, mPos.x + 0.55f, mPos.y + 0.32f);
    aShapeRenderer.line(mPos.x + 0.1f, mPos.y, mPos.x - 0.1f, mPos.y - 0.6f);
    aShapeRenderer.line(mPos.x + 0.4f, mPos.y, mPos.x + 0.35f, mPos.y - 0.6f);
    aShapeRenderer.line(mPos.x + 0.6f, mPos.y, mPos.x + 0.65f, mPos.y - 0.6f);
    aShapeRenderer.line(mPos.x + 0.9f, mPos.y, mPos.x + 1.1f, mPos.y - 0.6f);
}

From source file:com.hindelid.ld.thirtyfour.TreeBranch.java

License:Apache License

public void renderLeefs(ShapeRenderer aShapeRenderer) {
    aShapeRenderer.triangle(mLeefCord1.x, mLeefCord1.y, mLeefCord2.x, mLeefCord2.y, mLeefCord3.x, mLeefCord3.y);
    if (null != mLeftBranch) {
        mLeftBranch.renderLeefs(aShapeRenderer);
    }/* ww w  . ja  va  2  s  .c  om*/
    if (null != mRightBranch) {
        mRightBranch.renderLeefs(aShapeRenderer);
    }
    if (null != mMiddleBranch) {
        mMiddleBranch.renderLeefs(aShapeRenderer);
    }
}

From source file:net.noviden.towerdefense.UnitFactory.HexagonUnit.java

License:Open Source License

public void draw(ShapeRenderer shapeRenderer) {
    // draw each unit's health as a percent of its shape
    float percentHealthMissing = 1.0f - (this.health / this.maxHealth);
    float percentToDraw;

    float s = centerToVertex / 2, c = (float) Math.sqrt(3) * centerToVertex / 2;

    // draw a hexagon centered at the current location
    shapeRenderer.set(ShapeRenderer.ShapeType.Filled);
    shapeRenderer.setColor(BASE_UNIT_COLOR);

    shapeRenderer.identity();/* w w w . ja v  a  2  s  .  c  om*/

    shapeRenderer.translate(location.x, location.y, 0.f);
    shapeRenderer.rotate(0f, 0f, 1f, rotation);

    //     E * * * F
    //   * * * * * * *
    // D * * * M * * * A
    //   * * * * * * *
    //    C * * * B

    // draw triangle MAB
    shapeRenderer.triangle(0, 0, centerToVertex, 0, s, -c);

    // draw triangle MBC
    shapeRenderer.triangle(0, 0, s, -c, -s, -c);

    // draw triangle MCD
    shapeRenderer.triangle(0, 0, -s, -c, -centerToVertex, 0);

    // draw triangle MDE
    shapeRenderer.triangle(0, 0, -centerToVertex, 0, -s, c);

    // draw triangle MEF
    shapeRenderer.triangle(0, 0, -s, c, s, c);

    // draw triangle MFA
    shapeRenderer.triangle(0, 0, s, c, centerToVertex, 0);

    if (percentHealthMissing > 0.0f) {

        // draw in missing health
        shapeRenderer.setColor(BASE_UNIT_DAMAGED_COLOR);

        // draw triangle MAB
        percentToDraw = MathUtils.clamp(percentHealthMissing / 0.166f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, centerToVertex, 0,
                centerToVertex - (Math.abs(centerToVertex - s) * percentToDraw), -c * percentToDraw);

        // draw triangle MBC
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.166f) / 0.166f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, s, -c, s - (s * 2 * percentToDraw), -c);

        // draw triangle MCD
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.33f) / 0.166f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, -s, -c, -s - (Math.abs(centerToVertex - s) * percentToDraw),
                -c + (c * percentToDraw));

        // draw triangle MDE
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.5f) / 0.166f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, -centerToVertex, 0,
                -centerToVertex + (Math.abs(centerToVertex - s) * percentToDraw), c * percentToDraw);

        // draw triangle MEF
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.66f) / 0.166f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, -s, c, -s + (s * 2 * percentToDraw), c);

        // draw triangle MFA
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.83f) / 0.166f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, s, c, s + (Math.abs(centerToVertex - s) * percentToDraw),
                c - (c * percentToDraw));
    }

    shapeRenderer.identity();
}

From source file:net.noviden.towerdefense.UnitFactory.PentagonUnit.java

License:Open Source License

@Override
public void draw(ShapeRenderer shapeRenderer) {
    // draw each unit's health as a percent of its shape
    float percentHealthMissing = 1.0f - (this.health / this.maxHealth);
    float percentToDraw;

    // thank you based wolframalpha
    // http://mathworld.wolfram.com/Pentagon.html

    float c1 = MathUtils.cos(MathUtils.PI * 2.0f / 5.0f) * centerToVertex,
            c2 = MathUtils.cos(MathUtils.PI / 5.0f) * centerToVertex,
            s1 = MathUtils.sin(MathUtils.PI * 2.0f / 5.0f) * centerToVertex,
            s2 = MathUtils.sin(MathUtils.PI * 4.0f / 5.0f) * centerToVertex;

    // draw a pentagon centered at the current location
    shapeRenderer.set(ShapeRenderer.ShapeType.Filled);
    shapeRenderer.setColor(BASE_UNIT_COLOR);

    shapeRenderer.identity();/*from www. j  ava  2 s  . c o  m*/

    shapeRenderer.translate(location.x, location.y, 0.f);
    shapeRenderer.rotate(0f, 0f, 1f, rotation);

    // draw the pentagon

    //          A
    //        *   *
    //      E   M   B
    //       *     *
    //        D * C

    // draw triangle MAB
    shapeRenderer.triangle(0, 0, 0, centerToVertex, s1, c1);

    // draw triangle MBC
    shapeRenderer.triangle(0, 0, s1, c1, s2, -c2);

    // draw triangle MCD
    shapeRenderer.triangle(0, 0, s2, -c2, -s2, -c2);

    // draw triangle MDE
    shapeRenderer.triangle(0, 0, -s2, -c2, -s1, c1);

    // draw triangle MEA
    shapeRenderer.triangle(0, 0, -s1, c1, 0, centerToVertex);

    if (percentHealthMissing > 0.0f) {
        // draw missing health
        shapeRenderer.setColor(BASE_UNIT_DAMAGED_COLOR);

        // triangle MAB
        percentToDraw = MathUtils.clamp(percentHealthMissing / 0.2f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, 0, centerToVertex, s1 * percentToDraw,
                centerToVertex - (Math.abs(centerToVertex - c1) * percentToDraw));

        // triangle MBC
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.2f) / 0.2f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, s1, c1, s1 - (Math.abs(s1 - s2) * percentToDraw),
                c1 - ((c1 + c2) * percentToDraw));

        // triangle MCD
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.4f) / 0.2f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, s2, -c2, s2 - (s2 * 2 * percentToDraw), -c2);

        // triangle MDE
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.6f) / 0.2f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, -s2, -c2, -s2 - (Math.abs(s1 - s2) * percentToDraw),
                -c2 + ((c1 + c2) * percentToDraw));

        // triangle MEA
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.8f) / 0.2f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, -s1, c1, -s1 + (s1 * percentToDraw),
                c1 + (Math.abs(centerToVertex - c1) * percentToDraw));

    }

    shapeRenderer.identity();
}

From source file:net.noviden.towerdefense.UnitFactory.SquareUnit.java

License:Open Source License

@Override
public void draw(ShapeRenderer shapeRenderer) {
    // draw each unit's health as a percent of its shape
    float percentHealthMissing = 1.0f - (this.health / this.maxHealth);

    // draw a square centered at the current location
    shapeRenderer.set(ShapeRenderer.ShapeType.Filled);
    shapeRenderer.setColor(BASE_UNIT_COLOR);

    shapeRenderer.identity();/*from   ww  w  .j  a  v a 2  s.c o m*/

    shapeRenderer.translate(location.x, location.y, 0.f);
    shapeRenderer.rotate(0f, 0f, 1f, rotation);
    shapeRenderer.rect(-sideLength / 2, -sideLength / 2, sideLength, sideLength);

    // draw missing health: break up square into 4 distinct triangles
    if (percentHealthMissing > 0.0f) {
        shapeRenderer.setColor(BASE_UNIT_DAMAGED_COLOR);
        float percentToDraw;

        // draw 1 / 4
        percentToDraw = MathUtils.clamp(percentHealthMissing / 0.25f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, sideLength / 2, -sideLength / 2, sideLength / 2,
                -sideLength / 2 + percentToDraw * sideLength);

        // draw 2 / 4
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.25f) / 0.25f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, sideLength / 2, sideLength / 2,
                sideLength / 2 - percentToDraw * sideLength, sideLength / 2);

        // draw 3 / 4
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.5f) / 0.25f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, -sideLength / 2, sideLength / 2, -sideLength / 2,
                sideLength / 2 - percentToDraw * sideLength);

        // draw 4 / 4
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.75f) / 0.25f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, -sideLength / 2, -sideLength / 2,
                -sideLength / 2 + percentToDraw * sideLength, -sideLength / 2);
    }

    // reset the shapeRenderer transformation matrix
    shapeRenderer.identity();
}

From source file:net.noviden.towerdefense.UnitFactory.TriangleUnit.java

License:Open Source License

@Override
public void draw(ShapeRenderer shapeRenderer) {
    // draw each unit's health as a percent of its shape
    float percentHealthMissing = 1.0f - (this.health / this.maxHealth);
    float percentToDraw;

    // draw a square centered at the current location
    shapeRenderer.set(ShapeRenderer.ShapeType.Filled);
    shapeRenderer.setColor(BASE_UNIT_COLOR);

    shapeRenderer.identity();/*w  w w  .  j a  va2s.co m*/

    shapeRenderer.translate(location.x, location.y, 0.f);
    shapeRenderer.rotate(0f, 0f, 1f, rotation);

    shapeRenderer.triangle(points[0].x, points[0].y, points[1].x, points[1].y, points[2].x, points[2].y);

    // draw in health missing, break down large triangle into three smaller ones
    shapeRenderer.setColor(BASE_UNIT_DAMAGED_COLOR);

    if (percentHealthMissing > 0.0f) {

        // draw 1 / 3, MAB
        percentToDraw = MathUtils.clamp(percentHealthMissing / 0.33f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, points[0].x, points[0].y,
                points[0].x + (Math.abs(points[0].x - points[1].x) * percentToDraw),
                points[0].y - (Math.abs(points[0].y - points[1].y) * percentToDraw));

        // draw 2 / 3, MBC
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.33f) / 0.33f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, points[1].x, points[1].y, points[1].x - (points[1].x * percentToDraw * 2),
                points[2].y);

        // draw 3 / 3, MCA
        percentToDraw = MathUtils.clamp((percentHealthMissing - 0.66f) / 0.33f, 0, 1.0f);
        shapeRenderer.triangle(0, 0, points[2].x, points[2].y,
                points[2].x + (Math.abs(points[2].x - points[0].x) * percentToDraw),
                points[2].y + (Math.abs(points[2].y - points[0].y) * percentToDraw));
    }

    shapeRenderer.identity();
}

From source file:org.ams.testapps.paintandphysics.cardhouse.TurnCircle.java

License:Open Source License

/** Fill polygon with color. */
private void renderPolygonFilling(ShapeRenderer renderer, float[] polygon, short[] fillingTriangles) {

    int ntriangles = fillingTriangles.length / 3;
    for (int i = 0; i < ntriangles; i++) {
        for (int j = 0; j < 3; j++) {
            triangle[j] = fillingTriangles[j + i * 3];
        }/*  w  w w  . j a v  a  2  s.  c o  m*/
        for (int j = 0; j < 3; j++) {
            t[2 * j] = polygon[triangle[j] * 2];
            t[2 * j + 1] = polygon[triangle[j] * 2 + 1];
        }

        renderer.triangle(t[0], t[1], t[2], t[3], t[4], t[5]);
    }
}

From source file:pl.kotcrab.jdialogue.editor.components.ConnectionRenderer.java

License:Open Source License

public void renderTraingles(ShapeRenderer shapeRenderer, DComponent comp, boolean ignoreInvisible) {
    if (comp instanceof RelayComponent) {
        RelayComponent rcomp = (RelayComponent) comp;
        if ((boolean) rcomp.getTableModel().data[0][1] == true)
            shapeRenderer.setColor(Color.RED);

    }/*  w w  w .  j  av a2 s.  c om*/

    Connector[] inputs = comp.getOutputs();

    for (int i = 0; i < inputs.length; i++) {
        Connector con = inputs[i];
        Connector target = con.getTarget();

        if (target == null)
            continue;

        if (target.getParrentComponent().isVisible() == false && con.getParrentComponent().isVisible() == false)
            continue;

        float y2 = target.getY() + 6;

        if (ignoreInvisible == false && comp instanceof RelayComponent
                && (boolean) comp.getTableModel().data[0][1] == true) {
            shapeRenderer.setColor(Color.RED);
            shapeRenderer.triangle(target.getX() - 8, target.getY() + 20, target.getX() - 8, target.getY() + 32,
                    target.getX() + 3, y2 + 20); // ending triangle
            shapeRenderer.triangle(con.getX() + 12, con.getY(), con.getX() + 12, con.getY() + 12,
                    con.getX() + 22, con.getY() + 6); // ending triangle
        } else {
            shapeRenderer.setColor(Color.BLACK);
            shapeRenderer.triangle(target.getX() - 8, target.getY(), target.getX() - 8, target.getY() + 12,
                    target.getX() + 3, y2); // ending triangle
        }

    }
}

From source file:releasethekraken.ui.tooltip.PowerUpToolTip.java

@Override
public void renderShapes(ShapeRenderer shapeRenderer, float delta, float runTime) {
    super.renderShapes(shapeRenderer, delta, runTime);

    if (this.visible) {
        //The mouse coordinates
        float mouseX = Gdx.input.getX(0);
        float mouseY = Gdx.input.getY(0);

        float textHeight = GameAssets.fontMain.getCapHeight();

        float boxWidth = (0.25F + 0.005F) * Gdx.graphics.getWidth();
        float boxHeight = this.descriptionHeight + GameAssets.fontMain.getCapHeight()
                + 0.08F * Gdx.graphics.getHeight();

        float boxX = mouseX + 0.05F * Gdx.graphics.getWidth();
        float boxY = Gdx.graphics.getHeight() - mouseY + (boxHeight - textHeight) / 2 + textHeight / 2;

        float triangleAlignX = boxX;

        /*//from   w  ww . j  a  va  2  s  .co  m
        Starting and stopping the shape renderer multiple times and copying 
        colors might have an impact on performance.  We might want to find
        a more efficient way of doing this.  Maybe tooltips get their own
        render pass?
        */

        shapeRenderer.end(); //End the shape batch, drawing everything it has so far

        //Enable OpenGL alpha blending
        Gdx.gl.glEnable(Gdx.gl.GL_BLEND);
        Gdx.gl.glBlendFunc(Gdx.gl.GL_SRC_ALPHA, Gdx.gl.GL_ONE_MINUS_SRC_ALPHA);

        //Start a new shape batch
        shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);

        //Render tooltip background
        shapeRenderer.setColor(this.color.cpy().sub(0, 0, 0, 0.35F)); //Make the color transparent
        shapeRenderer.rect(boxX, boxY - boxHeight, boxWidth, boxHeight); //Tooltip background
        shapeRenderer.triangle(mouseX, Gdx.graphics.getHeight() - mouseY, triangleAlignX, boxY, triangleAlignX,
                boxY - boxHeight); //Triangle part

        shapeRenderer.end(); //End the shape batch, drawing the transparent tooltip

        //Disable OpenGL blending so everything else doesn't get messed up
        Gdx.gl.glDisable(Gdx.gl.GL_BLEND);

        //Start a new shape batch so that it is left in the state it started in
        shapeRenderer.begin(ShapeRenderer.ShapeType.Line);

        //Draw the radius symbol            
        shapeRenderer.setColor(Color.BLUE);
        shapeRenderer.circle(boxX + 0.009F * Gdx.graphics.getWidth(),
                Gdx.graphics.getHeight() - mouseY - 0.04F * Gdx.graphics.getWidth(),
                0.008F * Gdx.graphics.getWidth());

        shapeRenderer.line(boxX + 0.009F * Gdx.graphics.getWidth(),
                Gdx.graphics.getHeight() - mouseY - 0.04F * Gdx.graphics.getWidth(),
                boxX + 0.009F * Gdx.graphics.getWidth() + 0.008F * Gdx.graphics.getWidth(),
                Gdx.graphics.getHeight() - mouseY - 0.04F * Gdx.graphics.getWidth());

        shapeRenderer.end();
        shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);
    }
}