LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Hungry Joe on November 25, 2003, 20:24:24

Title: Anyone got a class for writing text to the screen?
Post by: Hungry Joe on November 25, 2003, 20:24:24
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?
Title: Anyone got a class for writing text to the screen?
Post by: princec on November 25, 2003, 22:22:01
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 :)
Title: Anyone got a class for writing text to the screen?
Post by: Hungry Joe on December 11, 2003, 13:11:43
thanks mate!
Title: Anyone got a class for writing text to the screen?
Post by: darkprophet on December 19, 2003, 16:10:57
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: