Overlay Problems

Well, I am trying to use the overlayBase from j3d.org, but run into some problems. For those who already used it, it would be nice if you could help me out here …

I simply extended the OverlayBase class and overwrote the pain() method with a simple g.drawString(). This mehtod is defently being called cause I checked it with a println. Then I added the root of this object to my viewTG. So normally everything should work fine I think but it doesn’t. I use the canvas3D and dimension constructor.

My guess is that either my dimensions are wrong or there need to be another option in the overlay somewhere to activate something orso … (did make it visible). I just gave it my screen dimension of the frame 800 x 600

Somebody ?

hmm … feel really stupid here … after a very long search I found I forgot to call initialize() in my constructor.

Now it works like a charm …

hmm … sorry guys. But now the painting works fine, but he doesn’t remove the old text. So if I for example want to write out my FPS, he simply places the new text above the old one …

probably another stupid question but well … I don’t see the solution right now.

The old image is still there underneath, so you first have to paint over any bits you don’t want to show, in this case the old text, you can eaither find the area it covered and just redraw that, or redraw the whole image each time.

Endolf

and how do you choose to redraw the whole image … ?
Seams like easiest method.

There is loads of info around for using java2d, Graphics2D javadoc is a good place to start.

Endolf

well I already checked around a bit, but I can’t really seam to find a solution. I just want to have a clear overlay every time I call paint. I already tried to clear everything but off coarse the world is being cleared also and goes very very slow. Somehow he remembers my old drawing somewhere, and copies it onto the new buffered image, but I simply want to replace it …

Thanx.