Hi
I’m in the early development of a game and I ran into a problem that has never occurred before. When I call the Graphics2D#drawString() method, the game stops - the game loop that is. There are no errors printed in the console, the string will be displayed on the screen, but the game loop doesn’t continue.
I’m just wondering if anyone has encountered this before? There’s no mention of anything like this happening in the docs and Google doesn’t come up with anything.
Other methods work, such as fillRect, composites, color, etc. It’s just this one problem.
@Override
public void render(UnitedTD game, Screen screen) {
//screen.applyOpacity(alpha); //work
//screen.setColor(Color.RED); //work
//screen.setFont(new Font("Arial", 0, 70)); //work
//screen.fillRect(150, 150, 150, 150); //work
//screen.drawString("Hello World", 150, 150); // doesn't work
//screen.getGraphics2DObjectFromBufferedImage().drawString("test", 1, 1); //also doesn't work
}
I’ve tried switching stuff around, but it keeps stopping at drawString. Thanks in advance!