aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
diff options
context:
space:
mode:
authorefefury <69400149+efefury@users.noreply.github.com>2023-02-06 13:54:31 +0000
committerGitHub <noreply@github.com>2023-02-06 14:54:31 +0100
commitfc576576b8aa18476766e166718d98a6c0fb4575 (patch)
tree3f57cc62eac197a9bf2f1d3e179ce7332e82e018 /src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
parent5e77a5d07faa6bfced80eef06ce34d43661fcba4 (diff)
downloadnotenoughupdates-fc576576b8aa18476766e166718d98a6c0fb4575.tar.gz
notenoughupdates-fc576576b8aa18476766e166718d98a6c0fb4575.tar.bz2
notenoughupdates-fc576576b8aa18476766e166718d98a6c0fb4575.zip
Align level in Basic PV page to center (#586)
Fixes https://github.com/NotEnoughUpdates/NotEnoughUpdates/issues/584
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
index 952eb50f..0424e311 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
@@ -1229,6 +1229,22 @@ public class Utils {
drawStringScaled(str, fr, x - len / 2, y - fontHeight / 2, shadow, colour, factor);
}
+ public static void drawStringCenteredScaled(
+ String str,
+ FontRenderer fr,
+ float x,
+ float y,
+ boolean shadow,
+ float factor
+ ) {
+ int strLen = fr.getStringWidth(str);
+
+ float x2 = x - strLen / 2f;
+ float y2 = y - fr.FONT_HEIGHT / 2f;
+
+ drawStringScaled(str, fr, x2, y2, shadow, 0, factor);
+ }
+
public static void drawStringCenteredYScaled(
String str,
FontRenderer fr,