Hi
I’ve gone back to using my own class that extends UIOverlay and implements UIOveralyInterface. It calls super(width, height, false, true) on construction so the UIOverlay should know that there is transparency envolved. I override the paint method and call something along the lines of
paint(Graphics2D graphics) {
graphics.setBackground(new Color(0,0,0,0));
graphics.clearRect(0,0,width-1, height-1);
graphics.setColor(Color.WHITE);
graphics.drawRect(0,0,width-1, height-1);
graphics.drawString("FPS: " + fps, 2, 2 + graphics.getFontMetrics().getMaxAscent());
}
The problem is that when the first image is rendered it’s all fine, then 1 second later I update the fps count with a new frame rate and call repaint, the new image seems to get overlayed on top of the old one, then 1 second later the same happens again, and before long you have a blur of numbers. I’ve tried creating a buffered image and calling paint(image.getGrahpics()) after I call repaint, but the images dumped from that seem fine (No previous text, just the latest string, and the alpha chanel is correct). I admit that I am lost on this one. Anyone got any ideas? (apart from using opaque fps counter :P)
Cheers
Endolf