double the resolution

This commit is contained in:
2025-04-29 05:55:09 -05:00
parent bb9cc623c7
commit f0e554d8bc
4 changed files with 20 additions and 7 deletions
@@ -73,9 +73,13 @@ public class RenderScope {
Identifier font = bold ? Fonts.PANTON_BOLD : Fonts.PANTON; Identifier font = bold ? Fonts.PANTON_BOLD : Fonts.PANTON;
matrices.push();
matrices.translate(x, y, 0);
matrices.scale(2.0f, 2.0f, 1.0f);
TextRenderer textRenderer = SaturnClient.client.textRenderer; TextRenderer textRenderer = SaturnClient.client.textRenderer;
textRenderer.draw(Fonts.setFont(text, font), (float) x, (float) y, color, false, this.matrices.peek().getPositionMatrix(), textRenderer.draw(Fonts.setFont(text, font), 0, 0, color, false, this.matrices.peek().getPositionMatrix(),
this.vertexConsumers, TextLayerType.NORMAL, 0, 15728880); this.vertexConsumers, TextLayerType.NORMAL, 0, 15728880);
matrices.pop();
} }
public void drawRoundedCorner(int width, int height, int radius, int color) { public void drawRoundedCorner(int width, int height, int radius, int color) {
@@ -31,7 +31,7 @@ public class Button extends Element {
this.text = text; this.text = text;
this.font = Fonts.getFont(bold.value); this.font = Fonts.getFont(bold.value);
this.onClick = onClick; this.onClick = onClick;
this.dimensions(Fonts.getWidth(text, font)+ 25 , Fonts.getHeight() + 10); this.dimensions(Fonts.getWidth(text, font) + 50, Fonts.getHeight() + 20);
} }
@Override @Override
@@ -45,7 +45,7 @@ public class Button extends Element {
renderScope.drawRoundedBorder(width, height, border.value, cornerRadius.value, borderColor.value); renderScope.drawRoundedBorder(width, height, border.value, cornerRadius.value, borderColor.value);
renderScope.drawText(text, width / 2 - Fonts.getWidth(text, font) / 2, height / 2 - Fonts.getHeight() / 2, bold.value, fgColor.value); renderScope.drawText(text, (width - Fonts.getWidth(text, font)) / 2, (height - Fonts.getHeight()) / 2, bold.value, fgColor.value);
} }
@Override @Override
@@ -22,12 +22,21 @@ public class Fonts {
Style.EMPTY.withFont(font)); Style.EMPTY.withFont(font));
} }
// public static int getWidth(String text, Identifier font) {
// return SaturnClient.client.textRenderer.getWidth(Text.literal(text).setStyle(
// Style.EMPTY.withFont(font)));
// }
// public static int getHeight() {
// return SaturnClient.client.textRenderer.fontHeight;
// }
public static int getWidth(String text, Identifier font) { public static int getWidth(String text, Identifier font) {
return SaturnClient.client.textRenderer.getWidth(Text.literal(text).setStyle( return SaturnClient.client.textRenderer.getWidth(Text.literal(text).setStyle(
Style.EMPTY.withFont(font))); Style.EMPTY.withFont(font))) * 2;
} }
public static int getHeight() { public static int getHeight() {
return SaturnClient.client.textRenderer.fontHeight; return SaturnClient.client.textRenderer.fontHeight * 2;
} }
} }
@@ -20,8 +20,8 @@ public class ShiftMenu extends SaturnScreen {
@Override @Override
public void ui() { public void ui() {
draw(new ImageTexture(Textures.LOGO).dimensions(49, 49).centerOffset(width, height, 0, -40).animation(new SlideY(700, -40))); draw(new ImageTexture(Textures.LOGO).dimensions(98, 98).centerOffset(width, height, 0, -80).animation(new SlideY(700, -40)));
draw(new ImageTexture(Textures.LOGO_TEXT).dimensions(49, 8).centerOffset(width, height, 0, -18).animation(new Fade(700))); draw(new ImageTexture(Textures.LOGO_TEXT).dimensions(98, 16).centerOffset(width, height, 0, -36).animation(new Fade(700)));
Element button = new Button("Settings", () -> { Element button = new Button("Settings", () -> {
SaturnClient.client.setScreen(new ModMenu()); SaturnClient.client.setScreen(new ModMenu());