Java Lesson 8: Titles and Text

Lesson 8

I’m rather excited about this lesson. I can finally print text on the screen. One of the worst ways to print text to the screen is to try to render true type fonts in real time. The fast way is to render bitmap fonts to the screen. The drawback to bitmap fonts is that the text has to be prerendered and the coordinates for each character has to be stored somewhere so the program has access to the information.

That drawback goes away when you learn how to make the language render that bitmap font for you at runtime. Lesson 8 shows you how to do it using Java. You can pick any font, any size, any color and it takes it from there. It’s also possible to do it using DirectX/OpenGL, C++ and the Windows API. The only issue now is fancy fonts. It’s a lot easier to do fancy lettering in a paint program than it is to make a language do it. It is possible but we’ll get to that later. Maybe in Lesson 9 we’ll fancy up the font a bit.

The other cool thing with this lesson is the addition of game states which allows us to have a title screen. Our graphics functions are getting a little more advanced now to accomidate these new features. Lesson 9 will continue to enhance the existing code and finally make a complete game. Lesson 10 will bulk up the eye candy.

Who knows where this will go from there.

Leave a comment

You must be logged in to post a comment.

ss_blog_claim=70b9168863fc97c91e6d88b40542a327 ss_blog_claim=70b9168863fc97c91e6d88b40542a327