almost there
This commit is contained in:
@@ -36,7 +36,7 @@ public class SaturnClient implements ModInitializer {
|
||||
ScreenEvents.BEFORE_INIT.register((client, screen, scaledWidth, scaledHeight) -> {
|
||||
if (SaturnClientConfig.saturnTitleScreen.value && screen instanceof TitleScreen
|
||||
&& !(screen instanceof SaturnMenu)) {
|
||||
client.setScreen(new SaturnTitleScreen());
|
||||
client.setScreen(new SaturnMenu());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class RenderScope {
|
||||
this.vertexConsumers, TextLayerType.NORMAL, 0, 15728880);
|
||||
}
|
||||
|
||||
private void drawRoundedCorner(int width, int height, int radius, int color) {
|
||||
public void drawRoundedCorner(int width, int height, int radius, int color) {
|
||||
int w = width * 10;
|
||||
int h = height * 10;
|
||||
|
||||
@@ -105,7 +105,6 @@ public class RenderScope {
|
||||
|
||||
this.matrices.pop();
|
||||
|
||||
|
||||
this.matrices.push();
|
||||
|
||||
this.matrices.translate(cornerWidth, cornerHeight * 2, 0);
|
||||
@@ -116,15 +115,14 @@ public class RenderScope {
|
||||
|
||||
this.matrices.scale(0.1f, 0.1f, 1.0f);
|
||||
|
||||
this.drawRoundedCorner(cornerWidth, cornerHeight, radius, color);
|
||||
this.drawRoundedCorner(cornerHeight, cornerWidth, radius, color);
|
||||
|
||||
this.matrices.pop();
|
||||
|
||||
|
||||
|
||||
this.matrices.push();
|
||||
|
||||
this.matrices.translate(cornerWidth * 2, cornerHeight, 0);
|
||||
this.matrices.translate(cornerWidth * 2, 0, 0);
|
||||
|
||||
this.matrices.multiply(RotationAxis.NEGATIVE_Z.rotationDegrees(180));
|
||||
|
||||
@@ -137,7 +135,6 @@ public class RenderScope {
|
||||
this.matrices.pop();
|
||||
|
||||
|
||||
|
||||
this.matrices.push();
|
||||
|
||||
this.matrices.translate(cornerWidth, 0, 0);
|
||||
@@ -148,7 +145,7 @@ public class RenderScope {
|
||||
|
||||
this.matrices.scale(0.1f, 0.1f, 1.0f);
|
||||
|
||||
this.drawRoundedCorner(cornerWidth, cornerHeight, radius, color);
|
||||
this.drawRoundedCorner(cornerHeight, cornerWidth, radius, color);
|
||||
|
||||
this.matrices.pop();
|
||||
|
||||
|
||||
@@ -19,7 +19,12 @@ public class Button extends Element {
|
||||
|
||||
@Override
|
||||
public void render(RenderScope renderScope) {
|
||||
renderScope.drawRoundedRectangle(this.x, this.y, 200, 100, 10, this.color);
|
||||
int w = 100;
|
||||
int h = 100;
|
||||
|
||||
renderScope.drawRoundedRectangle(0, 0, w, h, 80, 0xFF000000);
|
||||
// renderScope.drawRect(0, h, w, h, color);
|
||||
// renderScope.drawRect(w, 0, w, h, color);
|
||||
// renderScope.drawText(this.text, this.x, this.y, false, this.color);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user