double the resolution
This commit is contained in:
@@ -73,9 +73,13 @@ public class RenderScope {
|
||||
|
||||
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.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);
|
||||
matrices.pop();
|
||||
}
|
||||
|
||||
public void drawRoundedCorner(int width, int height, int radius, int color) {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Button extends Element {
|
||||
this.text = text;
|
||||
this.font = Fonts.getFont(bold.value);
|
||||
this.onClick = onClick;
|
||||
this.dimensions(Fonts.getWidth(text, font)+ 25 , Fonts.getHeight() + 10);
|
||||
this.dimensions(Fonts.getWidth(text, font) + 50, Fonts.getHeight() + 20);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,7 +45,7 @@ public class Button extends Element {
|
||||
|
||||
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
|
||||
|
||||
@@ -22,12 +22,21 @@ public class Fonts {
|
||||
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) {
|
||||
return SaturnClient.client.textRenderer.getWidth(Text.literal(text).setStyle(
|
||||
Style.EMPTY.withFont(font)));
|
||||
Style.EMPTY.withFont(font))) * 2;
|
||||
}
|
||||
|
||||
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
|
||||
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_TEXT).dimensions(49, 8).centerOffset(width, height, 0, -18).animation(new Fade(700)));
|
||||
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(98, 16).centerOffset(width, height, 0, -36).animation(new Fade(700)));
|
||||
|
||||
Element button = new Button("Settings", () -> {
|
||||
SaturnClient.client.setScreen(new ModMenu());
|
||||
|
||||
Reference in New Issue
Block a user