Text Overlay

Okay, I've looked into Text2D, TextFactory, Text, JmeText, etc. and I may have missed it but:

Is there anyway, without using a 3rd party GUI to display mult-line text at a specified position on the screen?

I basically need to dump some flight parameters so I can verify my trajectory code. It doesn't have to be pretty.

Everything I've looked at appears to do a single line on the bottom of the screen, including TextGameState, which was my first choice (since, I love game states. :slight_smile: )

A pointer in the right direction would be most appreciated.



ortho or somewhere in the scene?

Ortho, I guess. I want it to stay parallel to the camera view no matter how I rotate the view, if that makes sense.

then you can either combine multiple Text instances or use Java2D to generate textures containing the text.

So Text can be positioned using setLocalTranslation, then?

Is there a noticable. preformance hit for having 15-16 multiples of Text?

I could extend my status class (which uses Text) rather easily if I can clone it and move it.

Text uses display lists so it should be relatively steady cost.  Just the extra alpha blending and fill as you have more text.

This thread might be of interest to you:


Take a look at the source code as it handles positioning of multiple lines of text…and is just awesome. :slight_smile:

Also, there’s a pretty video I made here:


I looked at that thread; it was quite a lot to wade through. I have to get on my Windows box to look at the movie though.

I was able to create a simple GameState that can display a fixed number of lines. There's a way to address the lines separately, print to one and point to the next and clear. I should tighten up the documentation (more correcly generalize it) and post it in the User Section. I'll try to do that during the weekend. Again, real simple, but someone might have a use for it.

Thanks all for the code and the ideas!


Cool, look forward to seeing your contribution.

BTW, every time I see your nickname it makes me think "ask joey"…or maybe my eyes are just getting bad  :stuck_out_tongue:

darkfrog said:

Cool, look forward to seeing your contribution.

BTW, every time I see your nickname it makes me think "ask joey"....or maybe my eyes are just getting bad

That's pretty cool. :slight_smile:

I promised the code for my status game state class. I just posted it to the user code forum:


Thanks again for all the help and ideas,