我是开发游戏的新手。我有这段代码:
private void render() //renders graphics
{
BufferStrategy bs = this.getBufferStrategy();
if(bs == null)
{
this.createBufferStrategy(3);
return;
}
Graphics g = bs.getDrawGraphics();
g.setColor(Color.BLACK);
g.fillRect(0, 0,WIDTH, HEIGHT);
g.setFont(new Font("Dialog", Font.BOLD, 18)); //doesnt work
g.drawString(Color.BLUE + "FPS: " + Color.ORANGE + frames, 50, 50);
handler.render(g);
hud.render(g);
g.dispose();
bs.show();
}
我有一个问题......应该显示fps的g.drawString没有显示fps ...我错了什么?这是在java btw ...