Good evening,
I started playing with LWJGL to make a Pong clone, and eventually needed to use Slick2D to add text to my game.
I downloaded a custom font and used this piece of code:
Code:
try {
String fontPath = "./pong/font.ttf";
font = new UnicodeFont(fontPath, 72, false, false);
font.addGlyphs("0123456789");
font.getEffects().add(new ColorEffect(Color.WHITE));
font.loadGlyphs();
} catch (Exception e) {
e.printStackTrace();
}
I then use this piece of code, to print the score of the players:
Code:
font.drawString(100, 50, "" + scoreP1);
font.drawString(WIDTH - 120, 50, "" + scoreP2);
The problem is that when the score of P2 contains a "0" (0, 10, 20, 30, etc.) nothing more is displayed, except the scores.
The score of P1 doesn't affect the drawing of the game.
The downloaded font is called "pixel-siggy".
Any help is aprecciated.
Best regards,
Pedro