src/main/java/dev/lambdaurora/spruceui/util/RenderUtil.java
public static void renderSelectionBox(int x, int y, int width, int height, int red, int green, int blue, int alpha) {
        var tessellator = Tessellator.getInstance();
        var bufferBuilder = tessellator.getBuffer();
        RenderSystem.disableTexture();

        int top = y + height;
        int right = x + width;

        RenderSystem.setShader(GameRenderer::getPositionColorShader);
        RenderSystem.setShaderColor(red / 255.f, green / 255.f, blue / 255.f, alpha / 255.f);
        bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION);
        bufferBuilder.vertex(x, top, 0).next();
        bufferBuilder.vertex(right, top, 0).next();
        bufferBuilder.vertex(right, y, 0).next();
        bufferBuilder.vertex(x, y, 0).next();
        tessellator.draw();
        RenderSystem.setShaderColor(0, 0, 0, 1.f);
        bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION);
        bufferBuilder.vertex(x + 1, top - 1, 0).next();
        bufferBuilder.vertex(right - 1, top - 1, 0).next();
        bufferBuilder.vertex(right - 1, y + 1, 0).next();
        bufferBuilder.vertex(x + 1, y + 1, 0).next();
        tessellator.draw();
        RenderSystem.enableTexture();
    }
/**
     * Renders a selection box as background.
     *
     * @param x the X-coordinate of the selection box
     * @param y the Y-coordinate of the selection box
     * @param width the width of the selection box
     * @param height the height of the selection box
     * @param red the red-component color value of the outer border
     * @param green the green-component color value of the outer border
     * @param blue the blue-component color value of the outer border
     * @param alpha the alpha-component color value of the outer border
     */
Renders a selection box as background.
Renders a selection box as background .
public static void renderSelectionBox(int x, int y, int width, int height, int red, int green, int blue, int alpha) {
        var tessellator = Tessellator.getInstance();
        var bufferBuilder = tessellator.getBuffer();
        RenderSystem.disableTexture();
        int top = y + height;
        int right = x + width;
        RenderSystem.setShader(GameRenderer::getPositionColorShader);
        RenderSystem.setShaderColor(red / 255.f, green / 255.f, blue / 255.f, alpha / 255.f);
        bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION);
        bufferBuilder.vertex(x, top, 0).next();
        bufferBuilder.vertex(right, top, 0).next();
        bufferBuilder.vertex(right, y, 0).next();
        bufferBuilder.vertex(x, y, 0).next();
        tessellator.draw();
        RenderSystem.setShaderColor(0, 0, 0, 1.f);
        bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION);
        bufferBuilder.vertex(x + 1, top - 1, 0).next();
        bufferBuilder.vertex(right - 1, top - 1, 0).next();
        bufferBuilder.vertex(right - 1, y + 1, 0).next();
        bufferBuilder.vertex(x + 1, y + 1, 0).next();
        tessellator.draw();
        RenderSystem.enableTexture();
    }
public static void renderSelectionBox ( int x , int y , int width , int height , int red , int green , int blue , int alpha ) { var tessellator = Tessellator . getInstance ( ) ; var bufferBuilder = tessellator . getBuffer ( ) ; RenderSystem . disableTexture ( ) ; int top = y + height ; int right = x + width ; RenderSystem . setShader ( GameRenderer :: getPositionColorShader ) ; RenderSystem . setShaderColor ( red / 255.f , green / 255.f , blue / 255.f , alpha / 255.f ) ; bufferBuilder . begin ( VertexFormat . DrawMode . QUADS , VertexFormats . POSITION ) ; bufferBuilder . vertex ( x , top , 0 ) . next ( ) ; bufferBuilder . vertex ( right , top , 0 ) . next ( ) ; bufferBuilder . vertex ( right , y , 0 ) . next ( ) ; bufferBuilder . vertex ( x , y , 0 ) . next ( ) ; tessellator . draw ( ) ; RenderSystem . setShaderColor ( 0 , 0 , 0 , 1.f ) ; bufferBuilder . begin ( VertexFormat . DrawMode . QUADS , VertexFormats . POSITION ) ; bufferBuilder . vertex ( x + 1 , top - 1 , 0 ) . next ( ) ; bufferBuilder . vertex ( right - 1 , top - 1 , 0 ) . next ( ) ; bufferBuilder . vertex ( right - 1 , y + 1 , 0 ) . next ( ) ; bufferBuilder . vertex ( x + 1 , y + 1 , 0 ) . next ( ) ; tessellator . draw ( ) ; RenderSystem . enableTexture ( ) ; }
Renders a selection box as background.
Renders a selection box as background .