We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 859adc8 commit f81eceaCopy full SHA for f81ecea
src/main/java/com/cleanroommc/modularui/drawable/GuiDraw.java
@@ -43,7 +43,18 @@ public class GuiDraw {
43
public static final double PI_2 = Math.PI / 2;
44
45
public static void drawRect(float x0, float y0, float w, float h, int color) {
46
- drawRect(x0, y0, w, h, color, color, color, color);
+ Platform.setupDrawColor();
47
+ float x1 = x0 + w, y1 = y0 + h;
48
+ float r = Color.getRedF(color);
49
+ float g = Color.getGreenF(color);
50
+ float b = Color.getBlueF(color);
51
+ float a = Color.getAlphaF(color);
52
+ Platform.startDrawing(Platform.DrawMode.QUADS, Platform.VertexFormat.POS_COLOR, bufferBuilder -> {
53
+ bufferBuilder.pos(x0, y0, 0.0f).color(r, g, b, a).endVertex();
54
+ bufferBuilder.pos(x0, y1, 0.0f).color(r, g, b, a).endVertex();
55
+ bufferBuilder.pos(x1, y1, 0.0f).color(r, g, b, a).endVertex();
56
+ bufferBuilder.pos(x1, y0, 0.0f).color(r, g, b, a).endVertex();
57
+ });
58
}
59
60
public static void drawHorizontalGradientRect(float x0, float y0, float w, float h, int colorLeft, int colorRight) {
0 commit comments