Center hints

This commit is contained in:
Minecon724 2024-10-04 18:34:34 +02:00
parent ce738abbc8
commit 48a9fa11e4
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -71,7 +71,8 @@ public class Renderer {
for (int i=0; i<lines.length; i++) { for (int i=0; i<lines.length; i++) {
String line = lines[i]; String line = lines[i];
bounds = font.getStringBounds(line, frc); bounds = font.getStringBounds(line, frc);
graphics2D.drawString(line, x, y + (textHeight * i)); double padding = (TILE_SIZE - bounds.getWidth()) / 2;
graphics2D.drawString(line, x + (int)padding, y + (textHeight * i));
} }
} }
} }