diff --git a/RPGOnline2/src/io/github/tomaso2468/rpgonline/Font.java b/RPGOnline2/src/io/github/tomaso2468/rpgonline/Font.java index 9b39ed4..de506ec 100644 --- a/RPGOnline2/src/io/github/tomaso2468/rpgonline/Font.java +++ b/RPGOnline2/src/io/github/tomaso2468/rpgonline/Font.java @@ -42,6 +42,11 @@ public interface Font { * @return A positive float value. */ public float getHeight(String text); + /** + * Gets the height of a line of text. + * @return A positive float value. + */ + public float getHeight(); /** * Gets the width (in pixels) of a piece of text. * @param text The text to measure. diff --git a/RPGOnline2/src/io/github/tomaso2468/rpgonline/Game.java b/RPGOnline2/src/io/github/tomaso2468/rpgonline/Game.java index 68c150a..8a8280d 100644 --- a/RPGOnline2/src/io/github/tomaso2468/rpgonline/Game.java +++ b/RPGOnline2/src/io/github/tomaso2468/rpgonline/Game.java @@ -596,7 +596,7 @@ protected float drawDebugTitle(Graphics g, String s, float y, boolean side) { } else { g.drawString(s, renderer.getWidth() - 4 - g.getFont().getWidth(s), y); } - return y + g.getFont().getHeight("[]") + 1; + return y + g.getFont().getHeight() + 1; } /** @@ -615,7 +615,7 @@ protected float drawDebugLine(Graphics g, String s, float y, boolean side) { } else { g.drawString(s, renderer.getWidth() - 4 - g.getFont().getWidth(s), y); } - return y + g.getFont().getHeight("[]") + 1; + return y + g.getFont().getHeight() + 1; } /** @@ -635,7 +635,7 @@ protected float drawDebugLineLabel(Graphics g, String label, String data, float } else { g.drawString(label + ": " + data, renderer.getWidth() - 4 - g.getFont().getWidth(label + ": " + data), y); } - return y + g.getFont().getHeight("[]") + 1; + return y + g.getFont().getHeight() + 1; } /** @@ -671,7 +671,7 @@ protected float drawDebugLineRYWHigh(Graphics g, String label, long data, long y } g.setColor(Color.white.darker()); - return y + g.getFont().getHeight("[]") + 1; + return y + g.getFont().getHeight() + 1; } /** @@ -707,7 +707,7 @@ protected float drawDebugLineRYWLow(Graphics g, String label, long data, long ye } g.setColor(Color.white.darker()); - return y + g.getFont().getHeight("[]") + 1; + return y + g.getFont().getHeight() + 1; } /** @@ -743,7 +743,7 @@ protected float drawDebugLineRYWHigh(Graphics g, String label, double data, doub } g.setColor(Color.white.darker()); - return y + g.getFont().getHeight("[]") + 1; + return y + g.getFont().getHeight() + 1; } /** @@ -779,7 +779,7 @@ protected float drawDebugLineRYWLow(Graphics g, String label, double data, doubl } g.setColor(Color.white.darker()); - return y + g.getFont().getHeight("[]") + 1; + return y + g.getFont().getHeight() + 1; } /** @@ -817,7 +817,7 @@ protected float drawDebugLineRAM(Graphics g, String label, double data, double m } g.setColor(Color.white.darker()); - return y + g.getFont().getHeight("[]") + 1; + return y + g.getFont().getHeight() + 1; } /** diff --git a/RPGOnline2/src/io/github/tomaso2468/rpgonline/render/opengl/SlickFont.java b/RPGOnline2/src/io/github/tomaso2468/rpgonline/render/opengl/SlickFont.java index c374991..fecf66e 100644 --- a/RPGOnline2/src/io/github/tomaso2468/rpgonline/render/opengl/SlickFont.java +++ b/RPGOnline2/src/io/github/tomaso2468/rpgonline/render/opengl/SlickFont.java @@ -52,5 +52,10 @@ public float getHeight(String text) { public float getWidth(String text) { return font.getWidth(text); } + + @Override + public float getHeight() { + return font.getLineHeight(); + } }