Anyone got a class for writing text to the screen?

Started by Hungry Joe, November 25, 2003, 20:24:24

Previous topic - Next topic

Hungry Joe

Basically I want to add an FPS counter to my program, and I was wondering if anyone out there has written a class which you can just call a writeText(x, y, "message") sort of thing to make my life easier?

princec

Yes, there's a thing to do that in the SPGL: com.shavenpuppy.jglib.opengl.GLString

It requires that you have a font file prebuilt using the SPGL-tools FontConverter, which uses Java2D ahead-of-time to build a normal AWT font into a com.shavenpuppy.jglib.Font file which can be used to create a com.shavenpuppy.jglib.opengl.GLFont. This you then give to the GLString instance along with a pair of coordinates and some text. Voila!

Cas :)


darkprophet

do you know a way in which I can write stuff to the screen without the library..kinda like how NeHe does it.

I tried Nehe's way.. didnt work!!  :oops: