I am currently trying to create a game for a school project and I have come up with an annoying bug.
When I try and set the font in a buffer strategy, it doesn't load and any drawing after the setFont doesn't get drawn...
Here's my code:
BufferStrategy bs = this.getBufferStrategy();
if (bs == null){
createBufferStrategy(3);
return;
}
Graphics s = bs.getDrawGraphics();
Graphics2D g = (Graphics2D)s;
g.drawString("OldFont (This shows on the canvas)", 20,20,null);
g.setFont(font1);
g.drawString("NewFont (This doesn't show at all.",50,50,null);
Font font1 is a pre-loaded font which is a custom font which I have pre-loaded in a jar.
I'm a stumped and have no idea what to do. Any help?